drm/i915: add support for Z-order of planes for VLV.
Subsystems (2)
PATCH v4 1/1 drm/i915: add support for Z-order of planes for VLV.
From: "Yu(Alex) Dai" <[email protected]>
Add "zorder" property to crtc to control Z-order of sprite and primary planes. The alpha channel of the planes can be enabled or disabled during Z-order change.
--- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_reg.h | 10 ++++ drivers/gpu/drm/i915/intel_display.c | 58 ++++++++++++++++++++-- drivers/gpu/drm/i915/intel_drv.h | 6 +++ drivers/gpu/drm/i915/intel_sprite.c | 95 ++++++++++++++++++++++++++++++++++-- 5 files changed, 163 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -2582,6 +2582,7 @@ int i915_reg_read_ioctl(struct drm_device *dev, void *data, struct drm_file *file);int i915_get_reset_stats_ioctl (struct drm_device *dev,void *data,struct drm_file *file); +extern int i915_set_plane_zorder (struct drm_device *dev,uint64_t zorder);/* overlay */ extern struct intel_overlay_error_state *intel_overlay_capture_error_state (struct drm_device *dev);
drivers/gpu/drm/i915/i915_reg.h +10 -0
@@ -3743,6 +3743,16 @@#define SPRITE_INT_GAMMA_ENABLE (1<<13)#define SPRITE_TILED (1<<10)#define SPRITE_DEST_KEY (1<<2) +#define SPRITE_FORCE_BOTTOM (1<<2) +#define SPRITE_ZORDER_ENABLE (1<<0) + +#define P1S1S2C1 0 +#define P1S2S1C1 8 +#define S2P1S1C1 1 +#define S2S1P1C1 9 +#define S1P1S2C1 4 +#define S1S2P1C1 6 +#define _SPRA_LINOFF 0x70284#define _SPRA_STRIDE 0x70288#define _SPRA_POS 0x7028c
drivers/gpu/drm/i915/intel_display.c +54 -4
109 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +6 -0
@@ -371,6 +371,9 @@ struct intel_crtc {bool new_enabled;uint32_t ddi_pll_sel; +bool primary_alpha; +bool sprite0_alpha; +bool sprite1_alpha;/* reset counter value when the last flip was submitted */ unsigned int reset_counter;
@@ -384,6 +387,9 @@ struct intel_crtc {/* watermarks currently being used */ struct intel_pipe_wm active; } wm; + +struct drm_property *zorder_property; +uint64_t zorder; };struct intel_plane_wm_parameters {
drivers/gpu/drm/i915/intel_sprite.c +92 -3
127 lines not on this page · raw message
Signature · 1 line
1.8.5.2
Quoted 5 lines · On Mon, Mar 03, 2014 at 02:12:28PM -0800, [email protected] wrote:
From: "Yu(Alex) Dai" <[email protected]>
Add "zorder" property to crtc to control Z-order of sprite and primary planes. The alpha channel of the planes can be enabled or disabled during Z-order change.
Can I just say that is an abonimal user interface. You expect the client to encode a hw specific value into a CRTC property that affects global state. and given the two properties on the two CRTCs, which should userspace believe?
-Chris
Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
Chris,
This looks like a hw specific value which is difficult to understand. However, the definition of these values are just a list of available options of z-order. On Intel VLV, there is only 6 options for the three planes Primary, Sprite A and Sprite B. Cursor is always on top. For example, "P1S1S2C1" means z-order (from bottom to top) of Primary -> Sprite A -> Sprite B -> Cursor.
#define P1S1S2C1 0 #define P1S2S1C1 8 #define S2P1S1C1 1 #define S2S1P1C1 9 #define S1P1S2C1 4 #define S1S2P1C1 6
In theory, if hw supports, each CRTC may have their own plane z-order if user intentionally wants that happens. The pipe info (0 or 1) is packed into z-order value with extra bit (bit 31).
Thanks,
Alex
Quoted 12 lines · Chris Wilson
Quoted 5 lines · On Mon, Mar 03, 2014 at 02:12:28PM -0800, [email protected] wrote:
From: "Yu(Alex) Dai" <[email protected]>
Add "zorder" property to crtc to control Z-order of sprite and primary planes. The alpha channel of the planes can be enabled or disabled during Z-order change.
Can I just say that is an abonimal user interface. You expect the client to encode a hw specific value into a CRTC property that affects global state. and given the two properties on the two CRTCs, which should userspace believe? -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 16 lines · Yu Dai
Chris,
This looks like a hw specific value which is difficult to understand. However, the definition of these values are just a list of available options of z-order. On Intel VLV, there is only 6 options for the three planes Primary, Sprite A and Sprite B. Cursor is always on top. For example, "P1S1S2C1" means z-order (from bottom to top) of Primary -> Sprite A -> Sprite B -> Cursor.
#define P1S1S2C1 0 #define P1S2S1C1 8 #define S2P1S1C1 1 #define S2S1P1C1 9 #define S1P1S2C1 4 #define S1S2P1C1 6
Quoted 6 lines
In theory, if hw supports, each CRTC may have their own plane z-order if user intentionally wants that happens. The pipe info (0 or 1) is packed into z-order value with extra bit (bit 31).
Thanks,
Alex
If you want this to go into the upstream kernel, then it winds up being an interface that pretty much has to be supported forever. A userspace-facing encoding like this is very closely tied to the specific number of pipes and planes, so it isn't going to work in a consistent manner across different Intel hardware platforms (current and future). Ideally we'd like to have an interface that we can share with drivers for other vendors' hardware as well so that general purpose userspace (e.g., a Weston wayland compositor) can make use of this without having to worry too much about what kind of hardware it's running on. As Ville mentioned earlier, if you want userspace to program a specific encoding like this, you need to advertise a list of enum values that are valid for that hardware, and the enum list has to be somehow parseable/understandable by userspace.
Personally I still prefer the approach of giving every plane its own z-order rank property and then letting the platform-specific code that actually writes the registers sort all the planes' zorders and figure out what the appropriate register values should be. Granted, this kind of assumes that we've fully moved to the atomic flip API, but then the "check/calculate" step of the process would catch any illegal plane orderings (e.g., two planes listed with the same z-order rank, or an overall ordering that the hardware simply can't support) and compute the appropriate z-order bits for the CRTC. I have a patchset under progress on dri-devel that unifies the plane interface (exposing primary and cursor planes in the same manner sprite/overlay planes are today), so primary and cursor would also have a zorder rank value and could be sorted along with the sprites.
The main obstacle I see with the per-plane rank approach is that the display server or compositor still needs a way to figure out which plane orderings are actually valid. It's possible to quickly submit a few possible orderings that the compositor might be interested in using to the atomic flip API at compositor startup with the "test only" flag set to figure out which ones are possible. However this does add a small amount of startup overhead which may be undesirable in some settings.
Matt
Quoted 20 lines · Chris Wilson
Quoted 12 lines · On Mon, Mar 03, 2014 at 02:12:28PM -0800, [email protected] wrote:
Quoted 5 lines
From: "Yu(Alex) Dai" <[email protected]>
Add "zorder" property to crtc to control Z-order of sprite and primary planes. The alpha channel of the planes can be enabled or disabled during Z-order change.
Can I just say that is an abonimal user interface. You expect the client to encode a hw specific value into a CRTC property that affects global state. and given the two properties on the two CRTCs, which should userspace believe? -Chris
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 5 lines
Matt Roper Graphics Software Engineer ISG Platform Enabling & Development Intel Corporation (916) 356-2795