drm/i915/skl: Allow universal planes to position
Subsystems (2)
PATCH 1/3 drm/i915/skl: Allow universal planes to position
--- drivers/gpu/drm/i915/intel_display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_display.c +6 -1
@@ -12183,16 +12183,21 @@ intel_check_primary_plane(struct drm_plane *plane,struct drm_rect *dest = &state->dst;struct drm_rect *src = &state->src;const struct drm_rect *clip = &state->clip; +bool can_position = false;int ret; crtc = crtc ? crtc : plane->crtc; intel_crtc =to_intel_crtc (crtc); +if (INTEL_INFO (dev)->gen >=9 ) + can_position = true; + ret =drm_plane_helper_check_update (plane, crtc, fb, src, dest, clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , - false, true, &state->visible); + can_position, true, + &state->visible);if (ret)return ret;
Signature · 6 lines
1.7.10.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/3 drm/i915: Using plane state parameters instead of pipe's
For primary plane, we can use the plane's state for src width and height like sprite plane.
--- drivers/gpu/drm/i915/intel_display.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_display.c +6 -4
@@ -3001,6 +3001,7 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,int pipe = intel_crtc->pipe;u32 plane_ctl, stride_div;unsigned long surf_addr; +struct drm_plane *plane;if (!intel_crtc->primary_enabled) {I915_WRITE (PLANE_CTL (pipe,0 ),0 );
@@ -3060,14 +3061,15 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,MISSING_CASE (fb->modifier[0 ]); } + plane = crtc->primary; plane_ctl |=PLANE_CTL_PLANE_GAMMA_DISABLE ; -if (crtc->primary->state->rotation ==BIT (DRM_ROTATE_180 )) +if (plane->state->rotation ==BIT (DRM_ROTATE_180 )) plane_ctl |=PLANE_CTL_ROTATE_180 ; obj =intel_fb_obj (fb); stride_div =intel_fb_stride_alignment (dev, fb->modifier[0 ], fb->pixel_format); - surf_addr =intel_plane_obj_offset (to_intel_plane (crtc->primary), obj); + surf_addr =intel_plane_obj_offset (to_intel_plane (plane), obj);I915_WRITE (PLANE_CTL (pipe,0 ), plane_ctl);
@@ -3079,8 +3081,8 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,I915_WRITE (PLANE_POS (pipe,0 ),0 );I915_WRITE (PLANE_OFFSET (pipe,0 ), (y <<16 ) | x);I915_WRITE (PLANE_SIZE (pipe,0 ), - (intel_crtc->config->pipe_src_h -1 ) <<16 | - (intel_crtc->config->pipe_src_w -1 )); + ((plane->state->src_h >>16 ) -1 ) <<16 | + ((plane->state->src_w >>16 ) -1 ));I915_WRITE (PLANE_STRIDE (pipe,0 ), fb->pitches[0 ] / stride_div);I915_WRITE (PLANE_SURF (pipe,0 ), surf_addr);
Signature · 6 lines
1.7.10.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 2/3] drm/i915: Using plane state parameters instead of pipe's
drivers/gpu/drm/i915/intel_display.c static void skylake_update_primary_plane(struct drm_crtc *crtc,
Quoted 13 lines · Sonika Jindal
For primary plane, we can use the plane's state for src width and height like sprite plane.
Signed-off-by Sonika Jindal <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3001,6 +3001,7 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,
I think longer-term we need to switch this callback over to the plane callbacks and stop passing drm_crtc around. But this is a step into the right direction at least.
-Daniel
Quoted 43 lines
drivers/gpu/drm/i915/intel_display.c +6
-4int pipe = intel_crtc->pipe;u32 plane_ctl, stride_div;unsigned long surf_addr; +struct drm_plane *plane;if (!intel_crtc->primary_enabled) {I915_WRITE (PLANE_CTL (pipe,0 ),0 );@@ -3060,14 +3061,15 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,MISSING_CASE (fb->modifier[0 ]); } + plane = crtc->primary; plane_ctl |=PLANE_CTL_PLANE_GAMMA_DISABLE ; -if (crtc->primary->state->rotation ==BIT (DRM_ROTATE_180 )) +if (plane->state->rotation ==BIT (DRM_ROTATE_180 )) plane_ctl |=PLANE_CTL_ROTATE_180 ; obj =intel_fb_obj (fb); stride_div =intel_fb_stride_alignment (dev, fb->modifier[0 ], fb->pixel_format); - surf_addr =intel_plane_obj_offset (to_intel_plane (crtc->primary), obj); + surf_addr =intel_plane_obj_offset (to_intel_plane (plane), obj);I915_WRITE (PLANE_CTL (pipe,0 ), plane_ctl);@@ -3079,8 +3081,8 @@ static void skylake_update_primary_plane(struct drm_crtc *crtc,I915_WRITE (PLANE_POS (pipe,0 ),0 );I915_WRITE (PLANE_OFFSET (pipe,0 ), (y <<16 ) | x);I915_WRITE (PLANE_SIZE (pipe,0 ), - (intel_crtc->config->pipe_src_h -1 ) <<16 | - (intel_crtc->config->pipe_src_w -1 )); + ((plane->state->src_h >>16 ) -1 ) <<16 | + ((plane->state->src_w >>16 ) -1 ));I915_WRITE (PLANE_STRIDE (pipe,0 ), fb->pitches[0 ] / stride_div);I915_WRITE (PLANE_SURF (pipe,0 ), surf_addr);Signature · 6 lines
1.7.10.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/3 drm/i915/skl: Support for 90/270 rotation
In reply to Sonika Jindalv2: Moving creation of property in a function, checking for 90/270 rotation simultaneously (Chris)
Letting primary plane to be positioned
v3: Adding if/else for 90/270 and rest params programming, adding check for pixel_format, some cleanup (review comments)
v4: Adding right pixel_formats, using src_* params instead of crtc_* for offset and size programming (Ville)
v5: Rebased on -nightly and Tvrtko's series for gtt remapping.
---
Please note that this is on top of Tvrtko's patches for rotated gtt remapping
titled: [PATCH v2 0/8] Skylake 90/270 display rotation
--- drivers/gpu/drm/i915/i915_reg.h | 2 + drivers/gpu/drm/i915/intel_display.c | 105 +++++++++++++++++++++++++++------- drivers/gpu/drm/i915/intel_drv.h | 5 ++ drivers/gpu/drm/i915/intel_sprite.c | 52 ++++++++++++----- 4 files changed, 128 insertions(+), 36 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -0
@@ -4825,7 +4825,9 @@ enum skl_disp_power_wells {#define PLANE_CTL_ALPHA_HW_PREMULTIPLY ( 3 << 4)#define PLANE_CTL_ROTATE_MASK 0x3#define PLANE_CTL_ROTATE_0 0x0 +#define PLANE_CTL_ROTATE_90 0x1#define PLANE_CTL_ROTATE_180 0x2 +#define PLANE_CTL_ROTATE_270 0x3#define _PLANE_STRIDE_1_A 0x70188#define _PLANE_STRIDE_2_A 0x70288#define _PLANE_STRIDE_3_A 0x70388
drivers/gpu/drm/i915/intel_display.c +84 -21
163 lines not on this page · raw message
drivers/gpu/drm/i915/intel_drv.h +5 -0
@@ -988,6 +988,11 @@ intel_rotation_90_or_270(unsigned int rotation) }struct sg_table *intel_rotate_fb_obj_pages (struct i915_ggtt_view *ggtt_view,struct drm_i915_gem_object *obj); +unsigned int +intel_tile_height (struct drm_device *dev,uint32_t bits_per_pixel, +uint64_t fb_modifier); +void intel_create_rotation_property (struct drm_device *dev, +struct intel_plane *plane);bool intel_wm_need_update (struct drm_plane *plane,struct drm_plane_state *state);
drivers/gpu/drm/i915/intel_sprite.c +37 -15
80 lines not on this page · raw message
Signature · 6 lines
1.7.10.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/3] drm/i915/skl: Support for 90/270 rotation
Quoted 5 lines · Sonika Jindal
drivers/gpu/drm/i915/intel_sprite.c +0
-1@@ -1519,16 +1550,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) goto out; } -if (!dev->mode_config.rotation_property)
drivers/gpu/drm/i915/intel_sprite.c intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) · line 1553
Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +1
-9- dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); - -if (dev->mode_config.rotation_property) -drm_object_attach_property (&intel_plane->base.base, - dev->mode_config.rotation_property, - state->base.rotation); +intel_create_rotation_property (dev, intel_plane);
I think back from the original rotation work we've had the leftover task to move this into common code so that we do create the property just once without this check.
I think this should be done now.
-Daniel
Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +0
-0drm_plane_helper_add (&intel_plane->base, &intel_plane_helper_funcs);Signature · 6 lines
1.7.10.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/3] drm/i915/skl: Support for 90/270 rotation
Quoted 21 lines · Daniel Vetter
Quoted 5 lines · Sonika Jindal
drivers/gpu/drm/i915/intel_sprite.c +0
-1@@ -1519,16 +1550,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) goto out; } -if (!dev->mode_config.rotation_property)drivers/gpu/drm/i915/intel_sprite.c intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) · line 1553
Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +1
-9- dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); - -if (dev->mode_config.rotation_property) -drm_object_attach_property (&intel_plane->base.base, - dev->mode_config.rotation_property, - state->base.rotation); +intel_create_rotation_property (dev, intel_plane);I think back from the original rotation work we've had the leftover task to move this into common code so that we do create the property just once without this check.
Quoted 1 line
I think this should be done now.
Someone should also make it so we can again have different supported rotation bits on different planes. I'll have need for it on CHV I think.
Quoted 20 lines
-Daniel
Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +0
-0drm_plane_helper_add (&intel_plane->base, &intel_plane_helper_funcs);Signature · 6 lines
1.7.10.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/3] drm/i915/skl: Support for 90/270 rotation
Quoted 22 lines · Ville Syrjälä
Quoted 21 lines · Daniel Vetter
Quoted 5 lines · Sonika Jindal
drivers/gpu/drm/i915/intel_sprite.c +0
-1@@ -1519,16 +1550,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) goto out; } -if (!dev->mode_config.rotation_property)drivers/gpu/drm/i915/intel_sprite.c intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) · line 1553
Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +1
-9- dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); - -if (dev->mode_config.rotation_property) -drm_object_attach_property (&intel_plane->base.base, - dev->mode_config.rotation_property, - state->base.rotation); +intel_create_rotation_property (dev, intel_plane);I think back from the original rotation work we've had the leftover task to move this into common code so that we do create the property just once without this check.
Quoted 4 lines
Quoted 1 line
I think this should be done now.
Someone should also make it so we can again have different supported rotation bits on different planes. I'll have need for it on CHV I think.
plane->atomic_check just needs to reject them. Tbh I'm not sold on the value of trying to tell userspace which rotation works and which doesnt - generic userspace won't learn about y-tiling requirements either so this feels a bit pointless tbh. And rejecting stuff in atomic_check is what it's for.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/3] drm/i915/skl: Support for 90/270 rotation
Quoted 25 lines · Daniel Vetter
Quoted 24 lines · Ville Syrjälä
Quoted 22 lines · Daniel Vetter
Quoted 5 lines · Sonika Jindal
drivers/gpu/drm/i915/intel_sprite.c +0
-1@@ -1519,16 +1550,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) goto out; } -if (!dev->mode_config.rotation_property)drivers/gpu/drm/i915/intel_sprite.c intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) · line 1553
Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +1
-9- dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); - -if (dev->mode_config.rotation_property) -drm_object_attach_property (&intel_plane->base.base, - dev->mode_config.rotation_property, - state->base.rotation); +intel_create_rotation_property (dev, intel_plane);I think back from the original rotation work we've had the leftover task to move this into common code so that we do create the property just once without this check.
I think this should be done now.
Quoted 8 lines
Quoted 2 lines
Someone should also make it so we can again have different supported rotation bits on different planes. I'll have need for it on CHV I think.
plane->atomic_checkjust needs to reject them. Tbh I'm not sold on the value of trying to tell userspace which rotation works and which doesnt - generic userspace won't learn about y-tiling requirements either so this feels a bit pointless tbh. And rejecting stuff inatomic_checkis what it's for.
By that logic we shouldn't expose pixel formats or any other useful infromation either then.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/3] drm/i915/skl: Support for 90/270 rotation
Quoted 29 lines · Ville Syrjälä
Quoted 28 lines · Daniel Vetter
Quoted 26 lines · Ville Syrjälä
Quoted 21 lines · Daniel Vetter
Quoted 5 lines · Sonika Jindal
drivers/gpu/drm/i915/intel_sprite.c +0
-1@@ -1519,16 +1550,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) goto out; } -if (!dev->mode_config.rotation_property)drivers/gpu/drm/i915/intel_sprite.c intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) · line 1553
Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +1
-9- dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); - -if (dev->mode_config.rotation_property) -drm_object_attach_property (&intel_plane->base.base, - dev->mode_config.rotation_property, - state->base.rotation); +intel_create_rotation_property (dev, intel_plane);I think back from the original rotation work we've had the leftover task to move this into common code so that we do create the property just once without this check.
Quoted 1 line
I think this should be done now.
Someone should also make it so we can again have different supported rotation bits on different planes. I'll have need for it on CHV I think.
Quoted 8 lines
Quoted 5 lines
plane->atomic_checkjust needs to reject them. Tbh I'm not sold on the value of trying to tell userspace which rotation works and which doesnt - generic userspace won't learn about y-tiling requirements either so this feels a bit pointless tbh. And rejecting stuff inatomic_checkis what it's for.By that logic we shouldn't expose pixel formats or any other useful infromation either then.
Well to be able to fix this we need to restrict the value-set of properties per-attachment. Since I very much want core atomic to decodd standardized properties, and if we create rotation per-plane then that's going to be fairly painful.
That's quite a bit of work, and I'm not sure it's all that useful. And yeah that argument does extend somewhat to pixel formats too since without clueful userspace you can't really allocate a suitable buffer with just the list of pixel formats. They are useful though for a bit of shared input validation in the core (since most planes don't change the support pixel formats at runtime).
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/3] drm/i915/skl: Support for 90/270 rotation
Quoted 36 lines · Daniel Vetter
Quoted 35 lines · Ville Syrjälä
Quoted 33 lines · Daniel Vetter
Quoted 22 lines · Ville Syrjälä
Quoted 21 lines · Daniel Vetter
Quoted 5 lines · Sonika Jindal
drivers/gpu/drm/i915/intel_sprite.c +0
-1@@ -1519,16 +1550,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) goto out; } -if (!dev->mode_config.rotation_property)drivers/gpu/drm/i915/intel_sprite.c intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) · line 1553
Quoted 10 lines
drivers/gpu/drm/i915/intel_sprite.c +1
-9- dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); - -if (dev->mode_config.rotation_property) -drm_object_attach_property (&intel_plane->base.base, - dev->mode_config.rotation_property, - state->base.rotation); +intel_create_rotation_property (dev, intel_plane);I think back from the original rotation work we've had the leftover task to move this into common code so that we do create the property just once without this check.
Quoted 4 lines
Quoted 1 line
I think this should be done now.
Someone should also make it so we can again have different supported rotation bits on different planes. I'll have need for it on CHV I think.
plane->atomic_checkjust needs to reject them. Tbh I'm not sold on the value of trying to tell userspace which rotation works and which doesnt - generic userspace won't learn about y-tiling requirements either so this feels a bit pointless tbh. And rejecting stuff inatomic_checkis what it's for.
Quoted 7 lines
Quoted 2 lines
By that logic we shouldn't expose pixel formats or any other useful infromation either then.
Well to be able to fix this we need to restrict the value-set of properties per-attachment. Since I very much want core atomic to decodd standardized properties, and if we create rotation per-plane then that's going to be fairly painful.
AFAICS it should be a simple matter of s/config->rotation_property/plane->rotation_property/
Well, unless you want to go optimize things so that we don't create multiple properties with the same supported bitmask.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/3] drm/i915/skl: Support for 90/270 rotation
Quoted 45 lines · Ville Syrjälä
Quoted 36 lines · Daniel Vetter
Quoted 35 lines · Ville Syrjälä
Quoted 33 lines · Daniel Vetter
Quoted 22 lines · Ville Syrjälä
Quoted 21 lines · Daniel Vetter
Quoted 5 lines · Sonika Jindal
(quoted diff) +0
-1@@ -1519,16 +1550,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) goto out; } - if (!dev->mode_config.rotation_property)Review intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) · line 1553
Quoted 10 lines
(quoted diff) +1
-9- dev->mode_config.rotation_property = - drm_mode_create_rotation_property(dev, - BIT(DRM_ROTATE_0) | - BIT(DRM_ROTATE_180)); - - if (dev->mode_config.rotation_property) - drm_object_attach_property(&intel_plane->base.base, - dev->mode_config.rotation_property, - state->base.rotation); + intel_create_rotation_property(dev, intel_plane);I think back from the original rotation work we've had the leftover task to move this into common code so that we do create the property just once without this check.
Quoted 4 lines
Quoted 1 line
I think this should be done now.
Someone should also make it so we can again have different supported rotation bits on different planes. I'll have need for it on CHV I think.
plane->atomic_checkjust needs to reject them. Tbh I'm not sold on the value of trying to tell userspace which rotation works and which doesnt - generic userspace won't learn about y-tiling requirements either so this feels a bit pointless tbh. And rejecting stuff inatomic_checkis what it's for.Quoted 7 lines
Quoted 2 lines
By that logic we shouldn't expose pixel formats or any other useful infromation either then.
Well to be able to fix this we need to restrict the value-set of properties per-attachment. Since I very much want core atomic to decodd standardized properties, and if we create rotation per-plane then that's going to be fairly painful.
Quoted 4 lines
AFAICS it should be a simple matter of s/config->rotation_property/plane->rotation_property/
Well, unless you want to go optimize things so that we don't create multiple properties with the same supported bitmask.
Hm yeah that'd work too. I guess I've been a bit dense today, time for w/e ;-)
Cheers, Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 1 line · Sonika Jindal
Signed-off-by Sonika Jindal <[email protected]>
Imo this needs a little more commit message, and more important it needs igt test coverage. Best approach there is probably to take the plane test we have already and extend it to the primary plane.
-Daniel
Quoted 38 lines
--- drivers/gpu/drm/i915/intel_display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +6
-1@@ -12183,16 +12183,21 @@ intel_check_primary_plane(struct drm_plane *plane,struct drm_rect *dest = &state->dst;struct drm_rect *src = &state->src;const struct drm_rect *clip = &state->clip; +bool can_position = false;int ret; crtc = crtc ? crtc : plane->crtc; intel_crtc =to_intel_crtc (crtc); +if (INTEL_INFO (dev)->gen >=9 ) + can_position = true; + ret =drm_plane_helper_check_update (plane, crtc, fb, src, dest, clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , - false, true, &state->visible); + can_position, true, + &state->visible);if (ret)return ret;Signature · 6 lines
1.7.10.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 6 lines · Daniel Vetter
Quoted 1 line · Sonika Jindal
Signed-off-by Sonika Jindal <[email protected]>Imo this needs a little more commit message, and more important it needs igt test coverage. Best approach there is probably to take the plane test we have already and extend it to the primary plane.
-Daniel
This is just to take care of the case when the size of the fb is smaller than the crtc.
I have extended the rotation test (yet to be posted), to create a smaller primary plane fb to be used for 90/270 rotation.
Since we still set position to 0 for primary plane, I did not add any test case for positioning of primary plane. That can be added as a separate activity when positioning support is added.
Right now this is just to allow smaller fb for primary plane which is possible with universal planes gen >=9.
Regards,
Sonika
Quoted 31 lines
Quoted 31 lines
--- drivers/gpu/drm/i915/intel_display.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/intel_display.c +6
-1@@ -12183,16 +12183,21 @@ intel_check_primary_plane(struct drm_plane *plane,struct drm_rect *dest = &state->dst;struct drm_rect *src = &state->src;const struct drm_rect *clip = &state->clip; +bool can_position = false;int ret; crtc = crtc ? crtc : plane->crtc; intel_crtc =to_intel_crtc (crtc); +if (INTEL_INFO (dev)->gen >=9 ) + can_position = true; + ret =drm_plane_helper_check_update (plane, crtc, fb, src, dest, clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , - false, true, &state->visible); + can_position, true, + &state->visible);if (ret)return ret;
Quoted 7 lines
Quoted 7 lines
Signature · 6 lines
1.7.10.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 13 lines · sonika
Quoted 6 lines · Daniel Vetter
Quoted 1 line · Sonika Jindal
Signed-off-by Sonika Jindal <[email protected]>Imo this needs a little more commit message, and more important it needs igt test coverage. Best approach there is probably to take the plane test we have already and extend it to the primary plane.
-DanielThis is just to take care of the case when the size of the fb is smaller than the crtc.
I have extended the rotation test (yet to be posted), to create a smaller primary plane fb to be used for 90/270 rotation.
Quoted 5 lines
Since we still set position to 0 for primary plane, I did not add any test case for positioning of primary plane.
That can be added as a separate activity when positioning support is added. Right now this is just to allow smaller fb for primary plane which is possible with universal planes gen >=9.
Through universal planes it's already possible to position any plane anywhere, and this code is all that makes sure this doesn't happen for the primary plane. Since you've just changed that I think this needs a testcase in igt.
Or maybe I missed something and it's indeed not yet possible to do this? -Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 20 lines · Daniel Vetter
Quoted 13 lines · sonika
Quoted 6 lines · Daniel Vetter
Quoted 1 line · Sonika Jindal
Signed-off-by Sonika Jindal <[email protected]>Imo this needs a little more commit message, and more important it needs igt test coverage. Best approach there is probably to take the plane test we have already and extend it to the primary plane.
-DanielThis is just to take care of the case when the size of the fb is smaller than the crtc.
I have extended the rotation test (yet to be posted), to create a smaller primary plane fb to be used for 90/270 rotation.Quoted 5 lines
Since we still set position to 0 for primary plane, I did not add any test case for positioning of primary plane.
That can be added as a separate activity when positioning support is added. Right now this is just to allow smaller fb for primary plane which is possible with universal planes gen >=9.
Quoted 6 lines
Through universal planes it's already possible to position any plane anywhere, and this code is all that makes sure this doesn't happen for the primary plane. Since you've just changed that I think this needs a testcase in igt.
Or maybe I missed something and it's indeed not yet possible to do this?
We're not ready to enable this just yet. First we need to change all the plane code to use the correct derived state (eg. clipped coordinates as opposed to the user requested ones). And to do that we must make sure the derived state is up to date at .crtc_enable() time.
This was one of the things I had on mind when Gustavo was reworking the primary/cursor plane code, but then Gustavo was pulled away and this task fell through the cracks. I've now cooked up something that should make this happen, but I haven't tested it yet. I'll give it a spin today and post the patch if all goes well...
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 33 lines · Ville Syrjälä
Quoted 20 lines · Daniel Vetter
Quoted 13 lines · sonika
Quoted 6 lines · Daniel Vetter
Quoted 1 line · Sonika Jindal
Signed-off-by Sonika Jindal <[email protected]>Imo this needs a little more commit message, and more important it needs igt test coverage. Best approach there is probably to take the plane test we have already and extend it to the primary plane.
-DanielThis is just to take care of the case when the size of the fb is smaller than the crtc.
I have extended the rotation test (yet to be posted), to create a smaller primary plane fb to be used for 90/270 rotation.Quoted 5 lines
Since we still set position to 0 for primary plane, I did not add any test case for positioning of primary plane.
That can be added as a separate activity when positioning support is added. Right now this is just to allow smaller fb for primary plane which is possible with universal planes gen >=9.Quoted 6 lines
Through universal planes it's already possible to position any plane anywhere, and this code is all that makes sure this doesn't happen for the primary plane. Since you've just changed that I think this needs a testcase in igt.
Or maybe I missed something and it's indeed not yet possible to do this?
We're not ready to enable this just yet. First we need to change all the plane code to use the correct derived state (eg. clipped coordinates as opposed to the user requested ones). And to do that we must make sure the derived state is up to date at .crtc_enable() time.
Quoted 5 lines
This was one of the things I had on mind when Gustavo was reworking the primary/cursor plane code, but then Gustavo was pulled away and this task fell through the cracks. I've now cooked up something that should make this happen, but I haven't tested it yet. I'll give it a spin today and post the patch if all goes well...
Hm, is there a lot of derived state around (restricting just to skl+) once we have the wm code converted over to always look at plane_state structs instead of the add-hoc wm struct we currently use?
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 18 lines · Daniel Vetter
Quoted 12 lines · sonika
Quoted 6 lines · Daniel Vetter
Quoted 1 line · Sonika Jindal
Signed-off-by Sonika Jindal <[email protected]>Imo this needs a little more commit message, and more important it needs igt test coverage. Best approach there is probably to take the plane test we have already and extend it to the primary plane.
-DanielThis is just to take care of the case when the size of the fb is smaller than the crtc.
I have extended the rotation test (yet to be posted), to create a smaller primary plane fb to be used for 90/270 rotation.Quoted 5 lines
Since we still set position to 0 for primary plane, I did not add any test case for positioning of primary plane.
That can be added as a separate activity when positioning support is added. Right now this is just to allow smaller fb for primary plane which is possible with universal planes gen >=9.
Quoted 7 lines
Through universal planes it's already possible to position any plane anywhere, and this code is all that makes sure this doesn't happen for the primary plane. Since you've just changed that I think this needs a testcase in igt.
Or maybe I missed something and it's indeed not yet possible to do this? -Daniel
Yes, it isn't possible yet. We set the position to 0 in skylake_update_primary_plane. -Sonika
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 25 lines · sonika
Quoted 23 lines · Daniel Vetter
Quoted 12 lines · sonika
Quoted 6 lines · Daniel Vetter
Quoted 1 line · Sonika Jindal
Signed-off-by Sonika Jindal <[email protected]>Imo this needs a little more commit message, and more important it needs igt test coverage. Best approach there is probably to take the plane test we have already and extend it to the primary plane.
-DanielThis is just to take care of the case when the size of the fb is smaller than the crtc.
I have extended the rotation test (yet to be posted), to create a smaller primary plane fb to be used for 90/270 rotation.Quoted 5 lines
Since we still set position to 0 for primary plane, I did not add any test case for positioning of primary plane.
That can be added as a separate activity when positioning support is added. Right now this is just to allow smaller fb for primary plane which is possible with universal planes gen >=9.Through universal planes it's already possible to position any plane anywhere, and this code is all that makes sure this doesn't happen for the primary plane. Since you've just changed that I think this needs a testcase in igt.
Quoted 4 lines
Quoted 2 lines
Or maybe I missed something and it's indeed not yet possible to do this? -Daniel
Yes, it isn't possible yet. We set the position to 0 in
skylake_update_primary_plane.
Hm indeed. But with your patch we no longer reject plane updates for the primary plane which aren't positioned at 0,0. So there's now a bug. I guess either go the full way towards implementing universal plane support on skl (and fix up the hw programming) or we need to wait with this patch a bit more.
-Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx