All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking
@ 2018-01-23 18:33 Ville Syrjala
  2018-01-23 19:00 ` ✓ Fi.CI.BAT: success for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Ville Syrjala @ 2018-01-23 18:33 UTC (permalink / raw)
  To: intel-gfx

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Replace the ad-hoc plane indexing scheme used by the frontbuffer
tracking with enum plane_id.

The old video overlay not being part of the plane_id namespace
will just be given the high bit.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      | 11 +++--------
 drivers/gpu/drm/i915/intel_display.c |  4 ++--
 drivers/gpu/drm/i915/intel_fbc.c     |  2 +-
 drivers/gpu/drm/i915/intel_sprite.c  |  4 +++-
 4 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index 8333692dac5a..bd545b1c9546 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2404,16 +2404,11 @@ enum hdmi_force_audio {
  *
  * We have one bit per pipe and per scanout plane type.
  */
-#define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
 #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8
-#define INTEL_FRONTBUFFER_PRIMARY(pipe) \
-	(1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
-#define INTEL_FRONTBUFFER_CURSOR(pipe) \
-	(1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
-#define INTEL_FRONTBUFFER_SPRITE(pipe, plane) \
-	(1 << (2 + plane + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
+#define INTEL_FRONTBUFFER(pipe, plane_id) \
+	(1 << ((plane_id) + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
 #define INTEL_FRONTBUFFER_OVERLAY(pipe) \
-	(1 << (2 + INTEL_MAX_SPRITE_BITS_PER_PIPE + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
+	(1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE - 1 + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
 #define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
 	(0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
 
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index d585ce4c8732..3cc35add362f 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -13168,7 +13168,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
 	else
 		primary->i9xx_plane = (enum i9xx_plane_id) pipe;
 	primary->id = PLANE_PRIMARY;
-	primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
+	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
 	primary->check_plane = intel_check_primary_plane;
 
 	if (INTEL_GEN(dev_priv) >= 9) {
@@ -13289,7 +13289,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
 	cursor->pipe = pipe;
 	cursor->i9xx_plane = (enum i9xx_plane_id) pipe;
 	cursor->id = PLANE_CURSOR;
-	cursor->frontbuffer_bit = INTEL_FRONTBUFFER_CURSOR(pipe);
+	cursor->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, cursor->id);
 
 	if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
 		cursor->update_plane = i845_update_cursor;
diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
index 9dc2b8b5f2db..a8a8a80497a8 100644
--- a/drivers/gpu/drm/i915/intel_fbc.c
+++ b/drivers/gpu/drm/i915/intel_fbc.c
@@ -1373,7 +1373,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
 
 	for_each_pipe(dev_priv, pipe) {
 		fbc->possible_framebuffer_bits |=
-				INTEL_FRONTBUFFER_PRIMARY(pipe);
+			INTEL_FRONTBUFFER(pipe, PLANE_PRIMARY);
 
 		if (fbc_on_pipe_a_only(dev_priv))
 			break;
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index a92c748ca8ab..18ef0392362e 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -345,6 +345,8 @@ skl_plane_get_hw_state(struct intel_plane *plane)
 	return ret;
 }
 
+
+
 static void
 chv_update_csc(struct intel_plane *plane, uint32_t format)
 {
@@ -1427,7 +1429,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
 	intel_plane->pipe = pipe;
 	intel_plane->i9xx_plane = plane;
 	intel_plane->id = PLANE_SPRITE0 + plane;
-	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER_SPRITE(pipe, plane);
+	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, intel_plane->id);
 	intel_plane->check_plane = intel_check_sprite_plane;
 
 	possible_crtcs = (1 << pipe);
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* ✓ Fi.CI.BAT: success for drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-23 18:33 [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking Ville Syrjala
@ 2018-01-23 19:00 ` Patchwork
  2018-01-23 21:11 ` [PATCH] " Chris Wilson
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 11+ messages in thread
From: Patchwork @ 2018-01-23 19:00 UTC (permalink / raw)
  To: Ville Syrjala; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Use enum plane_id for frontbuffer tracking
URL   : https://patchwork.freedesktop.org/series/36991/
State : success

== Summary ==

Series 36991v1 drm/i915: Use enum plane_id for frontbuffer tracking
https://patchwork.freedesktop.org/api/1.0/series/36991/revisions/1/mbox/

Test debugfs_test:
        Subgroup read_all_entries:
                dmesg-fail -> DMESG-WARN (fi-elk-e7500) fdo#103989
                pass       -> DMESG-WARN (fi-bdw-gvtdvm) fdo#103938 +1

fdo#103989 https://bugs.freedesktop.org/show_bug.cgi?id=103989
fdo#103938 https://bugs.freedesktop.org/show_bug.cgi?id=103938

fi-bdw-5557u     total:288  pass:267  dwarn:0   dfail:0   fail:0   skip:21  time:422s
fi-bdw-gvtdvm    total:288  pass:262  dwarn:2   dfail:0   fail:0   skip:24  time:425s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:370s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:482s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:280s
fi-bxt-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:477s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:487s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:470s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:458s
fi-elk-e7500     total:224  pass:168  dwarn:10  dfail:0   fail:0   skip:45 
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:277s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:510s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:389s
fi-hsw-4770r     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:405s
fi-ilk-650       total:288  pass:228  dwarn:0   dfail:0   fail:0   skip:60  time:410s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:463s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:417s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:469s
fi-kbl-7560u     total:288  pass:269  dwarn:0   dfail:0   fail:0   skip:19  time:500s
fi-kbl-7567u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:11  time:451s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:501s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:586s
fi-skl-6260u     total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:440s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:509s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:528s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:493s
fi-skl-6770hq    total:288  pass:268  dwarn:0   dfail:0   fail:0   skip:20  time:484s
fi-skl-guc       total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:416s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:518s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:394s
Blacklisted hosts:
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:566s
fi-glk-dsi       total:288  pass:258  dwarn:0   dfail:0   fail:0   skip:30  time:469s
fi-skl-gvtdvm failed to collect. IGT log at Patchwork_7755/fi-skl-gvtdvm/igt.log

5e022f5f329c7909cb9aa938364072329f694fb2 drm-tip: 2018y-01m-23d-17h-29m-20s UTC integration manifest
923110da5f60 drm/i915: Use enum plane_id for frontbuffer tracking

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7755/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-23 18:33 [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking Ville Syrjala
  2018-01-23 19:00 ` ✓ Fi.CI.BAT: success for " Patchwork
@ 2018-01-23 21:11 ` Chris Wilson
  2018-01-24 17:36   ` Ville Syrjälä
  2018-01-23 21:12 ` Chris Wilson
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Chris Wilson @ 2018-01-23 21:11 UTC (permalink / raw)
  To: Ville Syrjala, intel-gfx

Quoting Ville Syrjala (2018-01-23 18:33:43)
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Replace the ad-hoc plane indexing scheme used by the frontbuffer
> tracking with enum plane_id.
> 
> The old video overlay not being part of the plane_id namespace
> will just be given the high bit.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      | 11 +++--------
>  drivers/gpu/drm/i915/intel_display.c |  4 ++--
>  drivers/gpu/drm/i915/intel_fbc.c     |  2 +-
>  drivers/gpu/drm/i915/intel_sprite.c  |  4 +++-
>  4 files changed, 9 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 8333692dac5a..bd545b1c9546 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2404,16 +2404,11 @@ enum hdmi_force_audio {
>   *
>   * We have one bit per pipe and per scanout plane type.
>   */
> -#define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
>  #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8

I would feel safer with a BUILD_BUG_ON to catch plane_id overflowing
INTEL_FRONTBUFFER_BITS_PER_PIPE (-1 for the overlay reservation).

> -#define INTEL_FRONTBUFFER_PRIMARY(pipe) \
> -       (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> -#define INTEL_FRONTBUFFER_CURSOR(pipe) \
> -       (1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> -#define INTEL_FRONTBUFFER_SPRITE(pipe, plane) \
> -       (1 << (2 + plane + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> +#define INTEL_FRONTBUFFER(pipe, plane_id) \
> +       (1 << ((plane_id) + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
>  #define INTEL_FRONTBUFFER_OVERLAY(pipe) \
> -       (1 << (2 + INTEL_MAX_SPRITE_BITS_PER_PIPE + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> +       (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE - 1 + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
>  #define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
>         (0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))

The conversion looks straightforward nevertheless, and indeed no reason
to have move than one indexing id for a plane.
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-23 18:33 [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking Ville Syrjala
  2018-01-23 19:00 ` ✓ Fi.CI.BAT: success for " Patchwork
  2018-01-23 21:11 ` [PATCH] " Chris Wilson
@ 2018-01-23 21:12 ` Chris Wilson
  2018-01-24  4:04 ` ✗ Fi.CI.IGT: failure for " Patchwork
  2018-01-24  4:16 ` [PATCH] " Pandiyan, Dhinakaran
  4 siblings, 0 replies; 11+ messages in thread
From: Chris Wilson @ 2018-01-23 21:12 UTC (permalink / raw)
  To: Ville Syrjala, intel-gfx

Quoting Ville Syrjala (2018-01-23 18:33:43)
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index a92c748ca8ab..18ef0392362e 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -345,6 +345,8 @@ skl_plane_get_hw_state(struct intel_plane *plane)
>         return ret;
>  }
>  
> +
> +
>  static void
>  chv_update_csc(struct intel_plane *plane, uint32_t format)
>  {

And just in case this unwanted chunk managed to escape notice...
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* ✗ Fi.CI.IGT: failure for drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-23 18:33 [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking Ville Syrjala
                   ` (2 preceding siblings ...)
  2018-01-23 21:12 ` Chris Wilson
@ 2018-01-24  4:04 ` Patchwork
  2018-01-24 17:09   ` Ville Syrjälä
  2018-01-24  4:16 ` [PATCH] " Pandiyan, Dhinakaran
  4 siblings, 1 reply; 11+ messages in thread
From: Patchwork @ 2018-01-24  4:04 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Use enum plane_id for frontbuffer tracking
URL   : https://patchwork.freedesktop.org/series/36991/
State : failure

== Summary ==

Test kms_flip:
        Subgroup 2x-wf_vblank-ts-check-interruptible:
                pass       -> FAIL       (shard-hsw)
        Subgroup flip-vs-expired-vblank-interruptible:
                fail       -> PASS       (shard-hsw) fdo#102887
        Subgroup vblank-vs-modeset-suspend:
                pass       -> SKIP       (shard-snb) fdo#102365 +1
        Subgroup vblank-vs-modeset-suspend-interruptible:
                pass       -> DMESG-WARN (shard-snb)
        Subgroup plain-flip-fb-recreate-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#100368
Test kms_sysfs_edid_timing:
                warn       -> PASS       (shard-apl) fdo#100047
Test gem_softpin:
        Subgroup noreloc-s4:
                fail       -> SKIP       (shard-snb) fdo#103375
Test perf:
        Subgroup buffer-fill:
                pass       -> FAIL       (shard-apl) fdo#103755

fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755

shard-apl        total:2753 pass:1716 dwarn:1   dfail:0   fail:23  skip:1013 time:14064s
shard-hsw        total:2753 pass:1723 dwarn:1   dfail:0   fail:13  skip:1015 time:15328s
shard-snb        total:2753 pass:1317 dwarn:2   dfail:0   fail:9   skip:1425 time:7847s
Blacklisted hosts:
shard-kbl        total:2753 pass:1821 dwarn:16  dfail:1   fail:24  skip:891 time:11113s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7755/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-23 18:33 [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking Ville Syrjala
                   ` (3 preceding siblings ...)
  2018-01-24  4:04 ` ✗ Fi.CI.IGT: failure for " Patchwork
@ 2018-01-24  4:16 ` Pandiyan, Dhinakaran
  2018-01-24 15:16   ` Ville Syrjälä
  4 siblings, 1 reply; 11+ messages in thread
From: Pandiyan, Dhinakaran @ 2018-01-24  4:16 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

On Tue, 2018-01-23 at 20:33 +0200, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Replace the ad-hoc plane indexing scheme used by the frontbuffer
> tracking with enum plane_id.
> 
> The old video overlay not being part of the plane_id namespace
> will just be given the high bit.

I'm curious why the bit corresponding to PLANE_SPRITE0 is not re-used
for the overlay. From a cursory read seems like platforms with overlays
and sprites are mutually exclusive.

Related question, how different is this overlay from the sprite planes?


> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h      | 11 +++--------
>  drivers/gpu/drm/i915/intel_display.c |  4 ++--
>  drivers/gpu/drm/i915/intel_fbc.c     |  2 +-
>  drivers/gpu/drm/i915/intel_sprite.c  |  4 +++-
>  4 files changed, 9 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 8333692dac5a..bd545b1c9546 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -2404,16 +2404,11 @@ enum hdmi_force_audio {
>   *
>   * We have one bit per pipe and per scanout plane type.
>   */
> -#define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
>  #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8
> -#define INTEL_FRONTBUFFER_PRIMARY(pipe) \
> -	(1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> -#define INTEL_FRONTBUFFER_CURSOR(pipe) \
> -	(1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> -#define INTEL_FRONTBUFFER_SPRITE(pipe, plane) \
> -	(1 << (2 + plane + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> +#define INTEL_FRONTBUFFER(pipe, plane_id) \
> +	(1 << ((plane_id) + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
>  #define INTEL_FRONTBUFFER_OVERLAY(pipe) \
> -	(1 << (2 + INTEL_MAX_SPRITE_BITS_PER_PIPE + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> +	(1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE - 1 + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
>  #define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
>  	(0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
>  
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index d585ce4c8732..3cc35add362f 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -13168,7 +13168,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
>  	else
>  		primary->i9xx_plane = (enum i9xx_plane_id) pipe;
>  	primary->id = PLANE_PRIMARY;
> -	primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
> +	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
>  	primary->check_plane = intel_check_primary_plane;
>  
>  	if (INTEL_GEN(dev_priv) >= 9) {
> @@ -13289,7 +13289,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
>  	cursor->pipe = pipe;
>  	cursor->i9xx_plane = (enum i9xx_plane_id) pipe;
>  	cursor->id = PLANE_CURSOR;
> -	cursor->frontbuffer_bit = INTEL_FRONTBUFFER_CURSOR(pipe);
> +	cursor->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, cursor->id);
>  
>  	if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
>  		cursor->update_plane = i845_update_cursor;
> diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> index 9dc2b8b5f2db..a8a8a80497a8 100644
> --- a/drivers/gpu/drm/i915/intel_fbc.c
> +++ b/drivers/gpu/drm/i915/intel_fbc.c
> @@ -1373,7 +1373,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
>  
>  	for_each_pipe(dev_priv, pipe) {
>  		fbc->possible_framebuffer_bits |=
> -				INTEL_FRONTBUFFER_PRIMARY(pipe);
> +			INTEL_FRONTBUFFER(pipe, PLANE_PRIMARY);
>  
>  		if (fbc_on_pipe_a_only(dev_priv))
>  			break;
> diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> index a92c748ca8ab..18ef0392362e 100644
> --- a/drivers/gpu/drm/i915/intel_sprite.c
> +++ b/drivers/gpu/drm/i915/intel_sprite.c
> @@ -345,6 +345,8 @@ skl_plane_get_hw_state(struct intel_plane *plane)
>  	return ret;
>  }
>  
> +
> +
>  static void
>  chv_update_csc(struct intel_plane *plane, uint32_t format)
>  {
> @@ -1427,7 +1429,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
>  	intel_plane->pipe = pipe;
>  	intel_plane->i9xx_plane = plane;
>  	intel_plane->id = PLANE_SPRITE0 + plane;
> -	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER_SPRITE(pipe, plane);
> +	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, intel_plane->id);
>  	intel_plane->check_plane = intel_check_sprite_plane;
>  
>  	possible_crtcs = (1 << pipe);
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-24  4:16 ` [PATCH] " Pandiyan, Dhinakaran
@ 2018-01-24 15:16   ` Ville Syrjälä
  2018-01-24 19:03     ` Pandiyan, Dhinakaran
  0 siblings, 1 reply; 11+ messages in thread
From: Ville Syrjälä @ 2018-01-24 15:16 UTC (permalink / raw)
  To: Pandiyan, Dhinakaran; +Cc: intel-gfx

On Wed, Jan 24, 2018 at 04:16:19AM +0000, Pandiyan, Dhinakaran wrote:
> On Tue, 2018-01-23 at 20:33 +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Replace the ad-hoc plane indexing scheme used by the frontbuffer
> > tracking with enum plane_id.
> > 
> > The old video overlay not being part of the plane_id namespace
> > will just be given the high bit.
> 
> I'm curious why the bit corresponding to PLANE_SPRITE0 is not re-used
> for the overlay. From a cursory read seems like platforms with overlays
> and sprites are mutually exclusive.

Currently yes, but maybe not in the future. I still have dreams of
exposing all the planes on these platforms, which would mean having
at least one sprite plane that's not the video overlay. I haven't
really figured out how to make it all work out nicely with enum
plane_id though as that's a per-pipe thing and the planes on the
old hw are not necessarily tied to a single pipe. Perhaps one
option would be to assign the plane ids globally, ie. PRIMARY==A,
PLANE1==B, PLANE2==C, etc. Not sure if that would actually work out
though.

> 
> Related question, how different is this overlay from the sprite planes?

Very different. I would like to expose it as a drm_plane eventually,
but there's a bit of actual work involved to convert the overlay
register updates to use mmio, and to handle the render cache
reconfiguration (which still involves stuffing MI commands to the
ring) in a decent way.

I do have a basic mmio conversion sitting on some branch somewhere,
but I don't think I got it to look as nice as I'd like. Plus it's
probably bitrotted enough by now that it needs some rework anyway.

> 
> 
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h      | 11 +++--------
> >  drivers/gpu/drm/i915/intel_display.c |  4 ++--
> >  drivers/gpu/drm/i915/intel_fbc.c     |  2 +-
> >  drivers/gpu/drm/i915/intel_sprite.c  |  4 +++-
> >  4 files changed, 9 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 8333692dac5a..bd545b1c9546 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -2404,16 +2404,11 @@ enum hdmi_force_audio {
> >   *
> >   * We have one bit per pipe and per scanout plane type.
> >   */
> > -#define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
> >  #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8
> > -#define INTEL_FRONTBUFFER_PRIMARY(pipe) \
> > -	(1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > -#define INTEL_FRONTBUFFER_CURSOR(pipe) \
> > -	(1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > -#define INTEL_FRONTBUFFER_SPRITE(pipe, plane) \
> > -	(1 << (2 + plane + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > +#define INTEL_FRONTBUFFER(pipe, plane_id) \
> > +	(1 << ((plane_id) + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> >  #define INTEL_FRONTBUFFER_OVERLAY(pipe) \
> > -	(1 << (2 + INTEL_MAX_SPRITE_BITS_PER_PIPE + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > +	(1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE - 1 + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> >  #define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
> >  	(0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> >  
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index d585ce4c8732..3cc35add362f 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -13168,7 +13168,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
> >  	else
> >  		primary->i9xx_plane = (enum i9xx_plane_id) pipe;
> >  	primary->id = PLANE_PRIMARY;
> > -	primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
> > +	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
> >  	primary->check_plane = intel_check_primary_plane;
> >  
> >  	if (INTEL_GEN(dev_priv) >= 9) {
> > @@ -13289,7 +13289,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
> >  	cursor->pipe = pipe;
> >  	cursor->i9xx_plane = (enum i9xx_plane_id) pipe;
> >  	cursor->id = PLANE_CURSOR;
> > -	cursor->frontbuffer_bit = INTEL_FRONTBUFFER_CURSOR(pipe);
> > +	cursor->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, cursor->id);
> >  
> >  	if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
> >  		cursor->update_plane = i845_update_cursor;
> > diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> > index 9dc2b8b5f2db..a8a8a80497a8 100644
> > --- a/drivers/gpu/drm/i915/intel_fbc.c
> > +++ b/drivers/gpu/drm/i915/intel_fbc.c
> > @@ -1373,7 +1373,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
> >  
> >  	for_each_pipe(dev_priv, pipe) {
> >  		fbc->possible_framebuffer_bits |=
> > -				INTEL_FRONTBUFFER_PRIMARY(pipe);
> > +			INTEL_FRONTBUFFER(pipe, PLANE_PRIMARY);
> >  
> >  		if (fbc_on_pipe_a_only(dev_priv))
> >  			break;
> > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> > index a92c748ca8ab..18ef0392362e 100644
> > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > @@ -345,6 +345,8 @@ skl_plane_get_hw_state(struct intel_plane *plane)
> >  	return ret;
> >  }
> >  
> > +
> > +
> >  static void
> >  chv_update_csc(struct intel_plane *plane, uint32_t format)
> >  {
> > @@ -1427,7 +1429,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
> >  	intel_plane->pipe = pipe;
> >  	intel_plane->i9xx_plane = plane;
> >  	intel_plane->id = PLANE_SPRITE0 + plane;
> > -	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER_SPRITE(pipe, plane);
> > +	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, intel_plane->id);
> >  	intel_plane->check_plane = intel_check_sprite_plane;
> >  
> >  	possible_crtcs = (1 << pipe);

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: ✗ Fi.CI.IGT: failure for drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-24  4:04 ` ✗ Fi.CI.IGT: failure for " Patchwork
@ 2018-01-24 17:09   ` Ville Syrjälä
  0 siblings, 0 replies; 11+ messages in thread
From: Ville Syrjälä @ 2018-01-24 17:09 UTC (permalink / raw)
  To: intel-gfx

On Wed, Jan 24, 2018 at 04:04:49AM -0000, Patchwork wrote:
> == Series Details ==
> 
> Series: drm/i915: Use enum plane_id for frontbuffer tracking
> URL   : https://patchwork.freedesktop.org/series/36991/
> State : failure
> 
> == Summary ==
> 
> Test kms_flip:
>         Subgroup 2x-wf_vblank-ts-check-interruptible:
>                 pass       -> FAIL       (shard-hsw)

missed a vblank
(kms_flip:8780) CRITICAL: Test assertion failure function calibrate_ts,
file kms_flip.c:1199:
(kms_flip:8780) CRITICAL: Failed assertion: ev.sequence == last_seq + 1
(kms_flip:8780) CRITICAL: Last errno: 4, Interrupted system call
(kms_flip:8780) CRITICAL: error: 56602 != 56601

>         Subgroup flip-vs-expired-vblank-interruptible:
>                 fail       -> PASS       (shard-hsw) fdo#102887
>         Subgroup vblank-vs-modeset-suspend:
>                 pass       -> SKIP       (shard-snb) fdo#102365 +1
>         Subgroup vblank-vs-modeset-suspend-interruptible:
>                 pass       -> DMESG-WARN (shard-snb)

[  116.297966] unchecked MSR access error: RDMSR from 0x1b0 at rIP:
0xffffffff8102e256 (init_intel_energy_perf.part.3+0x6/0xa0)

https://bugs.freedesktop.org/show_bug.cgi?id=102365

>         Subgroup plain-flip-fb-recreate-interruptible:
>                 pass       -> FAIL       (shard-hsw) fdo#100368
> Test kms_sysfs_edid_timing:
>                 warn       -> PASS       (shard-apl) fdo#100047
> Test gem_softpin:
>         Subgroup noreloc-s4:
>                 fail       -> SKIP       (shard-snb) fdo#103375
> Test perf:
>         Subgroup buffer-fill:
>                 pass       -> FAIL       (shard-apl) fdo#103755
> 
> fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
> fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
> fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
> fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
> fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
> fdo#103755 https://bugs.freedesktop.org/show_bug.cgi?id=103755
> 
> shard-apl        total:2753 pass:1716 dwarn:1   dfail:0   fail:23  skip:1013 time:14064s
> shard-hsw        total:2753 pass:1723 dwarn:1   dfail:0   fail:13  skip:1015 time:15328s
> shard-snb        total:2753 pass:1317 dwarn:2   dfail:0   fail:9   skip:1425 time:7847s
> Blacklisted hosts:
> shard-kbl        total:2753 pass:1821 dwarn:16  dfail:1   fail:24  skip:891 time:11113s
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7755/shards.html

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-23 21:11 ` [PATCH] " Chris Wilson
@ 2018-01-24 17:36   ` Ville Syrjälä
  2018-01-24 18:19     ` Ville Syrjälä
  0 siblings, 1 reply; 11+ messages in thread
From: Ville Syrjälä @ 2018-01-24 17:36 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Tue, Jan 23, 2018 at 09:11:23PM +0000, Chris Wilson wrote:
> Quoting Ville Syrjala (2018-01-23 18:33:43)
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Replace the ad-hoc plane indexing scheme used by the frontbuffer
> > tracking with enum plane_id.
> > 
> > The old video overlay not being part of the plane_id namespace
> > will just be given the high bit.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_drv.h      | 11 +++--------
> >  drivers/gpu/drm/i915/intel_display.c |  4 ++--
> >  drivers/gpu/drm/i915/intel_fbc.c     |  2 +-
> >  drivers/gpu/drm/i915/intel_sprite.c  |  4 +++-
> >  4 files changed, 9 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 8333692dac5a..bd545b1c9546 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -2404,16 +2404,11 @@ enum hdmi_force_audio {
> >   *
> >   * We have one bit per pipe and per scanout plane type.
> >   */
> > -#define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
> >  #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8
> 
> I would feel safer with a BUILD_BUG_ON to catch plane_id overflowing
> INTEL_FRONTBUFFER_BITS_PER_PIPE (-1 for the overlay reservation).

Actaully we'll be going past that BITS_PER_PIPE-1 limit real soon
now, but the BITS_PER_PIPE will be sufficient for some time I think.
So I think I'd just rather ignore the overlap between the plane_id
and the overlay because that's not going happen on actual hardware.

But I think asserting that BITS_PER_PIPE is sufficient is a good idea.
Just need to figure out where to put it. There's no init function
or anything like that in the frontbuffer tracking code, so that's
not going to work. I guess one option would be to include the
assert in the INTEL_FRONTBUFFER() macro itself.

> 
> > -#define INTEL_FRONTBUFFER_PRIMARY(pipe) \
> > -       (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > -#define INTEL_FRONTBUFFER_CURSOR(pipe) \
> > -       (1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > -#define INTEL_FRONTBUFFER_SPRITE(pipe, plane) \
> > -       (1 << (2 + plane + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > +#define INTEL_FRONTBUFFER(pipe, plane_id) \
> > +       (1 << ((plane_id) + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> >  #define INTEL_FRONTBUFFER_OVERLAY(pipe) \
> > -       (1 << (2 + INTEL_MAX_SPRITE_BITS_PER_PIPE + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > +       (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE - 1 + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> >  #define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
> >         (0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> 
> The conversion looks straightforward nevertheless, and indeed no reason
> to have move than one indexing id for a plane.
> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> -Chris

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-24 17:36   ` Ville Syrjälä
@ 2018-01-24 18:19     ` Ville Syrjälä
  0 siblings, 0 replies; 11+ messages in thread
From: Ville Syrjälä @ 2018-01-24 18:19 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

On Wed, Jan 24, 2018 at 07:36:01PM +0200, Ville Syrjälä wrote:
> On Tue, Jan 23, 2018 at 09:11:23PM +0000, Chris Wilson wrote:
> > Quoting Ville Syrjala (2018-01-23 18:33:43)
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > Replace the ad-hoc plane indexing scheme used by the frontbuffer
> > > tracking with enum plane_id.
> > > 
> > > The old video overlay not being part of the plane_id namespace
> > > will just be given the high bit.
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_drv.h      | 11 +++--------
> > >  drivers/gpu/drm/i915/intel_display.c |  4 ++--
> > >  drivers/gpu/drm/i915/intel_fbc.c     |  2 +-
> > >  drivers/gpu/drm/i915/intel_sprite.c  |  4 +++-
> > >  4 files changed, 9 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > > index 8333692dac5a..bd545b1c9546 100644
> > > --- a/drivers/gpu/drm/i915/i915_drv.h
> > > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > > @@ -2404,16 +2404,11 @@ enum hdmi_force_audio {
> > >   *
> > >   * We have one bit per pipe and per scanout plane type.
> > >   */
> > > -#define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
> > >  #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8
> > 
> > I would feel safer with a BUILD_BUG_ON to catch plane_id overflowing
> > INTEL_FRONTBUFFER_BITS_PER_PIPE (-1 for the overlay reservation).
> 
> Actaully we'll be going past that BITS_PER_PIPE-1 limit real soon
> now, but the BITS_PER_PIPE will be sufficient for some time I think.
> So I think I'd just rather ignore the overlap between the plane_id
> and the overlay because that's not going happen on actual hardware.
> 
> But I think asserting that BITS_PER_PIPE is sufficient is a good idea.
> Just need to figure out where to put it. There's no init function
> or anything like that in the frontbuffer tracking code, so that's
> not going to work. I guess one option would be to include the
> assert in the INTEL_FRONTBUFFER() macro itself.

Pushed this as is to dinq. Thanks for the review.

I'll send that BUILD_BUG_ON() as a followup.

> 
> > 
> > > -#define INTEL_FRONTBUFFER_PRIMARY(pipe) \
> > > -       (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > > -#define INTEL_FRONTBUFFER_CURSOR(pipe) \
> > > -       (1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > > -#define INTEL_FRONTBUFFER_SPRITE(pipe, plane) \
> > > -       (1 << (2 + plane + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > > +#define INTEL_FRONTBUFFER(pipe, plane_id) \
> > > +       (1 << ((plane_id) + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > >  #define INTEL_FRONTBUFFER_OVERLAY(pipe) \
> > > -       (1 << (2 + INTEL_MAX_SPRITE_BITS_PER_PIPE + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > > +       (1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE - 1 + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > >  #define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
> > >         (0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > 
> > The conversion looks straightforward nevertheless, and indeed no reason
> > to have move than one indexing id for a plane.
> > Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
> > -Chris
> 
> -- 
> Ville Syrjälä
> Intel OTC

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking
  2018-01-24 15:16   ` Ville Syrjälä
@ 2018-01-24 19:03     ` Pandiyan, Dhinakaran
  0 siblings, 0 replies; 11+ messages in thread
From: Pandiyan, Dhinakaran @ 2018-01-24 19:03 UTC (permalink / raw)
  To: ville.syrjala; +Cc: intel-gfx

On Wed, 2018-01-24 at 17:16 +0200, Ville Syrjälä wrote:
> On Wed, Jan 24, 2018 at 04:16:19AM +0000, Pandiyan, Dhinakaran wrote:
> > On Tue, 2018-01-23 at 20:33 +0200, Ville Syrjala wrote:
> > > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > 
> > > Replace the ad-hoc plane indexing scheme used by the frontbuffer
> > > tracking with enum plane_id.
> > > 
> > > The old video overlay not being part of the plane_id namespace
> > > will just be given the high bit.
> > 
> > I'm curious why the bit corresponding to PLANE_SPRITE0 is not re-used
> > for the overlay. From a cursory read seems like platforms with overlays
> > and sprites are mutually exclusive.
> 
> Currently yes, but maybe not in the future. I still have dreams of
> exposing all the planes on these platforms, which would mean having
> at least one sprite plane that's not the video overlay. I haven't
> really figured out how to make it all work out nicely with enum
> plane_id though as that's a per-pipe thing and the planes on the
> old hw are not necessarily tied to a single pipe. Perhaps one
> option would be to assign the plane ids globally, ie. PRIMARY==A,
> PLANE1==B, PLANE2==C, etc. Not sure if that would actually work out
> though.
> 
> > 
> > Related question, how different is this overlay from the sprite planes?
> 
> Very different. I would like to expose it as a drm_plane eventually,
> but there's a bit of actual work involved to convert the overlay
> register updates to use mmio, and to handle the render cache
> reconfiguration (which still involves stuffing MI commands to the
> ring) in a decent way.
> 
> I do have a basic mmio conversion sitting on some branch somewhere,

I'm interested in seeing how this is done, is this in your public repo?
And thanks for the explanation.

-DK

> but I don't think I got it to look as nice as I'd like. Plus it's
> probably bitrotted enough by now that it needs some rework anyway.
> 
> > 
> > 
> > > 
> > > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > ---
> > >  drivers/gpu/drm/i915/i915_drv.h      | 11 +++--------
> > >  drivers/gpu/drm/i915/intel_display.c |  4 ++--
> > >  drivers/gpu/drm/i915/intel_fbc.c     |  2 +-
> > >  drivers/gpu/drm/i915/intel_sprite.c  |  4 +++-
> > >  4 files changed, 9 insertions(+), 12 deletions(-)
> > > 
> > > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > > index 8333692dac5a..bd545b1c9546 100644
> > > --- a/drivers/gpu/drm/i915/i915_drv.h
> > > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > > @@ -2404,16 +2404,11 @@ enum hdmi_force_audio {
> > >   *
> > >   * We have one bit per pipe and per scanout plane type.
> > >   */
> > > -#define INTEL_MAX_SPRITE_BITS_PER_PIPE 5
> > >  #define INTEL_FRONTBUFFER_BITS_PER_PIPE 8
> > > -#define INTEL_FRONTBUFFER_PRIMARY(pipe) \
> > > -	(1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > > -#define INTEL_FRONTBUFFER_CURSOR(pipe) \
> > > -	(1 << (1 + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > > -#define INTEL_FRONTBUFFER_SPRITE(pipe, plane) \
> > > -	(1 << (2 + plane + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > > +#define INTEL_FRONTBUFFER(pipe, plane_id) \
> > > +	(1 << ((plane_id) + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > >  #define INTEL_FRONTBUFFER_OVERLAY(pipe) \
> > > -	(1 << (2 + INTEL_MAX_SPRITE_BITS_PER_PIPE + (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe))))
> > > +	(1 << (INTEL_FRONTBUFFER_BITS_PER_PIPE - 1 + INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > >  #define INTEL_FRONTBUFFER_ALL_MASK(pipe) \
> > >  	(0xff << (INTEL_FRONTBUFFER_BITS_PER_PIPE * (pipe)))
> > >  
> > > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > > index d585ce4c8732..3cc35add362f 100644
> > > --- a/drivers/gpu/drm/i915/intel_display.c
> > > +++ b/drivers/gpu/drm/i915/intel_display.c
> > > @@ -13168,7 +13168,7 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
> > >  	else
> > >  		primary->i9xx_plane = (enum i9xx_plane_id) pipe;
> > >  	primary->id = PLANE_PRIMARY;
> > > -	primary->frontbuffer_bit = INTEL_FRONTBUFFER_PRIMARY(pipe);
> > > +	primary->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, primary->id);
> > >  	primary->check_plane = intel_check_primary_plane;
> > >  
> > >  	if (INTEL_GEN(dev_priv) >= 9) {
> > > @@ -13289,7 +13289,7 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv,
> > >  	cursor->pipe = pipe;
> > >  	cursor->i9xx_plane = (enum i9xx_plane_id) pipe;
> > >  	cursor->id = PLANE_CURSOR;
> > > -	cursor->frontbuffer_bit = INTEL_FRONTBUFFER_CURSOR(pipe);
> > > +	cursor->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, cursor->id);
> > >  
> > >  	if (IS_I845G(dev_priv) || IS_I865G(dev_priv)) {
> > >  		cursor->update_plane = i845_update_cursor;
> > > diff --git a/drivers/gpu/drm/i915/intel_fbc.c b/drivers/gpu/drm/i915/intel_fbc.c
> > > index 9dc2b8b5f2db..a8a8a80497a8 100644
> > > --- a/drivers/gpu/drm/i915/intel_fbc.c
> > > +++ b/drivers/gpu/drm/i915/intel_fbc.c
> > > @@ -1373,7 +1373,7 @@ void intel_fbc_init(struct drm_i915_private *dev_priv)
> > >  
> > >  	for_each_pipe(dev_priv, pipe) {
> > >  		fbc->possible_framebuffer_bits |=
> > > -				INTEL_FRONTBUFFER_PRIMARY(pipe);
> > > +			INTEL_FRONTBUFFER(pipe, PLANE_PRIMARY);
> > >  
> > >  		if (fbc_on_pipe_a_only(dev_priv))
> > >  			break;
> > > diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
> > > index a92c748ca8ab..18ef0392362e 100644
> > > --- a/drivers/gpu/drm/i915/intel_sprite.c
> > > +++ b/drivers/gpu/drm/i915/intel_sprite.c
> > > @@ -345,6 +345,8 @@ skl_plane_get_hw_state(struct intel_plane *plane)
> > >  	return ret;
> > >  }
> > >  
> > > +
> > > +
> > >  static void
> > >  chv_update_csc(struct intel_plane *plane, uint32_t format)
> > >  {
> > > @@ -1427,7 +1429,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
> > >  	intel_plane->pipe = pipe;
> > >  	intel_plane->i9xx_plane = plane;
> > >  	intel_plane->id = PLANE_SPRITE0 + plane;
> > > -	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER_SPRITE(pipe, plane);
> > > +	intel_plane->frontbuffer_bit = INTEL_FRONTBUFFER(pipe, intel_plane->id);
> > >  	intel_plane->check_plane = intel_check_sprite_plane;
> > >  
> > >  	possible_crtcs = (1 << pipe);
> 
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-01-24 19:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-23 18:33 [PATCH] drm/i915: Use enum plane_id for frontbuffer tracking Ville Syrjala
2018-01-23 19:00 ` ✓ Fi.CI.BAT: success for " Patchwork
2018-01-23 21:11 ` [PATCH] " Chris Wilson
2018-01-24 17:36   ` Ville Syrjälä
2018-01-24 18:19     ` Ville Syrjälä
2018-01-23 21:12 ` Chris Wilson
2018-01-24  4:04 ` ✗ Fi.CI.IGT: failure for " Patchwork
2018-01-24 17:09   ` Ville Syrjälä
2018-01-24  4:16 ` [PATCH] " Pandiyan, Dhinakaran
2018-01-24 15:16   ` Ville Syrjälä
2018-01-24 19:03     ` Pandiyan, Dhinakaran

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.