Re: [Intel-gfx] [PATCH 3/3] drm/i915: Make num_sprites a per-pipe value

2014-03-03 Thread Damien Lespiau
On Fri, Feb 28, 2014 at 05:49:20PM +, Chris Wilson wrote:
 On Fri, Feb 28, 2014 at 05:37:39PM +, Damien Lespiau wrote:
  On Fri, Feb 28, 2014 at 05:30:02PM +, Chris Wilson wrote:
   On Fri, Feb 28, 2014 at 04:42:15PM +, Damien Lespiau wrote:
In the future, we need to be able to specify per-pipe number of
planes/sprites. Let's start today!
   
   But today, what's wrong with:
   for_each_pipe(pipe) info-num_sprites[pipe] = IS_VLV(dev) ? 2 : 1;
  
  I'd rather have info-num_sprites[pipe] == 0 when the device doesn't
  support that pipe, even if that value shouldn't be used anywhere.
 
 for (; pipe  I915_NUM_PIPES; pipe++) info-num_sprites[pipe] = 0;
 -Chris

Would:

if (IS_VALLEYVIEW(dev)) 
for_each_pipe(pipe)
info-num_sprites[pipe] = 2;
else 
for_each_pipe(pipe)
info-num_sprites[pipe] = 1;

be acceptable to your keen eye?

-- 
Damien
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/3] drm/i915: Make num_sprites a per-pipe value

2014-03-03 Thread Chris Wilson
On Mon, Mar 03, 2014 at 02:49:36PM +, Damien Lespiau wrote:
 On Fri, Feb 28, 2014 at 05:49:20PM +, Chris Wilson wrote:
  On Fri, Feb 28, 2014 at 05:37:39PM +, Damien Lespiau wrote:
   On Fri, Feb 28, 2014 at 05:30:02PM +, Chris Wilson wrote:
On Fri, Feb 28, 2014 at 04:42:15PM +, Damien Lespiau wrote:
 In the future, we need to be able to specify per-pipe number of
 planes/sprites. Let's start today!

But today, what's wrong with:
for_each_pipe(pipe) info-num_sprites[pipe] = IS_VLV(dev) ? 2 : 1;
   
   I'd rather have info-num_sprites[pipe] == 0 when the device doesn't
   support that pipe, even if that value shouldn't be used anywhere.
  
  for (; pipe  I915_NUM_PIPES; pipe++) info-num_sprites[pipe] = 0;
  -Chris
 
 Would:
 
 if (IS_VALLEYVIEW(dev)) 
 for_each_pipe(pipe)
 info-num_sprites[pipe] = 2;
 else 
 for_each_pipe(pipe)
 info-num_sprites[pipe] = 1;
 
 be acceptable to your keen eye?

Only because I strongly suspect the next branch to not be as clean.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/3] drm/i915: Make num_sprites a per-pipe value

2014-03-02 Thread Zhenyu Wang
On 2014.02.28 16:42:15 +, Damien Lespiau wrote:
 In the future, we need to be able to specify per-pipe number of
 planes/sprites. Let's start today!
 

The number of sprite planes on each pipe is always fixed in our HW.
Do we really need this in the future?

-- 
Open Source Technology Center, Intel ltd.

$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827


signature.asc
Description: Digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH 3/3] drm/i915: Make num_sprites a per-pipe value

2014-02-28 Thread Damien Lespiau
In the future, we need to be able to specify per-pipe number of
planes/sprites. Let's start today!

Signed-off-by: Damien Lespiau damien.lesp...@intel.com
---
 drivers/gpu/drm/i915/i915_dma.c | 14 +++---
 drivers/gpu/drm/i915/i915_drv.h |  6 +++---
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 7688abc..a128f66 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1483,9 +1483,17 @@ static void intel_device_info_runtime_init(struct 
drm_device *dev)
 
info = (struct intel_device_info *)dev_priv-info;
 
-   info-num_sprites = 1;
-   if (IS_VALLEYVIEW(dev))
-   info-num_sprites = 2;
+   if (IS_VALLEYVIEW(dev)) {
+   info-num_sprites[PIPE_A] = 2;
+   info-num_sprites[PIPE_B] = 2;
+   } else {
+   if (info-num_pipes = 1)
+   info-num_sprites[PIPE_A] = 1;
+   if (info-num_pipes = 2)
+   info-num_sprites[PIPE_B] = 1;
+   if (info-num_pipes = 3)
+   info-num_sprites[PIPE_C] = 1;
+   }
 
if (i915.disable_display) {
DRM_INFO(Display disabled (module parameter)\n);
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index ad51a0e..7cd0941 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -79,7 +79,7 @@ enum plane {
 };
 #define plane_name(p) ((p) + 'A')
 
-#define sprite_name(p, s) ((p) * INTEL_INFO(dev)-num_sprites + (s) + 'A')
+#define sprite_name(p, s) ((p) * INTEL_INFO(dev)-num_sprites[(p)] + (s) + 'A')
 
 enum port {
PORT_A = 0,
@@ -159,7 +159,7 @@ enum hpd_pin {
 I915_GEM_DOMAIN_VERTEX)
 
 #define for_each_pipe(p) for ((p) = 0; (p)  INTEL_INFO(dev)-num_pipes; (p)++)
-#define for_each_sprite(p, s) for ((s) = 0; (s)  
INTEL_INFO(dev)-num_sprites; (s)++)
+#define for_each_sprite(p, s) for ((s) = 0; (s)  
INTEL_INFO(dev)-num_sprites[(p)]; (s)++)
 
 #define for_each_encoder_on_crtc(dev, __crtc, intel_encoder) \
list_for_each_entry((intel_encoder), (dev)-mode_config.encoder_list, 
base.head) \
@@ -535,7 +535,7 @@ struct intel_uncore {
 struct intel_device_info {
u32 display_mmio_offset;
u8 num_pipes:3;
-   u8 num_sprites:2;
+   u8 num_sprites[I915_MAX_PIPES];
u8 gen;
u8 ring_mask; /* Rings supported by the HW */
DEV_INFO_FOR_EACH_FLAG(DEFINE_FLAG, SEP_SEMICOLON);
-- 
1.8.3.1

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/3] drm/i915: Make num_sprites a per-pipe value

2014-02-28 Thread Chris Wilson
On Fri, Feb 28, 2014 at 04:42:15PM +, Damien Lespiau wrote:
 In the future, we need to be able to specify per-pipe number of
 planes/sprites. Let's start today!

But today, what's wrong with:
for_each_pipe(pipe) info-num_sprites[pipe] = IS_VLV(dev) ? 2 : 1;
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/3] drm/i915: Make num_sprites a per-pipe value

2014-02-28 Thread Damien Lespiau
On Fri, Feb 28, 2014 at 05:30:02PM +, Chris Wilson wrote:
 On Fri, Feb 28, 2014 at 04:42:15PM +, Damien Lespiau wrote:
  In the future, we need to be able to specify per-pipe number of
  planes/sprites. Let's start today!
 
 But today, what's wrong with:
 for_each_pipe(pipe) info-num_sprites[pipe] = IS_VLV(dev) ? 2 : 1;

I'd rather have info-num_sprites[pipe] == 0 when the device doesn't
support that pipe, even if that value shouldn't be used anywhere.

-- 
Damien

___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/3] drm/i915: Make num_sprites a per-pipe value

2014-02-28 Thread Chris Wilson
On Fri, Feb 28, 2014 at 05:37:39PM +, Damien Lespiau wrote:
 On Fri, Feb 28, 2014 at 05:30:02PM +, Chris Wilson wrote:
  On Fri, Feb 28, 2014 at 04:42:15PM +, Damien Lespiau wrote:
   In the future, we need to be able to specify per-pipe number of
   planes/sprites. Let's start today!
  
  But today, what's wrong with:
  for_each_pipe(pipe) info-num_sprites[pipe] = IS_VLV(dev) ? 2 : 1;
 
 I'd rather have info-num_sprites[pipe] == 0 when the device doesn't
 support that pipe, even if that value shouldn't be used anywhere.

for (; pipe  I915_NUM_PIPES; pipe++) info-num_sprites[pipe] = 0;
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 3/3] drm/i915: Make num_sprites a per-pipe value

2014-02-28 Thread Ville Syrjälä
On Fri, Feb 28, 2014 at 05:49:20PM +, Chris Wilson wrote:
 On Fri, Feb 28, 2014 at 05:37:39PM +, Damien Lespiau wrote:
  On Fri, Feb 28, 2014 at 05:30:02PM +, Chris Wilson wrote:
   On Fri, Feb 28, 2014 at 04:42:15PM +, Damien Lespiau wrote:
In the future, we need to be able to specify per-pipe number of
planes/sprites. Let's start today!
   
   But today, what's wrong with:
   for_each_pipe(pipe) info-num_sprites[pipe] = IS_VLV(dev) ? 2 : 1;
  
  I'd rather have info-num_sprites[pipe] == 0 when the device doesn't
  support that pipe, even if that value shouldn't be used anywhere.
 
 for (; pipe  I915_NUM_PIPES; pipe++) info-num_sprites[pipe] = 0;

It should be zero initialized anyway, so we shouldn't need to do that.

-- 
Ville Syrjälä
Intel OTC
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx