drm: drm: Per-plane rotation etc.
Subsystems (8)
v2 cover drm: drm: Per-plane rotation etc.
From: Ville Syrjälä <[email protected]>
Another, rebased, version of my earlier series [1] to add the per-plane rotation property. One thing holding back the previous version was the weird regression on omap, but apparently I managed to fix it (see [2]).
msm and omap still lack r-bs/acks.
Entire series available here:git://github.com/vsyrjala/linux.git chv_mirror_4
Ville Syrjälä (15):
drm: Add drm_rotation_90_or_270()
drm/atomic: Reject attempts to use multiple rotation angles at once
drm: Add support for optional per-plane rotation property drm/arm: Use per-plane rotation property
drm/atmel-hlcdc: Use per-plane rotation property
drm/omap: Set rotation property initial value to BIT(DRM_ROTATE_0)
insted of 0
drm/omap: Use per-plane rotation property
drm/msm/mdp5: Set rotation property initial value to BIT(DRM_ROTATE_0)
insted of 0
drm/msm/mdp5: Use per-plane rotation property drm/msm/mdp5: Advertize 180 degree rotation
drm/i915: Use the per-plane rotation property
drm: RIP mode_config->rotation_property
drm/i915: Use & instead if == to check for rotations drm/i915: Clean up rotation DSPCNTR/DVSCNTR/etc. setup drm/i915: Add horizontal mirroring support for CHV pipe B planes
drivers/gpu/drm/arm/malidp_planes.c | 13 ++- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 41 ++++----- drivers/gpu/drm/drm_atomic.c | 6 +- drivers/gpu/drm/drm_atomic_helper.c | 2 +- drivers/gpu/drm/drm_blend.c | 39 +++++---- drivers/gpu/drm/drm_crtc.c | 3 +- drivers/gpu/drm/drm_fb_helper.c | 5 +- drivers/gpu/drm/i915/intel_atomic_plane.c | 11 ++- drivers/gpu/drm/i915/intel_display.c | 107 ++++++++++++------------ drivers/gpu/drm/i915/intel_drv.h | 9 -- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 12 +-- drivers/gpu/drm/i915/intel_sprite.c | 53 ++++++++---- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 35 +++++--- drivers/gpu/drm/omapdrm/omap_crtc.c | 13 ++- drivers/gpu/drm/omapdrm/omap_drv.c | 50 +++++------ drivers/gpu/drm/omapdrm/omap_plane.c | 21 +++-- include/drm/drm_blend.h | 10 ++- include/drm/drm_crtc.h | 5 -- include/drm/drm_plane.h | 2 + 20 files changed, 243 insertions(+), 196 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/15 drm: Add drm_rotation_90_or_270()
From: Ville Syrjälä <[email protected]>
We have intel_rotation_90_or_270() in i915 to check if the rotation is 90 or 270 degrees. Similar checks are elsewhere in drm, so let's move the helper into a central place and use it everwhere.
v2: Drop the BIT()
Convert all new intel_rotation_90_or_270() calls Deal with superfluous code shuffling
--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 4 ++-- drivers/gpu/drm/drm_atomic_helper.c | 2 +- drivers/gpu/drm/drm_crtc.c | 3 +-- drivers/gpu/drm/i915/intel_atomic_plane.c | 3 ++- drivers/gpu/drm/i915/intel_display.c | 16 ++++++++-------- drivers/gpu/drm/i915/intel_drv.h | 6 ------ drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 12 ++++++------ drivers/gpu/drm/omapdrm/omap_plane.c | 8 ++------ include/drm/drm_blend.h | 5 +++++ 10 files changed, 28 insertions(+), 33 deletions(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +2 -2
@@ -393,7 +393,7 @@ static void atmel_hlcdc_plane_update_format(struct atmel_hlcdc_plane *plane,if ((state->base.fb->pixel_format ==DRM_FORMAT_YUV422 || state->base.fb->pixel_format ==DRM_FORMAT_NV61 ) && - (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ))) +drm_rotation_90_or_270 (state->base.rotation)) cfg |=ATMEL_HLCDC_YUV422ROT ; atmel_hlcdc_layer_update_cfg(&plane->layer,
@@ -628,7 +628,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,/* * Swap width and size in case of 90 or 270 degrees rotation */ -if (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { +if (drm_rotation_90_or_270 (state->base.rotation)) { tmp = state->crtc_w; state->crtc_w = state->crtc_h; state->crtc_h = tmp;
drivers/gpu/drm/drm_atomic_helper.c +1 -1
@@ -2412,7 +2412,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set, primary_state->crtc_h = vdisplay; primary_state->src_x = set->x <<16 ; primary_state->src_y = set->y <<16 ; -if (primary_state->rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { +if (drm_rotation_90_or_270 (primary_state->rotation)) { primary_state->src_w = vdisplay <<16 ; primary_state->src_h = hdisplay <<16 ; }else {
drivers/gpu/drm/drm_crtc.c +1 -2
@@ -695,8 +695,7 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,drm_crtc_get_hv_timing (mode, &hdisplay, &vdisplay);if (crtc->state && - crtc->primary->state->rotation & (DRM_ROTATE_90 | -DRM_ROTATE_270 )) +drm_rotation_90_or_270 (crtc->primary->state->rotation))swap (hdisplay, vdisplay); return drm_framebuffer_check_src_coords(x << 16, y << 16,
drivers/gpu/drm/i915/intel_atomic_plane.c +2 -1
@@ -142,8 +142,9 @@ static int intel_plane_atomic_check(struct drm_plane *plane, intel_state->clip.y2 = crtc_state->base.enable ? crtc_state->pipe_src_h :0 ; -if (state->fb &&intel_rotation_90_or_270 (state->rotation)) { +if (state->fb &&drm_rotation_90_or_270 (state->rotation)) {char *format_name; +if (!(state->fb->modifier[0 ] ==I915_FORMAT_MOD_Y_TILED || state->fb->modifier[0 ] == I915_FORMAT_MOD_Yf_TILED)) {DRM_DEBUG_KMS ("Y/Yf tiling required for 90/270!\n" );
drivers/gpu/drm/i915/intel_display.c +8 -8
@@ -2139,7 +2139,7 @@ intel_fill_fb_ggtt_view(struct i915_ggtt_view *view,const struct drm_framebuffer *fb, unsigned int rotation) { - if (intel_rotation_90_or_270(rotation)) { + if (drm_rotation_90_or_270(rotation)) { *view = i915_ggtt_view_rotated; view->params.rotated =to_intel_framebuffer (fb)->rot_info; } else {
@@ -2260,7 +2260,7 @@ void intel_unpin_fb_obj(struct drm_framebuffer *fb, unsigned int rotation)static int intel_fb_pitch (const struct drm_framebuffer *fb,int plane,unsigned int rotation) { -if (intel_rotation_90_or_270 (rotation)) +if (drm_rotation_90_or_270 (rotation))return to_intel_framebuffer (fb)->rotated[plane].pitch;else return fb->pitches[plane];
@@ -2296,7 +2296,7 @@ void intel_add_fb_offsets(int *x, int *y,const struct intel_framebuffer *intel_fb =to_intel_framebuffer (state->base.fb);unsigned int rotation = state->base.rotation; -if (intel_rotation_90_or_270 (rotation)) { +if (drm_rotation_90_or_270 (rotation)) { *x += intel_fb->rotated[plane].x; *y += intel_fb->rotated[plane].y; }else {
@@ -2360,7 +2360,7 @@ static u32 intel_adjust_tile_offset(int *x, int *y,intel_tile_dims (dev_priv, &tile_width, &tile_height, fb->modifier[plane], cpp); -if (intel_rotation_90_or_270 (rotation)) { +if (drm_rotation_90_or_270 (rotation)) { pitch_tiles = pitch / tile_height;swap (tile_width, tile_height); }else {
@@ -2416,7 +2416,7 @@ static u32 _intel_compute_tile_offset(const struct drm_i915_private *dev_priv,intel_tile_dims (dev_priv, &tile_width, &tile_height, fb_modifier, cpp); -if (intel_rotation_90_or_270 (rotation)) { +if (drm_rotation_90_or_270 (rotation)) { pitch_tiles = pitch / tile_height;swap (tile_width, tile_height); }else {
@@ -2976,7 +2976,7 @@ int skl_check_plane_surface(struct intel_plane_state *plane_state)int ret;/* Rotate src coordinates to match rotated GTT view */ -if (intel_rotation_90_or_270 (rotation)) +if (drm_rotation_90_or_270 (rotation))drm_rect_rotate (&plane_state->base.src, fb->width, fb->height,DRM_ROTATE_270 );
@@ -3276,7 +3276,7 @@ u32 skl_plane_stride(const struct drm_framebuffer *fb, int plane,* The stride is either expressed as a multiple of 64 bytes chunks for * linear buffers or in number of tiles for tiled buffers. */ -if (intel_rotation_90_or_270 (rotation)) { +if (drm_rotation_90_or_270 (rotation)) {int cpp =drm_format_plane_cpp (fb->pixel_format, plane); stride /=intel_tile_height (dev_priv, fb->modifier[0 ], cpp);
@@ -4667,7 +4667,7 @@ skl_update_scaler(struct intel_crtc_state *crtc_state, bool force_detach,to_intel_crtc (crtc_state->base.crtc);int need_scaling; - need_scaling =intel_rotation_90_or_270 (rotation) ? + need_scaling =drm_rotation_90_or_270 (rotation) ? (src_h != dst_w || src_w != dst_h): (src_w != dst_w || src_h != dst_h);
drivers/gpu/drm/i915/intel_drv.h +0 -6
@@ -1288,12 +1288,6 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,unsigned int intel_tile_height (const struct drm_i915_private *dev_priv,uint64_t fb_modifier,unsigned int cpp); -static inline bool -intel_rotation_90_or_270 (unsigned int rotation) -{ -return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); -} -void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane);
drivers/gpu/drm/i915/intel_fbc.c +1 -1
@@ -84,7 +84,7 @@ static void intel_fbc_get_plane_source_size(struct intel_fbc_state_cache *cache, {int w, h; -if (intel_rotation_90_or_270 (cache->plane.rotation)) { +if (drm_rotation_90_or_270 (cache->plane.rotation)) { w = cache->plane.src_h; h = cache->plane.src_w; }else {
drivers/gpu/drm/i915/intel_pm.c +6 -6
@@ -3151,7 +3151,7 @@ skl_plane_downscale_amount(const struct intel_plane_state *pstate) src_h =drm_rect_height (&pstate->base.src); dst_w =drm_rect_width (&pstate->base.dst); dst_h =drm_rect_height (&pstate->base.dst); -if (intel_rotation_90_or_270 (pstate->base.rotation)) +if (drm_rotation_90_or_270 (pstate->base.rotation))swap (dst_w, dst_h); downscale_h =max (src_h / dst_h, (uint32_t )DRM_PLANE_HELPER_NO_SCALING );
@@ -3182,7 +3182,7 @@ skl_plane_relative_data_rate(const struct intel_crtc_state *cstate, width =drm_rect_width (&intel_pstate->base.src) >>16 ; height =drm_rect_height (&intel_pstate->base.src) >>16 ; -if (intel_rotation_90_or_270 (pstate->rotation)) +if (drm_rotation_90_or_270 (pstate->rotation))swap (width, height);/* for planar format */
@@ -3282,7 +3282,7 @@ skl_ddb_min_alloc(const struct drm_plane_state *pstate, src_w =drm_rect_width (&intel_pstate->base.src) >>16 ; src_h =drm_rect_height (&intel_pstate->base.src) >>16 ; -if (intel_rotation_90_or_270 (pstate->rotation)) +if (drm_rotation_90_or_270 (pstate->rotation))swap (src_w, src_h);/* Halve UV plane width and height for NV12 */
@@ -3296,7 +3296,7 @@ skl_ddb_min_alloc(const struct drm_plane_state *pstate,else plane_bpp =drm_format_plane_cpp (fb->pixel_format,0 ); -if (intel_rotation_90_or_270 (pstate->rotation)) { +if (drm_rotation_90_or_270 (pstate->rotation)) {switch (plane_bpp) {case 1 : min_scanlines =32 ;
@@ -3554,7 +3554,7 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv, width =drm_rect_width (&intel_pstate->base.src) >>16 ; height =drm_rect_height (&intel_pstate->base.src) >>16 ; -if (intel_rotation_90_or_270 (pstate->rotation)) +if (drm_rotation_90_or_270 (pstate->rotation))swap (width, height); cpp =drm_format_plane_cpp (fb->pixel_format,0 );
@@ -3575,7 +3575,7 @@ static int skl_compute_plane_wm(const struct drm_i915_private *dev_priv, fb->modifier[0] == I915_FORMAT_MOD_Yf_TILED) {uint32_t min_scanlines =4 ;uint32_t y_tile_minimum; -if (intel_rotation_90_or_270 (pstate->rotation)) { +if (drm_rotation_90_or_270 (pstate->rotation)) {int cpp = (fb->pixel_format ==DRM_FORMAT_NV12 ) ?drm_format_plane_cpp (fb->pixel_format,1 ) :drm_format_plane_cpp (fb->pixel_format,0 );
drivers/gpu/drm/omapdrm/omap_plane.c +2 -6
@@ -108,16 +108,12 @@ static void omap_plane_atomic_update(struct drm_plane *plane, win.src_x = state->src_x >>16 ; win.src_y = state->src_y >>16 ; -switch (state->rotation &DRM_ROTATE_MASK ) { -case DRM_ROTATE_90 : -case DRM_ROTATE_270 : +if (drm_rotation_90_or_270 (state->rotation)) { win.src_w = state->src_h >>16 ; win.src_h = state->src_w >>16 ; -break ; -default : + }else { win.src_w = state->src_w >>16 ; win.src_h = state->src_h >>16 ; -break ; }/* update scanout: */
include/drm/drm_blend.h +5 -0
@@ -47,6 +47,11 @@ struct drm_atomic_state;#define DRM_REFLECT_Y BIT(5)#define DRM_REFLECT_MASK (DRM_REFLECT_X | DRM_REFLECT_Y) +static inline bool drm_rotation_90_or_270 (unsigned int rotation) +{ +return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); +} +struct drm_property *drm_mode_create_rotation_property (struct drm_device *dev,unsigned int supported_rotations); unsigned int drm_rotation_simplify(unsigned int rotation,
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 01/15] drm: Add drm_rotation_90_or_270()
Quoted 6 lines · On ma, 2016-09-26 at 19:30 +0300, [email protected] wrote:
Quoted 1 line
From: Ville Syrjälä <[email protected]>
We have
intel_rotation_90_or_270()in i915 to check if the rotation is 90 or 270 degrees. Similar checks are elsewhere in drm, so let's move the helper into a central place and use it everwhere.
Quoted 6 lines
v2: Drop the
BIT()
Convert all newintel_rotation_90_or_270()calls Deal with superfluous code shufflingSigned-off-by Ville Syrjälä <[email protected]>Reviewed-by Joonas Lahtinen <[email protected]> (v1)
Looks good.
Regards, Joonas
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/15 drm/atomic: Reject attempts to use multiple rotation angles at once
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The rotation property should only accept exactly one rotation angle at once. Let's reject attempts to set none or multiple angles.
Testcase: igt/kms_rotation_crc/bad-rotation
--- drivers/gpu/drm/drm_atomic.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/drm_atomic.c +2 -0
@@ -710,6 +710,8 @@ int drm_atomic_plane_set_property(struct drm_plane *plane, }else if (property == config->prop_src_h) { state->src_h = val; }else if (property == config->rotation_property) { +if (!is_power_of_2 (val &DRM_ROTATE_MASK )) +return -EINVAL ; state->rotation = val; }else if (property == plane->zpos_property) { state->zpos = val;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 3/15 drm: Add support for optional per-plane rotation property
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Not all planes on the system may support the same rotations/reflections, so make it possible to create a separate property for each plane. This way userspace gets told exactly which rotations/reflections are possible for each plane.
v2: Add drm_plane_create_rotation_property() helper
v3: Drop the BIT(), __builtin_ffs(x) - 1,
Moar WARNs for bad parameters
Deal with superfluous code shuffling
--- drivers/gpu/drm/drm_atomic.c | 6 ++++-- drivers/gpu/drm/drm_blend.c | 35 +++++++++++++++++++++++++++++++++++ drivers/gpu/drm/drm_fb_helper.c | 6 +++++- include/drm/drm_blend.h | 3 +++ include/drm/drm_plane.h | 2 ++ 5 files changed, 49 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_atomic.c +4 -2
@@ -709,7 +709,8 @@ int drm_atomic_plane_set_property(struct drm_plane *plane, state->src_w = val; }else if (property == config->prop_src_h) { state->src_h = val; - }else if (property == config->rotation_property) { + }else if (property == config->rotation_property || + property == plane->rotation_property) {if (!is_power_of_2 (val &DRM_ROTATE_MASK ))return -EINVAL ; state->rotation = val;
@@ -769,7 +770,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane, *val = state->src_w; }else if (property == config->prop_src_h) { *val = state->src_h; - }else if (property == config->rotation_property) { + }else if (property == config->rotation_property || + property == plane->rotation_property) { *val = state->rotation; }else if (property == plane->zpos_property) { *val = state->zpos;
drivers/gpu/drm/drm_blend.c +35 -0
@@ -162,6 +162,41 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, }EXPORT_SYMBOL (drm_mode_create_rotation_property); +int drm_plane_create_rotation_property (struct drm_plane *plane, +unsigned int rotation, +unsigned int supported_rotations) +{ +static const struct drm_prop_enum_list props[] = { + {__builtin_ffs (DRM_ROTATE_0 ) -1 ,"rotate-0" }, + {__builtin_ffs (DRM_ROTATE_90 ) -1 ,"rotate-90" }, + {__builtin_ffs (DRM_ROTATE_180 ) -1 ,"rotate-180" }, + {__builtin_ffs (DRM_ROTATE_270 ) -1 ,"rotate-270" }, + {__builtin_ffs (DRM_REFLECT_X ) -1 ,"reflect-x" }, + {__builtin_ffs (DRM_REFLECT_Y ) -1 ,"reflect-y" }, + }; +struct drm_property *prop; + +WARN_ON ((supported_rotations &DRM_ROTATE_MASK ) ==0 ); +WARN_ON (!is_power_of_2 (rotation &DRM_ROTATE_MASK )); +WARN_ON (rotation & ~supported_rotations); + + prop =drm_property_create_bitmask (plane->dev,0 ,"rotation" , + props,ARRAY_SIZE (props), + supported_rotations); +if (!prop) +return -ENOMEM ; + +drm_object_attach_property (&plane->base, prop, rotation); + +if (plane->state) + plane->state->rotation = rotation; + + plane->rotation_property = prop; + +return 0 ; +} +EXPORT_SYMBOL (drm_plane_create_rotation_property); +/** * drm_rotation_simplify() - Try to simplify the rotation * @rotation: Rotation to be simplified
drivers/gpu/drm/drm_fb_helper.c +5 -1
@@ -394,7 +394,11 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)if (plane->type !=DRM_PLANE_TYPE_PRIMARY )drm_plane_force_disable (plane); -if (dev->mode_config.rotation_property) { +if (plane->rotation_property) { +drm_mode_plane_set_obj_prop (plane, + plane->rotation_property, +DRM_ROTATE_0 ); + }else if (dev->mode_config.rotation_property) {drm_mode_plane_set_obj_prop (plane, dev->mode_config.rotation_property,DRM_ROTATE_0 );
include/drm/drm_blend.h +3 -0
@@ -54,6 +54,9 @@ static inline bool drm_rotation_90_or_270(unsigned int rotation)struct drm_property *drm_mode_create_rotation_property (struct drm_device *dev,unsigned int supported_rotations); +int drm_plane_create_rotation_property (struct drm_plane *plane, +unsigned int rotation, +unsigned int supported_rotations);unsigned int drm_rotation_simplify (unsigned int rotation,unsigned int supported_rotations);
include/drm/drm_plane.h +2 -0
@@ -386,6 +386,7 @@ enum drm_plane_type {* @type: type of plane (overlay, primary, cursor) * @state: current atomic state for this plane * @zpos_property: zpos property for this plane +* @rotation_property: rotation property for this plane * @helper_private: mid-layer private data */ struct drm_plane {
@@ -432,6 +433,7 @@ struct drm_plane {struct drm_plane_state *state;struct drm_property *zpos_property; +struct drm_property *rotation_property; };#define obj_to_plane (x) container_of(x, struct drm_plane, base)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v3 03/15] drm: Add support for optional per-plane rotation property
drivers/gpu/drm/drm_blend.c
Quoted 5 lines · On ma, 2016-09-26 at 19:30 +0300, [email protected] wrote:
drivers/gpu/drm/drm_blend.c +0
-0index
85172a977bf3..e52aece30900100644drivers/gpu/drm/drm_blend.c +0
-0
Now that I'm thinking, *_zpos_* fits to drm_blend.c nicely, but not sure if rotation is related to blending so much. Maybe it should be like a new file drm_transform.c (or drm_plane.c to be overly generic), not sure.
Anyway,
Regards, Joonas
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH v3 03/15] drm: Add support for optional per-plane rotation property
Quoted 11 lines · Joonas Lahtinen
drivers/gpu/drm/drm_blend.c
Quoted 5 lines · On ma, 2016-09-26 at 19:30 +0300, [email protected] wrote:
drivers/gpu/drm/drm_blend.c +0
-0index
85172a977bf3..e52aece30900100644drivers/gpu/drm/drm_blend.c +0
-0Now that I'm thinking, *_zpos_* fits to
drm_blend.cnicely, but not sure if rotation is related to blending so much. Maybe it should be like a new filedrm_transform.c(ordrm_plane.cto be overly generic), not sure.
The next guy who moves it gets to rebase all of my ~500 branches! Or alternatively gets to make git smarter so it'll detect the pointless shuffling automagically.
Quoted 10 lines
Anyway,
Reviewed-by Joonas Lahtinen <[email protected]>Regards, Joonas
Signature · 3 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v3 03/15] drm: Add support for optional per-plane rotation property
Quoted 13 lines · Ville Syrjälä
Quoted 11 lines · Joonas Lahtinen
drivers/gpu/drm/drm_blend.c
Quoted 5 lines · On ma, 2016-09-26 at 19:30 +0300, [email protected] wrote:
drivers/gpu/drm/drm_blend.c +0
-0index
85172a977bf3..e52aece30900100644drivers/gpu/drm/drm_blend.c +0
-0Now that I'm thinking, *_zpos_* fits to
drm_blend.cnicely, but not sure if rotation is related to blending so much. Maybe it should be like a new filedrm_transform.c(ordrm_plane.cto be overly generic), not sure.
Quoted 3 lines
The next guy who moves it gets to rebase all of my ~500 branches! Or alternatively gets to make git smarter so it'll detect the pointless shuffling automagically.
My idea behind drm_blend is to cover _everything_ between the raw framebuffer data and the final crtc picture. So scaling, rotation, blending and anything like that.
I should probably have called it compositing, but oh well that fail is now done.
-Daniel
Quoted 19 lines
Quoted 11 lines
Anyway,
Reviewed-by Joonas Lahtinen <[email protected]>Regards, Joonas
Signature · 3 lines
Joonas Lahtinen Open Source Technology Center Intel CorporationSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 4/15 drm/arm: Use per-plane rotation property
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The global mode_config.rotation_property is going away, switch over to per-plane rotation_property.
v2: Drop the BIT()
--- drivers/gpu/drm/arm/malidp_planes.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/gpu/drm/arm/malidp_planes.c +5 -8
@@ -254,21 +254,18 @@ int malidp_de_planes_init(struct drm_device *drm)if (ret <0 ) goto cleanup; -if (!drm->mode_config.rotation_property) { +/* SMART layer can't be rotated */ +if (id !=DE_SMART ) {unsigned long flags =DRM_ROTATE_0 |DRM_ROTATE_90 |DRM_ROTATE_180 |DRM_ROTATE_270 |DRM_REFLECT_X |DRM_REFLECT_Y ; - drm->mode_config.rotation_property = -drm_mode_create_rotation_property (drm, flags); +drm_plane_create_rotation_property (&plane->base, +DRM_ROTATE_0 , + flags); } -/* SMART layer can't be rotated */ -if (drm->mode_config.rotation_property && (id !=DE_SMART )) -drm_object_attach_property (&plane->base.base, - drm->mode_config.rotation_property, -DRM_ROTATE_0 );drm_plane_helper_add (&plane->base, &malidp_de_plane_helper_funcs);
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 5/15 drm/atmel-hlcdc: Use per-plane rotation property
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The global mode_config.rotation_property is going away, switch over to per-plane rotation_property.
v2: Propagate error upwards (Boris)
v3: Drop the BIT()
--- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 37 +++++++++++++------------ 1 file changed, 20 insertions(+), 17 deletions(-)
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +20 -17
@@ -883,9 +883,9 @@ static int atmel_hlcdc_plane_atomic_get_property(struct drm_plane *p,return 0 ; } -static void atmel_hlcdc_plane_init_properties (struct atmel_hlcdc_plane *plane, -const struct atmel_hlcdc_layer_desc *desc, -struct atmel_hlcdc_plane_properties *props) +static int atmel_hlcdc_plane_init_properties (struct atmel_hlcdc_plane *plane, +const struct atmel_hlcdc_layer_desc *desc, +struct atmel_hlcdc_plane_properties *props) {struct regmap *regmap = plane->layer.hlcdc->regmap;
@@ -902,10 +902,18 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane, ATMEL_HLCDC_LAYER_GA_MASK); } -if (desc->layout.xstride && desc->layout.pstride) -drm_object_attach_property (&plane->base.base, - plane->base.dev->mode_config.rotation_property, -DRM_ROTATE_0 ); +if (desc->layout.xstride && desc->layout.pstride) { +int ret; + + ret =drm_plane_create_rotation_property (&plane->base, +DRM_ROTATE_0 , +DRM_ROTATE_0 | +DRM_ROTATE_90 | +DRM_ROTATE_180 | +DRM_ROTATE_270 ); +if (ret) +return ret; + }if (desc->layout.csc) {/*
@@ -925,6 +933,8 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,ATMEL_HLCDC_LAYER_CSC_CFG (&plane->layer,2 ), 0x40040890); } + +return 0 ; }static struct drm_plane_helper_funcs atmel_hlcdc_layer_plane_helper_funcs = {
@@ -1036,7 +1046,9 @@ atmel_hlcdc_plane_create(struct drm_device *dev, &atmel_hlcdc_layer_plane_helper_funcs);/* Set default property values*/ -atmel_hlcdc_plane_init_properties (plane, desc, props); + ret =atmel_hlcdc_plane_init_properties (plane, desc, props); +if (ret) +return ERR_PTR (ret);return plane; }
@@ -1054,15 +1066,6 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev)if (!props->alpha)return ERR_PTR (-ENOMEM ); - dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, -DRM_ROTATE_0 | -DRM_ROTATE_90 | -DRM_ROTATE_180 | -DRM_ROTATE_270 ); -if (!dev->mode_config.rotation_property) -return ERR_PTR (-ENOMEM ); -return props; }
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 6/15 drm/omap: Set rotation property initial value to BIT(DRM_ROTATE_0) insted of 0
In reply to [email protected]From: Ville Syrjälä <[email protected]>
0 isn't a valid rotation property value, so let's set the initial value of the property to BIT(DRM_ROTATE_0) instead.
v2: Drop the BIT()
--- drivers/gpu/drm/omapdrm/omap_drv.c | 6 ++++-- drivers/gpu/drm/omapdrm/omap_plane.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/omapdrm/omap_drv.c +4 -2
@@ -761,12 +761,14 @@ static void dev_lastclose(struct drm_device *dev)*/ for (i =0 ; i < priv->num_crtcs; i++) {drm_object_property_set_value (&priv->crtcs[i]->base, - dev->mode_config.rotation_property,0 ); + dev->mode_config.rotation_property, +DRM_ROTATE_0 ); }for (i =0 ; i < priv->num_planes; i++) {drm_object_property_set_value (&priv->planes[i]->base, - dev->mode_config.rotation_property,0 ); + dev->mode_config.rotation_property, +DRM_ROTATE_0 ); } }
drivers/gpu/drm/omapdrm/omap_plane.c +1 -1
@@ -213,7 +213,7 @@ void omap_plane_install_properties(struct drm_plane *plane,if (priv->has_dmm) {struct drm_property *prop = dev->mode_config.rotation_property; -drm_object_attach_property (obj, prop,0 ); +drm_object_attach_property (obj, prop,DRM_ROTATE_0 ); }drm_object_attach_property (obj, priv->zorder_prop,0 );
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 7/15 drm/omap: Use per-plane rotation property
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The global mode_config.rotation_property is going away, switch over to per-plane rotation_property.
Not sure I got the annoying crtc rotation_property handling right. Might work, or migth not.
v2: Drop the BIT()
Don't create rotation property twice for each primary plane
--- drivers/gpu/drm/omapdrm/omap_crtc.c | 13 ++++----- drivers/gpu/drm/omapdrm/omap_drv.c | 52 +++++++++++++++++------------------- drivers/gpu/drm/omapdrm/omap_plane.c | 13 ++++++--- 3 files changed, 40 insertions(+), 38 deletions(-)
drivers/gpu/drm/omapdrm/omap_crtc.c +5 -8
@@ -438,13 +438,14 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc, } } -static bool omap_crtc_is_plane_prop (struct drm_device *dev, +static bool omap_crtc_is_plane_prop (struct drm_crtc *crtc,struct drm_property *property) { +struct drm_device *dev = crtc->dev;struct omap_drm_private *priv = dev->dev_private;return property == priv->zorder_prop || - property == dev->mode_config.rotation_property; + property == crtc->primary->rotation_property; } static int omap_crtc_atomic_set_property(struct drm_crtc *crtc,
@@ -452,9 +453,7 @@ static int omap_crtc_atomic_set_property(struct drm_crtc *crtc, struct drm_property *property, uint64_t val) { -struct drm_device *dev = crtc->dev; - -if (omap_crtc_is_plane_prop (dev, property)) { + if (omap_crtc_is_plane_prop(crtc, property)) {struct drm_plane_state *plane_state;struct drm_plane *plane = crtc->primary;
@@ -479,9 +478,7 @@ static int omap_crtc_atomic_get_property(struct drm_crtc *crtc, struct drm_property *property, uint64_t *val) { - struct drm_device *dev = crtc->dev; - -if (omap_crtc_is_plane_prop (dev, property)) { + if (omap_crtc_is_plane_prop(crtc, property)) {/* * Delegate property get to the primary plane. The * drm_atomic_plane_get_property() function isn't exported, but
drivers/gpu/drm/omapdrm/omap_drv.c +25 -27
65 lines not on this page · raw message
drivers/gpu/drm/omapdrm/omap_plane.c +10 -3
@@ -211,9 +211,16 @@ void omap_plane_install_properties(struct drm_plane *plane,struct omap_drm_private *priv = dev->dev_private;if (priv->has_dmm) { -struct drm_property *prop = dev->mode_config.rotation_property; - -drm_object_attach_property (obj, prop,DRM_ROTATE_0 ); +if (!plane->rotation_property) +drm_plane_create_rotation_property (plane, +DRM_ROTATE_0 , +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 | +DRM_REFLECT_X |DRM_REFLECT_Y ); + +if (plane->rotation_property && obj != &plane->base) +drm_object_attach_property (obj, plane->rotation_property, +DRM_ROTATE_0 ); }drm_object_attach_property (obj, priv->zorder_prop,0 );
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 07/15] drm/omap: Use per-plane rotation property
Quoted 28 lines · On 26/09/16 19:30, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
The global mode_config.rotation_property is going away, switch over to per-plane
rotation_property.Not sure I got the annoying crtc
rotation_propertyhandling right. Might work, or migth not.v2: Drop the
BIT()
Don't create rotation property twice for each primary planeCc Tomi Valkeinen <[email protected]>Cc Rob Clark <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>---
drivers/gpu/drm/omapdrm/omap_plane.c +0
-3@@ -211,9 +211,16 @@ void omap_plane_install_properties(struct drm_plane *plane,struct omap_drm_private *priv = dev->dev_private;if (priv->has_dmm) { -struct drm_property *prop = dev->mode_config.rotation_property; - -drm_object_attach_property (obj, prop,DRM_ROTATE_0 );
drivers/gpu/drm/omapdrm/omap_plane.c void omap_plane_install_properties(struct drm_plane *plane, · line 223
Quoted 10 lines
drivers/gpu/drm/omapdrm/omap_plane.c +10
-0+if (!plane->rotation_property) +drm_plane_create_rotation_property (plane, +DRM_ROTATE_0 , +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 | +DRM_REFLECT_X |DRM_REFLECT_Y ); + +if (plane->rotation_property && obj != &plane->base) +drm_object_attach_property (obj, plane->rotation_property, +DRM_ROTATE_0 );
I think this could use a short comment, as it's not obvious wth is going on here =).
Otherwise both omap patches look fine, and test fine.
Tomi
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 07/15] drm/omap: Use per-plane rotation property
Quoted 35 lines · Tomi Valkeinen
Quoted 33 lines · On 26/09/16 19:30, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
The global mode_config.rotation_property is going away, switch over to per-plane
rotation_property.Not sure I got the annoying crtc
rotation_propertyhandling right. Might work, or migth not.v2: Drop the
BIT()
Don't create rotation property twice for each primary planeCc Tomi Valkeinen <[email protected]>Cc Rob Clark <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>---
drivers/gpu/drm/omapdrm/omap_plane.c +5
-3@@ -211,9 +211,16 @@ void omap_plane_install_properties(struct drm_plane *plane,struct omap_drm_private *priv = dev->dev_private;if (priv->has_dmm) { -struct drm_property *prop = dev->mode_config.rotation_property; - -drm_object_attach_property (obj, prop,DRM_ROTATE_0 ); +if (!plane->rotation_property) + drm_plane_create_rotation_property(plane, + DRM_ROTATE_0, + DRM_ROTATE_0 | DRM_ROTATE_90 | + DRM_ROTATE_180 | DRM_ROTATE_270 |
Quoted 8 lines
drivers/gpu/drm/omapdrm/omap_plane.c void omap_plane_install_properties(struct drm_plane *plane, · line 223
Quoted 5 lines
drivers/gpu/drm/omapdrm/omap_plane.c +5
-0+ DRM_REFLECT_X | DRM_REFLECT_Y); + +if (plane->rotation_property && obj != &plane->base) +drm_object_attach_property (obj, plane->rotation_property, +DRM_ROTATE_0 );I think this could use a short comment, as it's not obvious wth is going on here =).
/* Attach the rotation property also to the crtc object */ ?
Quoted 7 lines
Otherwise both omap patches look fine, and test fine.
Reviewed-by Tomi Valkeinen <[email protected]>Tomi
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 07/15] drm/omap: Use per-plane rotation property
Quoted 45 lines · Ville Syrjälä
Quoted 35 lines · Tomi Valkeinen
Quoted 33 lines · On 26/09/16 19:30, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
The global mode_config.rotation_property is going away, switch over to per-plane
rotation_property.Not sure I got the annoying crtc
rotation_propertyhandling right. Might work, or migth not.v2: Drop the
BIT()
Don't create rotation property twice for each primary planeCc Tomi Valkeinen <[email protected]>Cc Rob Clark <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>---
drivers/gpu/drm/omapdrm/omap_plane.c +5
-3@@ -211,9 +211,16 @@ void omap_plane_install_properties(struct drm_plane *plane,struct omap_drm_private *priv = dev->dev_private;if (priv->has_dmm) { -struct drm_property *prop = dev->mode_config.rotation_property; - -drm_object_attach_property (obj, prop,DRM_ROTATE_0 ); +if (!plane->rotation_property) + drm_plane_create_rotation_property(plane, + DRM_ROTATE_0, + DRM_ROTATE_0 | DRM_ROTATE_90 | + DRM_ROTATE_180 | DRM_ROTATE_270 |Quoted 8 lines
drivers/gpu/drm/omapdrm/omap_plane.c void omap_plane_install_properties(struct drm_plane *plane, · line 223
Quoted 5 lines
drivers/gpu/drm/omapdrm/omap_plane.c +5
-0+ DRM_REFLECT_X | DRM_REFLECT_Y); + +if (plane->rotation_property && obj != &plane->base) +drm_object_attach_property (obj, plane->rotation_property, +DRM_ROTATE_0 );I think this could use a short comment, as it's not obvious wth is going on here =).
Quoted 1 line
/* Attach the rotation property also to the crtc object */ ?
Yes, sounds fine to me.
Tomi
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 8/15 drm/msm/mdp5: Set rotation property initial value to BIT(DRM_ROTATE_0) insted of 0
In reply to [email protected]From: Ville Syrjälä <[email protected]>
0 isn't a valid rotation property value, so let's set the initial value of the property to BIT(DRM_ROTATE_0) instead.
In the same vein, we must always have at leat one angle as part of set of supported rotation bits, so let's include DRM_ROTATE_0 in there.
v2: Drop the BIT()
--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2 -2
@@ -78,12 +78,12 @@ static void mdp5_plane_install_rotation_property(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -DRM_REFLECT_X |DRM_REFLECT_Y ); +DRM_ROTATE_0 |DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property)drm_object_attach_property (&plane->base, dev->mode_config.rotation_property, -0 ); +DRM_ROTATE_0 ); }/* helper to install properties which are common to planes and crtcs */
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 08/15] drm/msm/mdp5: Set rotation property initial value to BIT(DRM_ROTATE_0) insted of 0
Quoted 9 lines · On Mon, Sep 26, 2016 at 07:30:53PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
0 isn't a valid rotation property value, so let's set the initial value of the property to
BIT(DRM_ROTATE_0)instead.In the same vein, we must always have at leat one angle as part of set of supported rotation bits, so let's include
DRM_ROTATE_0in there.
Quoted 6 lines
v2: Drop the
BIT()Cc Rob Clark <[email protected]>Cc Jilai Wang <[email protected]>Cc Archit Taneja <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
This one here had a conflict, so didn't apply. Not sure if still needed. -Daniel
Quoted 30 lines
--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2
-2@@ -78,12 +78,12 @@ static void mdp5_plane_install_rotation_property(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -DRM_REFLECT_X |DRM_REFLECT_Y ); +DRM_ROTATE_0 |DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property)drm_object_attach_property (&plane->base, dev->mode_config.rotation_property, -0 ); +DRM_ROTATE_0 ); }/* helper to install properties which are common to planes and crtcs */ Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 08/15] drm/msm/mdp5: Set rotation property initial value to BIT(DRM_ROTATE_0) insted of 0
Quoted 10 lines · Daniel Vetter
Quoted 9 lines · On Mon, Sep 26, 2016 at 07:30:53PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
0 isn't a valid rotation property value, so let's set the initial value of the property to
BIT(DRM_ROTATE_0)instead.In the same vein, we must always have at leat one angle as part of set of supported rotation bits, so let's include
DRM_ROTATE_0in there.
Quoted 8 lines
Quoted 6 lines
v2: Drop the
BIT()Cc Rob Clark <[email protected]>Cc Jilai Wang <[email protected]>Cc Archit Taneja <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>This one here had a conflict, so didn't apply. Not sure if still needed.
I think Rob picked it up already.
Quoted 37 lines
-Daniel
Quoted 30 lines
--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2
-2@@ -78,12 +78,12 @@ static void mdp5_plane_install_rotation_property(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -DRM_REFLECT_X |DRM_REFLECT_Y ); +DRM_ROTATE_0 |DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property)drm_object_attach_property (&plane->base, dev->mode_config.rotation_property, -0 ); +DRM_ROTATE_0 ); }/* helper to install properties which are common to planes and crtcs */ Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 9/15 drm/msm/mdp5: Use per-plane rotation property
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The global mode_config.rotation_property is going away, switch over to per-plane rotation_property.
v2: Drop the BIT()
--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-)
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +5 -9
@@ -75,15 +75,11 @@ static void mdp5_plane_install_rotation_property(struct drm_device *dev, !(mdp5_plane->caps & MDP_PIPE_CAP_VFLIP)) return; -if (!dev->mode_config.rotation_property) - dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, -DRM_ROTATE_0 |DRM_REFLECT_X |DRM_REFLECT_Y ); - -if (dev->mode_config.rotation_property) -drm_object_attach_property (&plane->base, - dev->mode_config.rotation_property, -DRM_ROTATE_0 ); +drm_plane_create_rotation_property (plane, +DRM_ROTATE_0 , +DRM_ROTATE_0 | +DRM_REFLECT_X | +DRM_REFLECT_Y ); }/* helper to install properties which are common to planes and crtcs */
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 10/15 drm/msm/mdp5: Advertize 180 degree rotation
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Since the hardware can apparently do both X and Y reflection, we can advertize also 180 degree rotation as thats just X+Y reflection.
v2: Drop the BIT()
--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +17 -4
@@ -78,6 +78,7 @@ static void mdp5_plane_install_rotation_property(struct drm_device *dev,drm_plane_create_rotation_property (plane,DRM_ROTATE_0 ,DRM_ROTATE_0 | +DRM_ROTATE_180 |DRM_REFLECT_X |DRM_REFLECT_Y ); }
@@ -285,6 +286,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane, plane_enabled(old_state), plane_enabled(state));if (plane_enabled (state)) { +unsigned int rotation; + format =to_mdp_format (msm_framebuffer_format (state->fb));if (MDP_FORMAT_IS_YUV (format) && !pipe_supports_yuv (mdp5_plane->caps)) {
@@ -305,8 +308,13 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - hflip = !!(state->rotation &DRM_REFLECT_X ); - vflip = !!(state->rotation &DRM_REFLECT_Y ); + rotation =drm_rotation_simplify (state->rotation, +DRM_ROTATE_0 | +DRM_REFLECT_X | +DRM_REFLECT_Y ); + hflip = !!(rotation &DRM_REFLECT_X ); + vflip = !!(rotation &DRM_REFLECT_Y ); +if ((vflip && !(mdp5_plane->caps &MDP_PIPE_CAP_VFLIP )) || (hflip && !(mdp5_plane->caps &MDP_PIPE_CAP_HFLIP ))) { dev_err(plane->dev->dev,
@@ -677,6 +685,7 @@ static int mdp5_plane_mode_set(struct drm_plane *plane,int pe_top[COMP_MAX ], pe_bottom[COMP_MAX ];uint32_t hdecm =0 , vdecm =0 ;uint32_t pix_format; +unsigned int rotation;bool vflip, hflip;unsigned long flags;int ret;
@@ -739,8 +748,12 @@ static int mdp5_plane_mode_set(struct drm_plane *plane, config |=get_scale_config (format, src_h, crtc_h, false);DBG ("scale config = %x" , config); - hflip = !!(pstate->rotation &DRM_REFLECT_X ); - vflip = !!(pstate->rotation &DRM_REFLECT_Y ); + rotation =drm_rotation_simplify (pstate->rotation, +DRM_ROTATE_0 | +DRM_REFLECT_X | +DRM_REFLECT_Y ); + hflip = !!(rotation &DRM_REFLECT_X ); + vflip = !!(rotation &DRM_REFLECT_Y );spin_lock_irqsave (&mdp5_plane->pipe_lock, flags);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v3 11/15 drm/i915: Use the per-plane rotation property
In reply to [email protected]From: Ville Syrjälä <[email protected]>
On certain platforms not all planes support the same set of rotations/reflections, so let's use the per-plane property for this.
This is already a problem on SKL when we use the legay cursor plane as it only supports 0|180 whereas the universal planes support 0|90|180|270, and it will be a problem on CHV soon.
v2: Use drm_plane_create_rotation_property() helper
v3: Drop the BIT(), use INTEL_GEN()
--- drivers/gpu/drm/i915/intel_display.c | 52 +++++++++++++++--------------------- drivers/gpu/drm/i915/intel_drv.h | 3 --- drivers/gpu/drm/i915/intel_sprite.c | 14 +++++++++- 3 files changed, 34 insertions(+), 35 deletions(-)
drivers/gpu/drm/i915/intel_display.c +21 -31
@@ -14884,6 +14884,7 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,struct intel_plane *primary =NULL ;struct intel_plane_state *state =NULL ;const uint32_t *intel_primary_formats; +unsigned int supported_rotations;unsigned int num_formats;int ret;
@@ -14956,8 +14957,21 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev,if (ret) goto fail; -if (INTEL_INFO (dev)->gen >=4 ) -intel_create_rotation_property (dev, primary); +if (INTEL_GEN (dev) >=9 ) { + supported_rotations = +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 ; + }else if (INTEL_GEN (dev) >=4 ) { + supported_rotations = +DRM_ROTATE_0 |DRM_ROTATE_180 ; + }else { + supported_rotations =DRM_ROTATE_0 ; + } + +if (INTEL_GEN (dev) >=4 ) +drm_plane_create_rotation_property (&primary->base, +DRM_ROTATE_0 , + supported_rotations);drm_plane_helper_add (&primary->base, &intel_plane_helper_funcs);
@@ -14970,24 +14984,6 @@ fail:return NULL ; } -void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane) -{ -if (!dev->mode_config.rotation_property) { -unsigned long flags =DRM_ROTATE_0 | -DRM_ROTATE_180 ; - -if (INTEL_INFO (dev)->gen >=9 ) - flags |=DRM_ROTATE_90 |DRM_ROTATE_270 ; - - dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, flags); - } -if (dev->mode_config.rotation_property) -drm_object_attach_property (&plane->base.base, - dev->mode_config.rotation_property, - plane->base.state->rotation); -} - static int intel_check_cursor_plane(struct drm_plane *plane, struct intel_crtc_state *crtc_state,
@@ -15114,17 +15110,11 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (ret) goto fail; -if (INTEL_INFO (dev)->gen >=4 ) { -if (!dev->mode_config.rotation_property) - dev->mode_config.rotation_property = -drm_mode_create_rotation_property (dev, -DRM_ROTATE_0 | -DRM_ROTATE_180 ); -if (dev->mode_config.rotation_property) -drm_object_attach_property (&cursor->base.base, - dev->mode_config.rotation_property, - state->base.rotation); - } +if (INTEL_GEN (dev) >=4 ) +drm_plane_create_rotation_property (&cursor->base, +DRM_ROTATE_0 , +DRM_ROTATE_0 | +DRM_ROTATE_180 );if (INTEL_INFO (dev)->gen >=9 ) state->scaler_id =-1 ;
drivers/gpu/drm/i915/intel_drv.h +0 -3
@@ -1288,9 +1288,6 @@ int intel_plane_atomic_calc_changes(struct drm_crtc_state *crtc_state,unsigned int intel_tile_height (const struct drm_i915_private *dev_priv,uint64_t fb_modifier,unsigned int cpp); -void intel_create_rotation_property (struct drm_device *dev, -struct intel_plane *plane); -void assert_pch_transcoder_disabled (struct drm_i915_private *dev_priv,enum pipe pipe);
drivers/gpu/drm/i915/intel_sprite.c +13 -1
@@ -1046,6 +1046,7 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)struct intel_plane_state *state =NULL ;unsigned long possible_crtcs;const uint32_t *plane_formats; +unsigned int supported_rotations;int num_plane_formats;int ret;
@@ -1121,6 +1122,15 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) goto fail; } +if (INTEL_GEN (dev) >=9 ) { + supported_rotations = +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 ; + }else { + supported_rotations = +DRM_ROTATE_0 |DRM_ROTATE_180 ; + } + intel_plane->pipe = pipe; intel_plane->plane = plane; intel_plane->frontbuffer_bit =INTEL_FRONTBUFFER_SPRITE (pipe, plane);
@@ -1143,7 +1153,9 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane)if (ret) goto fail; -intel_create_rotation_property (dev, intel_plane); +drm_plane_create_rotation_property (&intel_plane->base, +DRM_ROTATE_0 , + supported_rotations);drm_plane_helper_add (&intel_plane->base, &intel_plane_helper_funcs);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v3 11/15] drm/i915: Use the per-plane rotation property
Quoted 10 lines · On ma, 2016-09-26 at 19:30 +0300, [email protected] wrote:
Quoted 1 line
From: Ville Syrjälä <[email protected]>
On certain platforms not all planes support the same set of rotations/reflections, so let's use the per-plane property for this.
This is already a problem on SKL when we use the legay cursor plane as it only supports 0|180 whereas the universal planes support 0|90|180|270, and it will be a problem on CHV soon.
Quoted 6 lines
v2: Use
drm_plane_create_rotation_property()helper
v3: Drop theBIT(), useINTEL_GEN()Signed-off-by Ville Syrjälä <[email protected]>Reviewed-by Chris Wilson <[email protected]> (v1)Reviewed-by Joonas Lahtinen <[email protected]> (v2)
Regards, Joonas
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v3 11/15] drm/i915: Use the per-plane rotation property
Quoted 11 lines · Joonas Lahtinen
Quoted 10 lines · On ma, 2016-09-26 at 19:30 +0300, [email protected] wrote:
Quoted 1 line
From: Ville Syrjälä <[email protected]>
On certain platforms not all planes support the same set of rotations/reflections, so let's use the per-plane property for this.
This is already a problem on SKL when we use the legay cursor plane as it only supports 0|180 whereas the universal planes support 0|90|180|270, and it will be a problem on CHV soon.
Quoted 8 lines
Quoted 6 lines
v2: Use
drm_plane_create_rotation_property()helper
v3: Drop theBIT(), useINTEL_GEN()Signed-off-by Ville Syrjälä <[email protected]>Reviewed-by Chris Wilson <[email protected]> (v1)Reviewed-by Joonas Lahtinen <[email protected]> (v2)Reviewed-by Joonas Lahtinen <[email protected]>
Applied up to this one because I hit a small snag in msm.
Thanks, Daniel
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 12/15 drm: RIP mode_config->rotation_property
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Now that all drivers have been converted over to the per-plane rotation property, we can just nuke the global rotation property.
v2: Rebase due to BIT(),__builtin_ffs() & co.
Deal with superfluous code shuffling
--- drivers/gpu/drm/drm_atomic.c | 6 ++---- drivers/gpu/drm/drm_blend.c | 32 ++++---------------------------- drivers/gpu/drm/drm_fb_helper.c | 7 +------ include/drm/drm_blend.h | 2 -- include/drm/drm_crtc.h | 5 ----- 5 files changed, 7 insertions(+), 45 deletions(-)
drivers/gpu/drm/drm_atomic.c +2 -4
@@ -709,8 +709,7 @@ int drm_atomic_plane_set_property(struct drm_plane *plane, state->src_w = val; }else if (property == config->prop_src_h) { state->src_h = val; - }else if (property == config->rotation_property || - property == plane->rotation_property) { + }else if (property == plane->rotation_property) {if (!is_power_of_2 (val &DRM_ROTATE_MASK ))return -EINVAL ; state->rotation = val;
@@ -770,8 +769,7 @@ drm_atomic_plane_get_property(struct drm_plane *plane, *val = state->src_w; }else if (property == config->prop_src_h) { *val = state->src_h; - }else if (property == config->rotation_property || - property == plane->rotation_property) { + }else if (property == plane->rotation_property) { *val = state->rotation; }else if (property == plane->zpos_property) { *val = state->zpos;
drivers/gpu/drm/drm_blend.c +4 -28
@@ -89,7 +89,7 @@* On top of this basic transformation additional properties can be exposed by * the driver: * -* - Rotation is set up with drm_mode_create_rotation_property(). It adds a +* - Rotation is set up with drm_plane_create_rotation_property(). It adds a * rotation and reflection step between the source and destination rectangles. * Without this property the rectangle is only scaled, but not rotated or * reflected.
@@ -105,18 +105,12 @@*/ /** -* drm_mode_create_rotation_property - create a new rotation property -* @dev: DRM device +* drm_plane_create_rotation_property - create a new rotation property +* @plane: drm plane +* @rotation: initial value of the rotation property * @supported_rotations: bitmask of supported rotations and reflections * * This creates a new property with the selected support for transformations. -* The resulting property should be stored in @rotation_property in -* &drm_mode_config. It then must be attached to each plane which supports -* rotations using drm_object_attach_property(). -* -* FIXME: Probably better if the rotation property is created on each plane, -* like the zpos property. Otherwise it's not possible to allow different -* rotation modes on different planes. * * Since a rotation by 180° degress is the same as reflecting both along the x * and the y axis the rotation property is somewhat redundant. Drivers can use
@@ -144,24 +138,6 @@* rotation. After reflection, the rotation is applied to the image sampled from * the source rectangle, before scaling it to fit the destination rectangle. */ -struct drm_property *drm_mode_create_rotation_property (struct drm_device *dev, -unsigned int supported_rotations) -{ -static const struct drm_prop_enum_list props[] = { - {__builtin_ffs (DRM_ROTATE_0 ) -1 ,"rotate-0" }, - {__builtin_ffs (DRM_ROTATE_90 ) -1 ,"rotate-90" }, - {__builtin_ffs (DRM_ROTATE_180 ) -1 ,"rotate-180" }, - {__builtin_ffs (DRM_ROTATE_270 ) -1 ,"rotate-270" }, - {__builtin_ffs (DRM_REFLECT_X ) -1 ,"reflect-x" }, - {__builtin_ffs (DRM_REFLECT_Y ) -1 ,"reflect-y" }, - }; - -return drm_property_create_bitmask (dev,0 ,"rotation" , - props,ARRAY_SIZE (props), - supported_rotations); -} -EXPORT_SYMBOL (drm_mode_create_rotation_property); -int drm_plane_create_rotation_property (struct drm_plane *plane,unsigned int rotation,unsigned int supported_rotations)
drivers/gpu/drm/drm_fb_helper.c +1 -6
@@ -394,15 +394,10 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)if (plane->type !=DRM_PLANE_TYPE_PRIMARY )drm_plane_force_disable (plane); -if (plane->rotation_property) { +if (plane->rotation_property)drm_mode_plane_set_obj_prop (plane, plane->rotation_property,DRM_ROTATE_0 ); - }else if (dev->mode_config.rotation_property) { -drm_mode_plane_set_obj_prop (plane, - dev->mode_config.rotation_property, -DRM_ROTATE_0 ); - } }for (i =0 ; i < fb_helper->crtc_count; i++) {
include/drm/drm_blend.h +0 -2
@@ -52,8 +52,6 @@ static inline bool drm_rotation_90_or_270(unsigned int rotation)return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); } -struct drm_property *drm_mode_create_rotation_property (struct drm_device *dev, -unsigned int supported_rotations);int drm_plane_create_rotation_property (struct drm_plane *plane,unsigned int rotation,unsigned int supported_rotations);
include/drm/drm_crtc.h +0 -5
@@ -1080,11 +1080,6 @@ struct drm_mode_config {*/ struct drm_property *plane_type_property;/** -* @rotation_property: Optional property for planes or CRTCs to specifiy -* rotation. -*/ -struct drm_property *rotation_property; -/** * @prop_src_x: Default atomic plane property for the plane source * position in the connected &drm_framebuffer. */
Signature · 6 lines
2.7.4 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH v2 12/15] drm: RIP mode_config->rotation_property
Quoted 10 lines · On ma, 2016-09-26 at 19:30 +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Now that all drivers have been converted over to the per-plane rotation property, we can just nuke the global rotation property.
v2: Rebase due to BIT(),__builtin_ffs() & co.
Deal with superfluous code shufflingSigned-off-by Ville Syrjälä <[email protected]>Reviewed-by Joonas Lahtinen <[email protected]> (v1)
Regards, Joonas
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 13/15 drm/i915: Use & instead if == to check for rotations
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Using == to check for 180 degree rotation only works as long as the reflection bits aren't set. That will change soon enough for CHV, so let's stop doing things the wrong way.
v2: Drop the BIT()
--- drivers/gpu/drm/i915/intel_display.c | 8 ++++---- drivers/gpu/drm/i915/intel_sprite.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/i915/intel_display.c +4 -4
@@ -3080,7 +3080,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset =intel_compute_tile_offset (&x, &y, plane_state,0 ); -if (rotation ==DRM_ROTATE_180 ) { +if (rotation &DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (crtc_state->pipe_src_w -1 );
@@ -3181,7 +3181,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset =intel_compute_tile_offset (&x, &y, plane_state,0 ); -if (rotation ==DRM_ROTATE_180 ) { +if (rotation &DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {
@@ -10832,7 +10832,7 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base,if (HAS_DDI (dev)) cntl |=CURSOR_PIPE_CSC_ENABLE ; -if (plane_state->base.rotation ==DRM_ROTATE_180 ) +if (plane_state->base.rotation &DRM_ROTATE_180 ) cntl |=CURSOR_ROTATE_180 ; }
@@ -10878,7 +10878,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && - plane_state->base.rotation ==DRM_ROTATE_180 ) { + plane_state->base.rotation &DRM_ROTATE_180 ) { base += (plane_state->base.crtc_h * plane_state->base.crtc_w -1 ) *4 ; }
drivers/gpu/drm/i915/intel_sprite.c +3 -3
@@ -432,7 +432,7 @@ vlv_update_plane(struct drm_plane *dplane,intel_add_fb_offsets (&x, &y, plane_state,0 ); sprsurf_offset =intel_compute_tile_offset (&x, &y, plane_state,0 ); -if (rotation ==DRM_ROTATE_180 ) { +if (rotation &DRM_ROTATE_180 ) { sprctl |=SP_ROTATE_180 ; x += src_w;
@@ -562,7 +562,7 @@ ivb_update_plane(struct drm_plane *plane,intel_add_fb_offsets (&x, &y, plane_state,0 ); sprsurf_offset =intel_compute_tile_offset (&x, &y, plane_state,0 ); -if (rotation ==DRM_ROTATE_180 ) { +if (rotation &DRM_ROTATE_180 ) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */
@@ -696,7 +696,7 @@ ilk_update_plane(struct drm_plane *plane,intel_add_fb_offsets (&x, &y, plane_state,0 ); dvssurf_offset =intel_compute_tile_offset (&x, &y, plane_state,0 ); -if (rotation ==DRM_ROTATE_180 ) { +if (rotation &DRM_ROTATE_180 ) { dvscntr |=DVS_ROTATE_180 ; x += src_w;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 14/15 drm/i915: Clean up rotation DSPCNTR/DVSCNTR/etc. setup
In reply to [email protected]From: Ville Syrjälä <[email protected]>
Move the plane control register rotation setup away from the coordinate munging code. This will result in neater looking code once we add reflection support for CHV.
v2: Drop the BIT(), drop some usless parens,
--- drivers/gpu/drm/i915/intel_display.c | 24 +++++++++++++----------- drivers/gpu/drm/i915/intel_sprite.c | 26 ++++++++++++++------------ 2 files changed, 27 insertions(+), 23 deletions(-)
drivers/gpu/drm/i915/intel_display.c +13 -11
@@ -3071,6 +3071,9 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, fb->modifier[0] == I915_FORMAT_MOD_X_TILED) dspcntr |=DISPPLANE_TILED ; +if (rotation &DRM_ROTATE_180 ) + dspcntr |=DISPPLANE_ROTATE_180 ; +if (IS_G4X (dev)) dspcntr |=DISPPLANE_TRICKLE_FEED_DISABLE ;
@@ -3081,10 +3084,8 @@ static void i9xx_update_primary_plane(struct drm_plane *primary,intel_compute_tile_offset (&x, &y, plane_state,0 );if (rotation &DRM_ROTATE_180 ) { - dspcntr |=DISPPLANE_ROTATE_180 ; - - x += (crtc_state->pipe_src_w -1 ); - y += (crtc_state->pipe_src_h -1 ); + x += crtc_state->pipe_src_w -1 ; + y += crtc_state->pipe_src_h -1 ; } linear_offset =intel_fb_xy_to_linear (x, y, plane_state,0 );
@@ -3173,6 +3174,9 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,if (fb->modifier[0 ] ==I915_FORMAT_MOD_X_TILED ) dspcntr |=DISPPLANE_TILED ; +if (rotation &DRM_ROTATE_180 ) + dspcntr |=DISPPLANE_ROTATE_180 ; +if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) dspcntr |=DISPPLANE_TRICKLE_FEED_DISABLE ;
@@ -3181,13 +3185,11 @@ static void ironlake_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset =intel_compute_tile_offset (&x, &y, plane_state,0 ); -if (rotation &DRM_ROTATE_180 ) { - dspcntr |=DISPPLANE_ROTATE_180 ; - -if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) { - x += (crtc_state->pipe_src_w -1 ); - y += (crtc_state->pipe_src_h -1 ); - } +/* HSW+ does this automagically in hardware */ +if (!IS_HASWELL (dev_priv) && !IS_BROADWELL (dev_priv) && + rotation &DRM_ROTATE_180 ) { + x += crtc_state->pipe_src_w -1 ; + y += crtc_state->pipe_src_h -1 ; } linear_offset =intel_fb_xy_to_linear (x, y, plane_state,0 );
drivers/gpu/drm/i915/intel_sprite.c +14 -12
@@ -423,6 +423,9 @@ vlv_update_plane(struct drm_plane *dplane,if (fb->modifier[0 ] ==I915_FORMAT_MOD_X_TILED ) sprctl |=SP_TILED ; +if (rotation &DRM_ROTATE_180 ) + sprctl |=SP_ROTATE_180 ; +/* Sizes are 0 based */ src_w--; src_h--;
@@ -433,8 +436,6 @@ vlv_update_plane(struct drm_plane *dplane, sprsurf_offset =intel_compute_tile_offset (&x, &y, plane_state,0 );if (rotation &DRM_ROTATE_180 ) { - sprctl |=SP_ROTATE_180 ; - x += src_w; y += src_h; }
@@ -542,6 +543,9 @@ ivb_update_plane(struct drm_plane *plane,if (fb->modifier[0 ] ==I915_FORMAT_MOD_X_TILED ) sprctl |=SPRITE_TILED ; +if (rotation &DRM_ROTATE_180 ) + sprctl |=SPRITE_ROTATE_180 ; +if (IS_HASWELL (dev) ||IS_BROADWELL (dev)) sprctl &= ~SPRITE_TRICKLE_FEED_DISABLE ;else
@@ -562,14 +566,11 @@ ivb_update_plane(struct drm_plane *plane,intel_add_fb_offsets (&x, &y, plane_state,0 ); sprsurf_offset =intel_compute_tile_offset (&x, &y, plane_state,0 ); -if (rotation &DRM_ROTATE_180 ) { - sprctl |=SPRITE_ROTATE_180 ; - -/* HSW and BDW does this automagically in hardware */ -if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) { - x += src_w; - y += src_h; - } +/* HSW+ does this automagically in hardware */ +if (!IS_HASWELL (dev_priv) && !IS_BROADWELL (dev_priv) && + rotation &DRM_ROTATE_180 ) { + x += src_w; + y += src_h; } linear_offset =intel_fb_xy_to_linear (x, y, plane_state,0 );
@@ -680,6 +681,9 @@ ilk_update_plane(struct drm_plane *plane,if (fb->modifier[0 ] ==I915_FORMAT_MOD_X_TILED ) dvscntr |=DVS_TILED ; +if (rotation &DRM_ROTATE_180 ) + dvscntr |=DVS_ROTATE_180 ; +if (IS_GEN6 (dev)) dvscntr |=DVS_TRICKLE_FEED_DISABLE ;/* must disable */
@@ -697,8 +701,6 @@ ilk_update_plane(struct drm_plane *plane, dvssurf_offset =intel_compute_tile_offset (&x, &y, plane_state,0 );if (rotation &DRM_ROTATE_180 ) { - dvscntr |=DVS_ROTATE_180 ; - x += src_w; y += src_h; }
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 15/15 drm/i915: Add horizontal mirroring support for CHV pipe B planes
In reply to [email protected]From: Ville Syrjälä <[email protected]>
The primary and sprite planes on CHV pipe B support horizontal mirroring. Expose it to the world.
Sadly the hardware ignores the mirror bit when the rotate bit is set, so we'll have to reject the 180+X case.
v2: Drop the BIT()
--- drivers/gpu/drm/i915/intel_atomic_plane.c | 8 ++++++++ drivers/gpu/drm/i915/intel_display.c | 9 +++++++++ drivers/gpu/drm/i915/intel_sprite.c | 9 +++++++++ 3 files changed, 26 insertions(+)
drivers/gpu/drm/i915/intel_atomic_plane.c +8 -0
@@ -169,6 +169,14 @@ static int intel_plane_atomic_check(struct drm_plane *plane, } } +/* CHV ignores the mirror bit when the rotate bit is set :( */ +if (IS_CHERRYVIEW (plane->dev) && + state->rotation &DRM_ROTATE_180 && + state->rotation &DRM_REFLECT_X ) { +DRM_DEBUG_KMS ("Cannot rotate and reflect at the same time\n" ); +return -EINVAL ; + } + intel_state->base.visible = false; ret = intel_plane->check_plane (plane, crtc_state, intel_state);if (ret)
drivers/gpu/drm/i915/intel_display.c +9 -0
@@ -3074,6 +3074,9 @@ static void i9xx_update_primary_plane(struct drm_plane *primary,if (rotation &DRM_ROTATE_180 ) dspcntr |=DISPPLANE_ROTATE_180 ; +if (rotation &DRM_REFLECT_X ) + dspcntr |=DISPPLANE_MIRROR ; +if (IS_G4X (dev)) dspcntr |=DISPPLANE_TRICKLE_FEED_DISABLE ;
@@ -3086,6 +3089,8 @@ static void i9xx_update_primary_plane(struct drm_plane *primary,if (rotation &DRM_ROTATE_180 ) { x += crtc_state->pipe_src_w -1 ; y += crtc_state->pipe_src_h -1 ; + }else if (rotation &DRM_REFLECT_X ) { + x += crtc_state->pipe_src_w -1 ; } linear_offset =intel_fb_xy_to_linear (x, y, plane_state,0 );
@@ -14963,6 +14968,10 @@ static struct drm_plane *intel_primary_plane_create(struct drm_device *dev, supported_rotations =DRM_ROTATE_0 |DRM_ROTATE_90 |DRM_ROTATE_180 |DRM_ROTATE_270 ; + }else if (IS_CHERRYVIEW (dev) && pipe ==PIPE_B ) { + supported_rotations = +DRM_ROTATE_0 |DRM_ROTATE_180 | +DRM_REFLECT_X ; }else if (INTEL_GEN (dev) >=4 ) { supported_rotations =DRM_ROTATE_0 |DRM_ROTATE_180 ;
drivers/gpu/drm/i915/intel_sprite.c +9 -0
@@ -426,6 +426,9 @@ vlv_update_plane(struct drm_plane *dplane,if (rotation &DRM_ROTATE_180 ) sprctl |=SP_ROTATE_180 ; +if (rotation &DRM_REFLECT_X ) + sprctl |=SP_MIRROR ; +/* Sizes are 0 based */ src_w--; src_h--;
@@ -438,6 +441,8 @@ vlv_update_plane(struct drm_plane *dplane,if (rotation &DRM_ROTATE_180 ) { x += src_w; y += src_h; + }else if (rotation &DRM_REFLECT_X ) { + x += src_w; } linear_offset =intel_fb_xy_to_linear (x, y, plane_state,0 );
@@ -1128,6 +1133,10 @@ intel_plane_init(struct drm_device *dev, enum pipe pipe, int plane) supported_rotations =DRM_ROTATE_0 |DRM_ROTATE_90 |DRM_ROTATE_180 |DRM_ROTATE_270 ; + }else if (IS_CHERRYVIEW (dev) && pipe ==PIPE_B ) { + supported_rotations = +DRM_ROTATE_0 |DRM_ROTATE_180 | +DRM_REFLECT_X ; }else { supported_rotations =DRM_ROTATE_0 |DRM_ROTATE_180 ;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v2 15/15] drm/i915: Add horizontal mirroring support for CHV pipe B planes
Quoted 5 lines · On ma, 2016-09-26 at 19:31 +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
The primary and sprite planes on CHV pipe B support horizontal mirroring. Expose it to the world.
Quoted 7 lines
Sadly the hardware ignores the mirror bit when the rotate bit is set, so we'll have to reject the 180+X case.
v2: Drop the
BIT()Signed-off-by Ville Syrjälä <[email protected]>Reviewed-by Joonas Lahtinen <[email protected]> (v1)
Regards, Joonas
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 5 lines · On Mon, Sep 26, 2016 at 07:30:45PM +0300, [email protected] wrote:
From: Ville Syrjälä <[email protected]>
Another, rebased, version of my earlier series [1] to add the per-plane rotation property. One thing holding back the previous version was the weird regression on omap, but apparently I managed to fix it (see [2]).
And natrually I forgot to fill in the references:
[1] https://lists.freedesktop.org/archives/dri-devel/2016-July/113821.html
[2] https://lists.freedesktop.org/archives/dri-devel/2016-September/119227.html
Quoted 54 lines
msm and omap still lack r-bs/acks.
Entire series available here:
git://github.com/vsyrjala/linux.gitchv_mirror_4Cc Tomi Valkeinen <[email protected]>Cc Rob Clark <[email protected]>Cc Jilai Wang <[email protected]>Cc Archit Taneja <[email protected]>Ville Syrjälä (15):
drm: Adddrm_rotation_90_or_270()
drm/atomic: Reject attempts to use multiple rotation angles at once
drm: Add support for optional per-plane rotation property drm/arm: Use per-plane rotation property
drm/atmel-hlcdc: Use per-plane rotation property
drm/omap: Set rotation property initial value toBIT(DRM_ROTATE_0)
insted of 0
drm/omap: Use per-plane rotation property
drm/msm/mdp5: Set rotation property initial value toBIT(DRM_ROTATE_0)
insted of 0
drm/msm/mdp5: Use per-plane rotation property drm/msm/mdp5: Advertize 180 degree rotation
drm/i915: Use the per-plane rotation property
drm: RIPmode_config->rotation_property
drm/i915: Use & instead if == to check for rotations drm/i915: Clean up rotation DSPCNTR/DVSCNTR/etc. setup drm/i915: Add horizontal mirroring support for CHV pipe B planesdrivers/gpu/drm/arm/malidp_planes.c | 13 ++- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 41 ++++----- drivers/gpu/drm/drm_atomic.c | 6 +- drivers/gpu/drm/drm_atomic_helper.c | 2 +- drivers/gpu/drm/drm_blend.c | 39 +++++---- drivers/gpu/drm/drm_crtc.c | 3 +- drivers/gpu/drm/drm_fb_helper.c | 5 +- drivers/gpu/drm/i915/intel_atomic_plane.c | 11 ++- drivers/gpu/drm/i915/intel_display.c | 107 ++++++++++++------------ drivers/gpu/drm/i915/intel_drv.h | 9 -- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 12 +-- drivers/gpu/drm/i915/intel_sprite.c | 53 ++++++++---- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 35 +++++--- drivers/gpu/drm/omapdrm/omap_crtc.c | 13 ++- drivers/gpu/drm/omapdrm/omap_drv.c | 50 +++++------ drivers/gpu/drm/omapdrm/omap_plane.c | 21 +++-- include/drm/drm_blend.h | 10 ++- include/drm/drm_crtc.h | 5 -- include/drm/drm_plane.h | 2 + 20 files changed, 243 insertions(+), 196 deletions(-)Signature · 1 line
2.7.4
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 16 lines · On Mon, Sep 26, 2016 at 12:30 PM, <[email protected]> wrote:
From: Ville Syrjälä <[email protected]>
Another, rebased, version of my earlier series [1] to add the per-plane rotation property. One thing holding back the previous version was the weird regression on omap, but apparently I managed to fix it (see [2]).
msm and omap still lack r-bs/acks.
Entire series available here:
git://github.com/vsyrjala/linux.gitchv_mirror_4Cc Tomi Valkeinen <[email protected]>Cc Rob Clark <[email protected]>Cc Jilai Wang <[email protected]>Cc Archit Taneja <[email protected]>
Quoted 11 lines
Ville Syrjälä (15):
drm: Adddrm_rotation_90_or_270()
drm/atomic: Reject attempts to use multiple rotation angles at once
drm: Add support for optional per-plane rotation property drm/arm: Use per-plane rotation property
drm/atmel-hlcdc: Use per-plane rotation property
drm/omap: Set rotation property initial value toBIT(DRM_ROTATE_0)
insted of 0
drm/omap: Use per-plane rotation property
drm/msm/mdp5: Set rotation property initial value toBIT(DRM_ROTATE_0)
insted of 0
fwiw, this one (but with s/BIT(DRM_ROTATE_x)/DRM_ROTATE_x/) is in msm-next for 4.9.. the other msm patches (from previous patchset) looked reasonable but needed some rebasing so I skipped them. But you can go ahead and slap on my r-b.
BR,
-R
Quoted 30 lines
drm/msm/mdp5: Use per-plane rotation property drm/msm/mdp5: Advertize 180 degree rotation
drm/i915: Use the per-plane rotation property
drm: RIPmode_config->rotation_property
drm/i915: Use & instead if == to check for rotations drm/i915: Clean up rotation DSPCNTR/DVSCNTR/etc. setup drm/i915: Add horizontal mirroring support for CHV pipe B planesdrivers/gpu/drm/arm/malidp_planes.c | 13 ++- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 41 ++++----- drivers/gpu/drm/drm_atomic.c | 6 +- drivers/gpu/drm/drm_atomic_helper.c | 2 +- drivers/gpu/drm/drm_blend.c | 39 +++++---- drivers/gpu/drm/drm_crtc.c | 3 +- drivers/gpu/drm/drm_fb_helper.c | 5 +- drivers/gpu/drm/i915/intel_atomic_plane.c | 11 ++- drivers/gpu/drm/i915/intel_display.c | 107 ++++++++++++------------ drivers/gpu/drm/i915/intel_drv.h | 9 -- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_pm.c | 12 +-- drivers/gpu/drm/i915/intel_sprite.c | 53 ++++++++---- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 35 +++++--- drivers/gpu/drm/omapdrm/omap_crtc.c | 13 ++- drivers/gpu/drm/omapdrm/omap_drv.c | 50 +++++------ drivers/gpu/drm/omapdrm/omap_plane.c | 21 +++-- include/drm/drm_blend.h | 10 ++- include/drm/drm_crtc.h | 5 -- include/drm/drm_plane.h | 2 + 20 files changed, 243 insertions(+), 196 deletions(-)
Quoted 3 lines
--
2.7.4
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI✗ Fi.CI.BAT: warning for drm: drm: Per-plane rotation etc.
In reply to [email protected]== Series Details ==
== Series Details ==
Series: drm: drm: Per-plane rotation etc.
URL : https://patchwork.freedesktop.org/series/12938/
State : warning
== Summary ==
Series 12938v1 drm: drm: Per-plane rotation etc.
https://patchwork.freedesktop.org/api/1.0/series/12938/revisions/1/mbox/
Test gem_exec_gttfill:
Subgroup basic:
pass -> SKIP (fi-snb-2600)
Test kms_psr_sink_crc:
Subgroup psr_basic:
dmesg-warn -> PASS (fi-skl-6700hq)fi-bdw-5557u total:244 pass:229 dwarn:0 dfail:0 fail:0 skip:15 fi-bsw-n3050 total:244 pass:202 dwarn:0 dfail:0 fail:0 skip:42 fi-byt-n2820 total:244 pass:208 dwarn:0 dfail:0 fail:1 skip:35 fi-hsw-4770 total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22 fi-hsw-4770r total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22 fi-ilk-650 total:244 pass:182 dwarn:0 dfail:0 fail:2 skip:60 fi-ivb-3520m total:244 pass:219 dwarn:0 dfail:0 fail:0 skip:25 fi-ivb-3770 total:244 pass:207 dwarn:0 dfail:0 fail:0 skip:37 fi-skl-6260u total:244 pass:230 dwarn:0 dfail:0 fail:0 skip:14 fi-skl-6700hq total:244 pass:222 dwarn:0 dfail:0 fail:0 skip:22 fi-skl-6700k total:244 pass:219 dwarn:1 dfail:0 fail:0 skip:24 fi-skl-6770hq total:244 pass:228 dwarn:1 dfail:0 fail:1 skip:14 fi-snb-2520m total:244 pass:208 dwarn:0 dfail:0 fail:0 skip:36 fi-snb-2600 total:244 pass:206 dwarn:0 dfail:0 fail:0 skip:38
Results at /archive/results/CI_IGT_test/Patchwork_2578/
aab15c274da587bcab19376d2caa9d6626440335 drm-intel-nightly: 2016y-09m-26d-12h-11m-33s UTC integration manifest da52158 drm/i915: Add horizontal mirroring support for CHV pipe B planes
6387b64 drm/i915: Clean up rotation DSPCNTR/DVSCNTR/etc. setup
5b6f868 drm/i915: Use & instead if == to check for rotations
e21ce97 drm: RIP mode_config->rotation_property
9c176d2 drm/i915: Use the per-plane rotation property
4660959 drm/msm/mdp5: Advertize 180 degree rotation
dc3f1d1 drm/msm/mdp5: Use per-plane rotation property
775e893 drm/msm/mdp5: Set rotation property initial value to BIT(DRM_ROTATE_0) insted of 0 f60a872 drm/omap: Use per-plane rotation property
44b6f0d drm/omap: Set rotation property initial value to BIT(DRM_ROTATE_0) insted of 0 3d03bc1 drm/atmel-hlcdc: Use per-plane rotation property
ce8714f drm/arm: Use per-plane rotation property
1484269 drm: Add support for optional per-plane rotation property
9dd3ecf drm/atomic: Reject attempts to use multiple rotation angles at once
2dc324a drm: Add drm_rotation_90_or_270()
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx