drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
Subsystems (10)
Joonas Lahtinen
maintainerPATCH 1/1 drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
Only property creation uses the rotation as an index, so convert the #define to the more used BIT(DRM_ROTATE_?) form and use __builtin_ffs to figure the index when needed.
--- drivers/gpu/drm/arm/malidp_drv.h | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 20 +++++++++--------- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 22 +++++++++---------- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 24 ++++++++++----------- drivers/gpu/drm/drm_fb_helper.c | 4 ++-- drivers/gpu/drm/drm_plane_helper.c | 2 +- drivers/gpu/drm/drm_rect.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/i915_debugfs.c | 12 +++++------ drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_fbdev.c | 6 +++--- drivers/gpu/drm/i915/intel_sprite.c | 6 +++--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 10 ++++----- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +++--- drivers/gpu/drm/omapdrm/omap_fb.c | 14 ++++++------- drivers/gpu/drm/omapdrm/omap_plane.c | 10 ++++----- include/drm/drm_crtc.h | 12 +++++------ 21 files changed, 109 insertions(+), 109 deletions(-)
drivers/gpu/drm/arm/malidp_drv.h +1 -1
@@ -49,6 +49,6 @@ void malidp_de_planes_destroy(struct drm_device *drm);int malidp_crtc_init (struct drm_device *drm);/* often used combination of rotational bits */ -#define MALIDP_ROTATED_MASK (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)) +#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)#endif /* __MALIDP_DRV_H__ */
drivers/gpu/drm/arm/malidp_planes.c +10 -10
@@ -108,7 +108,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,return -EINVAL ;/* packed RGB888 / BGR888 can't be rotated or flipped */ -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && (state->fb->pixel_format ==DRM_FORMAT_RGB888 || state->fb->pixel_format ==DRM_FORMAT_BGR888 ))return -EINVAL ;
@@ -188,9 +188,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,/* setup the rotation and axis flip bits */ if (plane->state->rotation &DRM_ROTATE_MASK ) val =ilog2 (plane->state->rotation &DRM_ROTATE_MASK ) <<LAYER_ROT_OFFSET ; -if (plane->state->rotation &BIT (DRM_REFLECT_X )) +if (plane->state->rotation &DRM_REFLECT_X ) val |=LAYER_V_FLIP ; -if (plane->state->rotation &BIT (DRM_REFLECT_Y )) +if (plane->state->rotation &DRM_REFLECT_Y ) val |=LAYER_H_FLIP ;/* set the 'enable layer' bit */
@@ -255,12 +255,12 @@ int malidp_de_planes_init(struct drm_device *drm) goto cleanup;if (!drm->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) | -BIT (DRM_REFLECT_Y ); +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); }
@@ -268,7 +268,7 @@ int malidp_de_planes_init(struct drm_device *drm)if (drm->mode_config.rotation_property && (id !=DE_SMART ))drm_object_attach_property (&plane->base.base, drm->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );drm_plane_helper_add (&plane->base, &malidp_de_plane_helper_funcs);
drivers/gpu/drm/armada/armada_overlay.c +1 -1
@@ -121,7 +121,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,int ret; ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)return ret;
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +11 -11
@@ -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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )))) + (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ))) 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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { tmp = state->crtc_w; state->crtc_w = state->crtc_h; state->crtc_h = tmp;
@@ -677,7 +677,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,return -EINVAL ;switch (state->base.rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : offset = ((y_offset + state->src_y + patched_src_w -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x) / xdiv) *
@@ -686,7 +686,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, fb->pitches[i]; state->pstride[i] = -fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : offset = ((y_offset + state->src_y + patched_src_h -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_w - 1) /
@@ -695,7 +695,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, state->bpp[i]) - fb->pitches[i]; state->pstride[i] =-2 * state->bpp[i];break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_h - 1) /
@@ -705,7 +705,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, (2 * state->bpp[i]); state->pstride[i] = fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :default : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i];
@@ -905,7 +905,7 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,if (desc->layout.xstride && desc->layout.pstride)drm_object_attach_property (&plane->base.base, plane->base.dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );if (desc->layout.csc) {/*
@@ -1056,10 +1056,10 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 )); +DRM_ROTATE_0 | +DRM_ROTATE_90 | +DRM_ROTATE_180 | +DRM_ROTATE_270 );if (!dev->mode_config.rotation_property)return ERR_PTR (-ENOMEM );
drivers/gpu/drm/drm_atomic_helper.c +2 -2
@@ -2348,7 +2348,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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (primary_state->rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { primary_state->src_w = vdisplay <<16 ; primary_state->src_h = hdisplay <<16 ; }else {
@@ -3032,7 +3032,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)if (plane->state) { plane->state->plane = plane; - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; } }EXPORT_SYMBOL (drm_atomic_helper_plane_reset);
drivers/gpu/drm/drm_crtc.c +12 -12
@@ -2804,8 +2804,8 @@ 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 & (BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_270 ))) + crtc->primary->state->rotation & (DRM_ROTATE_90 | +DRM_ROTATE_270 ))swap (hdisplay, vdisplay); return check_src_coords(x << 16, y << 16,
@@ -5646,9 +5646,9 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,* Eg. if the hardware supports everything except DRM_REFLECT_X * one could call this function like this: * -* drm_rotation_simplify(rotation, BIT(DRM_ROTATE_0) | -* BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_180) | -* BIT(DRM_ROTATE_270) | BIT(DRM_REFLECT_Y)); +* drm_rotation_simplify(rotation, DRM_ROTATE_0 | +* DRM_ROTATE_90 | DRM_ROTATE_180 | +* DRM_ROTATE_270 | DRM_REFLECT_Y); * * to eliminate the DRM_ROTATE_X flag. Depending on what kind of * transforms the hardware supports, this function may not
@@ -5659,7 +5659,7 @@ unsigned int drm_rotation_simplify(unsigned int rotation, unsigned int supported_rotations) {if (rotation & ~supported_rotations) { - rotation ^=BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ); + rotation ^=DRM_REFLECT_X |DRM_REFLECT_Y ; rotation = (rotation &DRM_REFLECT_MASK ) |BIT ((ffs (rotation &DRM_ROTATE_MASK ) +1 ) %4 ); }
@@ -5788,12 +5788,12 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, unsigned int supported_rotations) {static const struct drm_prop_enum_list props[] = { - {DRM_ROTATE_0 ,"rotate-0" }, - {DRM_ROTATE_90 ,"rotate-90" }, - {DRM_ROTATE_180 ,"rotate-180" }, - {DRM_ROTATE_270 ,"rotate-270" }, - {DRM_REFLECT_X ,"reflect-x" }, - {DRM_REFLECT_Y ,"reflect-y" }, + {__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",
drivers/gpu/drm/drm_fb_helper.c +2 -2
@@ -335,7 +335,7 @@ retry: goto fail; } - plane_state->rotation =BIT (DRM_ROTATE_0 ); + plane_state->rotation =DRM_ROTATE_0 ; plane->old_fb = plane->fb; plane_mask |=1 <<drm_plane_index (plane);
@@ -395,7 +395,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)if (dev->mode_config.rotation_property) {drm_mode_plane_set_obj_prop (plane, dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 ); } }
drivers/gpu/drm/drm_plane_helper.c +1 -1
@@ -274,7 +274,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, false, &visible);
drivers/gpu/drm/drm_rect.c +14 -14
@@ -317,38 +317,38 @@ void drm_rect_rotate(struct drm_rect *r, {struct drm_rect tmp; -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; } }switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2; r->y1 = width - tmp.x2; r->y2 = width - tmp.x1;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = height - tmp.y2; r->x2 = height - tmp.y1;
@@ -392,23 +392,23 @@ void drm_rect_rotate_inv(struct drm_rect *r,struct drm_rect tmp;switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = width - tmp.y2; r->x2 = width - tmp.y1; r->y1 = tmp.x1; r->y2 = tmp.x2;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2;
@@ -419,15 +419,15 @@ void drm_rect_rotate_inv(struct drm_rect *r,break ; } -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; }
drivers/gpu/drm/i915/i915_debugfs.c +6 -6
@@ -3081,12 +3081,12 @@ static const char *plane_rotation(unsigned int rotation)*/ snprintf (buf,sizeof (buf),"%s%s%s%s%s%s(0x%08x)" , - (rotation &BIT (DRM_ROTATE_0 )) ?"0 " :"" , - (rotation &BIT (DRM_ROTATE_90 )) ?"90 " :"" , - (rotation &BIT (DRM_ROTATE_180 )) ?"180 " :"" , - (rotation &BIT (DRM_ROTATE_270 )) ?"270 " :"" , - (rotation &BIT (DRM_REFLECT_X )) ?"FLIPX " :"" , - (rotation &BIT (DRM_REFLECT_Y )) ?"FLIPY " :"" , + (rotation &DRM_ROTATE_0 ) ?"0 " :"" , + (rotation &DRM_ROTATE_90 ) ?"90 " :"" , + (rotation &DRM_ROTATE_180 ) ?"180 " :"" , + (rotation &DRM_ROTATE_270 ) ?"270 " :"" , + (rotation &DRM_REFLECT_X ) ?"FLIPX " :"" , + (rotation &DRM_REFLECT_Y ) ?"FLIPY " :"" , rotation);return buf;
drivers/gpu/drm/i915/intel_atomic_plane.c +1 -1
@@ -55,7 +55,7 @@ intel_create_plane_state(struct drm_plane *plane)return NULL ; state->base.plane = plane; - state->base.rotation =BIT (DRM_ROTATE_0 ); + state->base.rotation =DRM_ROTATE_0 ; state->ckey.flags =I915_SET_COLORKEY_NONE ;return state;
drivers/gpu/drm/i915/intel_display.c +14 -14
@@ -2688,7 +2688,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset = linear_offset; } -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (crtc_state->pipe_src_w -1 );
@@ -2791,7 +2791,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,intel_compute_tile_offset (&x, &y, fb,0 , fb->pitches[0 ], rotation); linear_offset -= intel_crtc->dspaddr_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {
@@ -2952,17 +2952,17 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)u32 skl_plane_ctl_rotation (unsigned int rotation) {switch (rotation) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ;/* * DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr * while i915 HW rotation is clockwise, thats why this swapping. */ -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 :return PLANE_CTL_ROTATE_270 ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 :return PLANE_CTL_ROTATE_180 ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 :return PLANE_CTL_ROTATE_90 ;default :MISSING_CASE (rotation);
@@ -4248,7 +4248,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state) intel_crtc->pipe, SKL_CRTC_INDEX);return skl_update_scaler (state, !state->base.active,SKL_CRTC_INDEX , - &state->scaler_state.scaler_id,BIT (DRM_ROTATE_0 ), + &state->scaler_state.scaler_id,DRM_ROTATE_0 , state->pipe_src_w, state->pipe_src_h, adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay); }
@@ -10263,7 +10263,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 ==BIT (DRM_ROTATE_180 )) +if (plane_state->base.rotation ==DRM_ROTATE_180 ) cntl |=CURSOR_ROTATE_180 ; }
@@ -10309,7 +10309,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && - plane_state->base.rotation ==BIT (DRM_ROTATE_180 )) { + plane_state->base.rotation ==DRM_ROTATE_180 ) { base += (plane_state->base.crtc_h * plane_state->base.crtc_w -1 ) *4 ; }
@@ -14304,11 +14304,11 @@ fail:void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane) {if (!dev->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 ); +unsigned long flags =DRM_ROTATE_0 | +DRM_ROTATE_180 ;if (INTEL_INFO (dev)->gen >=9 ) - flags |=BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ); + flags |=DRM_ROTATE_90 |DRM_ROTATE_270 ; dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, flags);
@@ -14451,8 +14451,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); +DRM_ROTATE_0 | +DRM_ROTATE_180 );if (dev->mode_config.rotation_property) drm_object_attach_property(&cursor->base.base, dev->mode_config.rotation_property,
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -1258,7 +1258,7 @@ unsigned int intel_tile_height(const struct drm_i915_private *dev_priv,static inline bool intel_rotation_90_or_270 (unsigned int rotation) { -return rotation & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )); +return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); } void intel_create_rotation_property(struct drm_device *dev,
drivers/gpu/drm/i915/intel_fbc.c +1 -1
@@ -775,7 +775,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)return false; }if (INTEL_INFO (dev_priv)->gen <=4 && !IS_G4X (dev_priv) && - cache->plane.rotation !=BIT (DRM_ROTATE_0 )) { + cache->plane.rotation !=DRM_ROTATE_0 ) { fbc->no_fbc_reason ="rotation unsupported" ;return false; }
drivers/gpu/drm/i915/intel_fbdev.c +3 -3
@@ -223,7 +223,7 @@ static int intelfb_create(struct drm_fb_helper *helper,* This also validates that any existing fb inherited from the * BIOS is suitable for own access. */ - ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); + ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );if (ret) goto out_unlock;
@@ -289,7 +289,7 @@ static int intelfb_create(struct drm_fb_helper *helper, out_destroy_fbi:drm_fb_helper_release_fbi (helper); out_unpin: -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 ); out_unlock:mutex_unlock (&dev->struct_mutex);return ret;
@@ -554,7 +554,7 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)if (ifbdev->fb) {mutex_lock (&ifbdev->helper.dev->struct_mutex); -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );mutex_unlock (&ifbdev->helper.dev->struct_mutex);drm_framebuffer_remove (&ifbdev->fb->base);
drivers/gpu/drm/i915/intel_sprite.c +3 -3
@@ -444,7 +444,7 @@ vlv_update_plane(struct drm_plane *dplane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SP_ROTATE_180 ; x += src_w;
@@ -577,7 +577,7 @@ ivb_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */
@@ -714,7 +714,7 @@ ilk_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= dvssurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dvscntr |=DVS_ROTATE_180 ; x += src_w;
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +5 -5
@@ -78,7 +78,7 @@ 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, -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property) drm_object_attach_property(&plane->base,
@@ -309,8 +309,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - hflip = !!(state->rotation &BIT (DRM_REFLECT_X )); - vflip = !!(state->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(state->rotation &DRM_REFLECT_X ); + vflip = !!(state->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,
@@ -743,8 +743,8 @@ 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 &BIT (DRM_REFLECT_X )); - vflip = !!(pstate->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(pstate->rotation &DRM_REFLECT_X ); + vflip = !!(pstate->rotation &DRM_REFLECT_Y );spin_lock_irqsave (&mdp5_plane->pipe_lock, flags);
drivers/gpu/drm/omapdrm/omap_drv.c +3 -3
@@ -295,9 +295,9 @@ static int omap_modeset_init_properties(struct drm_device *dev)if (priv->has_dmm) { dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) |BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) |BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 | +DRM_REFLECT_X |DRM_REFLECT_Y );if (!dev->mode_config.rotation_property)return -ENOMEM ; }
drivers/gpu/drm/omapdrm/omap_fb.c +7 -7
@@ -179,24 +179,24 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, (uint32_t)win->rotation);/* fallthru to default to no rotation */ case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 : orient =0 ;break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : orient =MASK_XY_FLIP |MASK_X_INVERT ;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : orient =MASK_X_INVERT |MASK_Y_INVERT ;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : orient =MASK_XY_FLIP |MASK_Y_INVERT ;break ; } -if (win->rotation &BIT (DRM_REFLECT_X )) +if (win->rotation &DRM_REFLECT_X ) orient ^=MASK_X_INVERT ; -if (win->rotation &BIT (DRM_REFLECT_Y )) +if (win->rotation &DRM_REFLECT_Y ) orient ^=MASK_Y_INVERT ;/* adjust x,y offset for flip/invert: */
@@ -213,7 +213,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, }else {switch (win->rotation &DRM_ROTATE_MASK ) {case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :/* OK */ break ;
drivers/gpu/drm/omapdrm/omap_plane.c +5 -5
@@ -109,8 +109,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, win.src_y = state->src_y >>16 ;switch (state->rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_90 : +case DRM_ROTATE_270 : win.src_w = state->src_h >>16 ; win.src_h = state->src_w >>16 ;break ;
@@ -149,7 +149,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane,struct omap_plane_state *omap_state =to_omap_plane_state (plane->state);struct omap_plane *omap_plane =to_omap_plane (plane); - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id;
@@ -178,7 +178,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,return -EINVAL ;if (state->fb) { -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && !omap_framebuffer_supports_rotation (state->fb))return -EINVAL ; }
@@ -269,7 +269,7 @@ static void omap_plane_reset(struct drm_plane *plane)*/ omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id; - omap_state->base.rotation =BIT (DRM_ROTATE_0 ); + omap_state->base.rotation =DRM_ROTATE_0 ; plane->state = &omap_state->base; plane->state->plane = plane;
include/drm/drm_crtc.h +6 -6
@@ -84,13 +84,13 @@ static inline uint64_t I642U64(int64_t val)* DRM_REFLECT_Y reflects the image along the specified axis prior to rotation */ #define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3 +#define DRM_ROTATE_0 BIT(0) +#define DRM_ROTATE_90 BIT(1) +#define DRM_ROTATE_180 BIT(2) +#define DRM_ROTATE_270 BIT(3)#define DRM_REFLECT_MASK (~DRM_ROTATE_MASK) -#define DRM_REFLECT_X 4 -#define DRM_REFLECT_Y 5 +#define DRM_REFLECT_X BIT(4) +#define DRM_REFLECT_Y BIT(5)enum drm_connector_force {DRM_FORCE_UNSPECIFIED ,
Signature · 1 line
2.5.5
Patchwork
CI✗ Ro.CI.BAT: failure for drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
== Series Details ==
== Series Details ==
Series: drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
URL : https://patchwork.freedesktop.org/series/10229/
State : failure
== Summary ==
Series 10229v1 drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
http://patchwork.freedesktop.org/api/1.0/series/10229/revisions/1/mbox
Test drv_module_reload_basic:
pass -> SKIP (ro-hsw-i3-4010u)
Test gem_sync:
Subgroup basic-store-each:
pass -> DMESG-FAIL (ro-bdw-i7-5600u)ro-bdw-i5-5250u total:244 pass:219 dwarn:4 dfail:0 fail:8 skip:13 ro-bdw-i7-5600u total:244 pass:203 dwarn:0 dfail:1 fail:8 skip:32 ro-bsw-n3050 total:218 pass:173 dwarn:0 dfail:0 fail:2 skip:42 ro-byt-n2820 total:244 pass:197 dwarn:0 dfail:0 fail:9 skip:38 ro-hsw-i3-4010u total:244 pass:211 dwarn:0 dfail:0 fail:8 skip:25 ro-hsw-i7-4770r total:244 pass:212 dwarn:0 dfail:0 fail:8 skip:24 ro-ilk-i7-620lm total:244 pass:172 dwarn:0 dfail:0 fail:9 skip:63 ro-ilk1-i5-650 total:239 pass:172 dwarn:0 dfail:0 fail:9 skip:58 ro-ivb-i7-3770 total:244 pass:203 dwarn:0 dfail:0 fail:8 skip:33 ro-skl3-i5-6260u total:244 pass:224 dwarn:0 dfail:0 fail:8 skip:12 ro-snb-i7-2620M total:244 pass:193 dwarn:0 dfail:0 fail:9 skip:42
ro-bdw-i7-5557U failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1594/
5c9e3d9 drm-intel-nightly: 2016y-07m-25d-06h-32m-37s UTC integration manifest 7e91383 drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Joonas Lahtinen
maintainerRe: ✗ Ro.CI.BAT: failure for drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
Quoted 8 lines · Patchwork
== Series Details ==
Series: drm:
BIT(DRM_ROTATE_?)->DRM_ROTATE_? URL : https://patchwork.freedesktop.org/series/10229/
State : failure== Summary ==
Quoted 8 lines
Series 10229v1 drm:
BIT(DRM_ROTATE_?)->DRM_ROTATE_?
http://patchwork.freedesktop.org/api/1.0/series/10229/revisions/1/mboxTest
drv_module_reload_basic:
pass -> SKIP (ro-hsw-i3-4010u) Testgem_sync:
Subgroup basic-store-each:
pass -> DMESG-FAIL (ro-bdw-i7-5600u)
Filed a new bug;
https://bugs.freedesktop.org/show_bug.cgi?id=97071
Kernel error:
[drm:i915_hangcheck_elapsed [i915]] *ERROR* Hangcheck timer elapsed... video enhancement ring idle
Quoted 19 lines
ro-bdw-i5-5250u total:244 pass:219 dwarn:4 dfail:0 fail:8 skip:13 ro-bdw-i7-5600u total:244 pass:203 dwarn:0 dfail:1 fail:8 skip:32 ro-bsw-n3050 total:218 pass:173 dwarn:0 dfail:0 fail:2 skip:42 ro-byt-n2820 total:244 pass:197 dwarn:0 dfail:0 fail:9 skip:38 ro-hsw-i3-4010u total:244 pass:211 dwarn:0 dfail:0 fail:8 skip:25 ro-hsw-i7-4770r total:244 pass:212 dwarn:0 dfail:0 fail:8 skip:24 ro-ilk-i7-620lm total:244 pass:172 dwarn:0 dfail:0 fail:9 skip:63 ro-ilk1-i5-650 total:239 pass:172 dwarn:0 dfail:0 fail:9 skip:58 ro-ivb-i7-3770 total:244 pass:203 dwarn:0 dfail:0 fail:8 skip:33 ro-skl3-i5-6260u total:244 pass:224 dwarn:0 dfail:0 fail:8 skip:12 ro-snb-i7-2620M total:244 pass:193 dwarn:0 dfail:0 fail:9 skip:42 ro-bdw-i7-5557U failed to connect after reboot
Results at /archive/results/CI_IGT_test/RO_Patchwork_1594/
5c9e3d9 drm-intel-nightly: 2016y-07m-25d-06h-32m-37s UTC integration manifest 7e91383 drm:
BIT(DRM_ROTATE_?)->DRM_ROTATE_?
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
A message that is not in the archive (sent off-list or not yet received): 1469430025-13540-1-git-send-email-joonas.lahtinen-VuQAYsv1563Yd54FQh9/[email protected]
Liviu Dudau
Acked-byHi Joonas,
Quoted 92 lines · Joonas Lahtinen
Only property creation uses the rotation as an index, so convert the #define to the more used
BIT(DRM_ROTATE_?)form and use__builtin_ffsto figure the index when needed.Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Ville Syrjälä <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>--- drivers/gpu/drm/arm/malidp_drv.h | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 20 +++++++++--------- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 22 +++++++++---------- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 24 ++++++++++----------- drivers/gpu/drm/drm_fb_helper.c | 4 ++-- drivers/gpu/drm/drm_plane_helper.c | 2 +- drivers/gpu/drm/drm_rect.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/i915_debugfs.c | 12 +++++------ drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_fbdev.c | 6 +++--- drivers/gpu/drm/i915/intel_sprite.c | 6 +++--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 10 ++++----- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +++--- drivers/gpu/drm/omapdrm/omap_fb.c | 14 ++++++------- drivers/gpu/drm/omapdrm/omap_plane.c | 10 ++++----- include/drm/drm_crtc.h | 12 +++++------ 21 files changed, 109 insertions(+), 109 deletions(-)drivers/gpu/drm/arm/malidp_drv.h +1
-1@@ -49,6 +49,6 @@ void malidp_de_planes_destroy(struct drm_device *drm);int malidp_crtc_init (struct drm_device *drm);/* often used combination of rotational bits */ -#define MALIDP_ROTATED_MASK (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)) +#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)#endif /* __MALIDP_DRV_H__ */ drivers/gpu/drm/arm/malidp_planes.c +9
-9@@ -108,7 +108,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,return -EINVAL ;/* packed RGB888 / BGR888 can't be rotated or flipped */ -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && (state->fb->pixel_format ==DRM_FORMAT_RGB888 || state->fb->pixel_format ==DRM_FORMAT_BGR888 ))return -EINVAL ;@@ -188,9 +188,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,/* setup the rotation and axis flip bits */ if (plane->state->rotation &DRM_ROTATE_MASK ) val =ilog2 (plane->state->rotation &DRM_ROTATE_MASK ) <<LAYER_ROT_OFFSET ; -if (plane->state->rotation &BIT (DRM_REFLECT_X )) +if (plane->state->rotation &DRM_REFLECT_X ) val |=LAYER_V_FLIP ; -if (plane->state->rotation &BIT (DRM_REFLECT_Y )) +if (plane->state->rotation &DRM_REFLECT_Y ) val |=LAYER_H_FLIP ;/* set the 'enable layer' bit */ @@ -255,12 +255,12 @@ int malidp_de_planes_init(struct drm_device *drm) goto cleanup;if (!drm->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) | -BIT (DRM_REFLECT_Y ); +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); }
drivers/gpu/drm/arm/malidp_planes.c int malidp_de_planes_init(struct drm_device *drm) · line 274
Quoted 8 lines
drivers/gpu/drm/arm/malidp_planes.c +1
-1@@ -268,7 +268,7 @@ int malidp_de_planes_init(struct drm_device *drm)if (drm->mode_config.rotation_property && (id !=DE_SMART ))drm_object_attach_property (&plane->base.base, drm->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );drm_plane_helper_add (&plane->base, &malidp_de_plane_helper_funcs);
This patch touches arm/mali-dp driver but the maintainers have not been Cc-ed in the patch? Did get_maintainer.pl fail to show our e-mails? (Driver has been added recently, wondering if there are issues with MAINTAINERS entry).
The change looks OK to me for mali-dp. So:
(one comment at the end of email as well).
Best regards,
Liviu
Quoted 669 lines
drivers/gpu/drm/armada/armada_overlay.c +1
-1@@ -121,7 +121,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,int ret; ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)return ret;drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +11
-11@@ -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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )))) + (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ))) 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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { tmp = state->crtc_w; state->crtc_w = state->crtc_h; state->crtc_h = tmp;@@ -677,7 +677,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,return -EINVAL ;switch (state->base.rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : offset = ((y_offset + state->src_y + patched_src_w -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x) / xdiv) *@@ -686,7 +686,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, fb->pitches[i]; state->pstride[i] = -fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : offset = ((y_offset + state->src_y + patched_src_h -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_w - 1) /@@ -695,7 +695,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, state->bpp[i]) - fb->pitches[i]; state->pstride[i] =-2 * state->bpp[i];break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_h - 1) /@@ -705,7 +705,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, (2 * state->bpp[i]); state->pstride[i] = fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :default : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i];@@ -905,7 +905,7 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,if (desc->layout.xstride && desc->layout.pstride)drm_object_attach_property (&plane->base.base, plane->base.dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );if (desc->layout.csc) {/* @@ -1056,10 +1056,10 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 )); +DRM_ROTATE_0 | +DRM_ROTATE_90 | +DRM_ROTATE_180 | +DRM_ROTATE_270 );if (!dev->mode_config.rotation_property)return ERR_PTR (-ENOMEM );drivers/gpu/drm/drm_atomic_helper.c +2
-2@@ -2348,7 +2348,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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (primary_state->rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { primary_state->src_w = vdisplay <<16 ; primary_state->src_h = hdisplay <<16 ; }else {@@ -3032,7 +3032,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)if (plane->state) { plane->state->plane = plane; - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; } }EXPORT_SYMBOL (drm_atomic_helper_plane_reset);drivers/gpu/drm/drm_crtc.c +12
-12@@ -2804,8 +2804,8 @@ 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 & (BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_270 ))) + crtc->primary->state->rotation & (DRM_ROTATE_90 | +DRM_ROTATE_270 ))swap (hdisplay, vdisplay); return check_src_coords(x << 16, y << 16,@@ -5646,9 +5646,9 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,* Eg. if the hardware supports everything except DRM_REFLECT_X * one could call this function like this: * -* drm_rotation_simplify(rotation, BIT(DRM_ROTATE_0) | -* BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_180) | -* BIT(DRM_ROTATE_270) | BIT(DRM_REFLECT_Y)); +* drm_rotation_simplify(rotation, DRM_ROTATE_0 | +* DRM_ROTATE_90 | DRM_ROTATE_180 | +* DRM_ROTATE_270 | DRM_REFLECT_Y); * * to eliminate the DRM_ROTATE_X flag. Depending on what kind of * transforms the hardware supports, this function may not @@ -5659,7 +5659,7 @@ unsigned int drm_rotation_simplify(unsigned int rotation, unsigned int supported_rotations) {if (rotation & ~supported_rotations) { - rotation ^=BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ); + rotation ^=DRM_REFLECT_X |DRM_REFLECT_Y ; rotation = (rotation &DRM_REFLECT_MASK ) |BIT ((ffs (rotation &DRM_ROTATE_MASK ) +1 ) %4 ); }@@ -5788,12 +5788,12 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, unsigned int supported_rotations) {static const struct drm_prop_enum_list props[] = { - {DRM_ROTATE_0 ,"rotate-0" }, - {DRM_ROTATE_90 ,"rotate-90" }, - {DRM_ROTATE_180 ,"rotate-180" }, - {DRM_ROTATE_270 ,"rotate-270" }, - {DRM_REFLECT_X ,"reflect-x" }, - {DRM_REFLECT_Y ,"reflect-y" }, + {__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",drivers/gpu/drm/drm_fb_helper.c +2
-2@@ -335,7 +335,7 @@ retry: goto fail; } - plane_state->rotation =BIT (DRM_ROTATE_0 ); + plane_state->rotation =DRM_ROTATE_0 ; plane->old_fb = plane->fb; plane_mask |=1 <<drm_plane_index (plane);@@ -395,7 +395,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)if (dev->mode_config.rotation_property) {drm_mode_plane_set_obj_prop (plane, dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 ); } }drivers/gpu/drm/drm_plane_helper.c +1
-1@@ -274,7 +274,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, false, &visible);drivers/gpu/drm/drm_rect.c +14
-14@@ -317,38 +317,38 @@ void drm_rect_rotate(struct drm_rect *r, {struct drm_rect tmp; -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; } }switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2; r->y1 = width - tmp.x2; r->y2 = width - tmp.x1;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = height - tmp.y2; r->x2 = height - tmp.y1;@@ -392,23 +392,23 @@ void drm_rect_rotate_inv(struct drm_rect *r,struct drm_rect tmp;switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = width - tmp.y2; r->x2 = width - tmp.y1; r->y1 = tmp.x1; r->y2 = tmp.x2;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2;@@ -419,15 +419,15 @@ void drm_rect_rotate_inv(struct drm_rect *r,break ; } -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; }drivers/gpu/drm/i915/i915_debugfs.c +6
-6@@ -3081,12 +3081,12 @@ static const char *plane_rotation(unsigned int rotation)*/ snprintf (buf,sizeof (buf),"%s%s%s%s%s%s(0x%08x)" , - (rotation &BIT (DRM_ROTATE_0 )) ?"0 " :"" , - (rotation &BIT (DRM_ROTATE_90 )) ?"90 " :"" , - (rotation &BIT (DRM_ROTATE_180 )) ?"180 " :"" , - (rotation &BIT (DRM_ROTATE_270 )) ?"270 " :"" , - (rotation &BIT (DRM_REFLECT_X )) ?"FLIPX " :"" , - (rotation &BIT (DRM_REFLECT_Y )) ?"FLIPY " :"" , + (rotation &DRM_ROTATE_0 ) ?"0 " :"" , + (rotation &DRM_ROTATE_90 ) ?"90 " :"" , + (rotation &DRM_ROTATE_180 ) ?"180 " :"" , + (rotation &DRM_ROTATE_270 ) ?"270 " :"" , + (rotation &DRM_REFLECT_X ) ?"FLIPX " :"" , + (rotation &DRM_REFLECT_Y ) ?"FLIPY " :"" , rotation);return buf;drivers/gpu/drm/i915/intel_atomic_plane.c +1
-1@@ -55,7 +55,7 @@ intel_create_plane_state(struct drm_plane *plane)return NULL ; state->base.plane = plane; - state->base.rotation =BIT (DRM_ROTATE_0 ); + state->base.rotation =DRM_ROTATE_0 ; state->ckey.flags =I915_SET_COLORKEY_NONE ;return state;drivers/gpu/drm/i915/intel_display.c +14
-14@@ -2688,7 +2688,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset = linear_offset; } -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (crtc_state->pipe_src_w -1 );@@ -2791,7 +2791,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,intel_compute_tile_offset (&x, &y, fb,0 , fb->pitches[0 ], rotation); linear_offset -= intel_crtc->dspaddr_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {@@ -2952,17 +2952,17 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)u32 skl_plane_ctl_rotation (unsigned int rotation) {switch (rotation) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ;/* * DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr * while i915 HW rotation is clockwise, thats why this swapping. */ -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 :return PLANE_CTL_ROTATE_270 ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 :return PLANE_CTL_ROTATE_180 ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 :return PLANE_CTL_ROTATE_90 ;default :MISSING_CASE (rotation);@@ -4248,7 +4248,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state) intel_crtc->pipe, SKL_CRTC_INDEX);return skl_update_scaler (state, !state->base.active,SKL_CRTC_INDEX , - &state->scaler_state.scaler_id,BIT (DRM_ROTATE_0 ), + &state->scaler_state.scaler_id,DRM_ROTATE_0 , state->pipe_src_w, state->pipe_src_h, adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay); }@@ -10263,7 +10263,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 ==BIT (DRM_ROTATE_180 )) +if (plane_state->base.rotation ==DRM_ROTATE_180 ) cntl |=CURSOR_ROTATE_180 ; }@@ -10309,7 +10309,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && - plane_state->base.rotation ==BIT (DRM_ROTATE_180 )) { + plane_state->base.rotation ==DRM_ROTATE_180 ) { base += (plane_state->base.crtc_h * plane_state->base.crtc_w -1 ) *4 ; }@@ -14304,11 +14304,11 @@ fail:void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane) {if (!dev->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 ); +unsigned long flags =DRM_ROTATE_0 | +DRM_ROTATE_180 ;if (INTEL_INFO (dev)->gen >=9 ) - flags |=BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ); + flags |=DRM_ROTATE_90 |DRM_ROTATE_270 ; dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, flags);@@ -14451,8 +14451,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); +DRM_ROTATE_0 | +DRM_ROTATE_180 );if (dev->mode_config.rotation_property) drm_object_attach_property(&cursor->base.base, dev->mode_config.rotation_property,drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -1258,7 +1258,7 @@ unsigned int intel_tile_height(const struct drm_i915_private *dev_priv,static inline bool intel_rotation_90_or_270 (unsigned int rotation) { -return rotation & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )); +return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); } void intel_create_rotation_property(struct drm_device *dev,drivers/gpu/drm/i915/intel_fbc.c +1
-1@@ -775,7 +775,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)return false; }if (INTEL_INFO (dev_priv)->gen <=4 && !IS_G4X (dev_priv) && - cache->plane.rotation !=BIT (DRM_ROTATE_0 )) { + cache->plane.rotation !=DRM_ROTATE_0 ) { fbc->no_fbc_reason ="rotation unsupported" ;return false; }drivers/gpu/drm/i915/intel_fbdev.c +3
-3@@ -223,7 +223,7 @@ static int intelfb_create(struct drm_fb_helper *helper,* This also validates that any existing fb inherited from the * BIOS is suitable for own access. */ - ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); + ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );if (ret) goto out_unlock;@@ -289,7 +289,7 @@ static int intelfb_create(struct drm_fb_helper *helper, out_destroy_fbi:drm_fb_helper_release_fbi (helper); out_unpin: -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 ); out_unlock:mutex_unlock (&dev->struct_mutex);return ret;@@ -554,7 +554,7 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)if (ifbdev->fb) {mutex_lock (&ifbdev->helper.dev->struct_mutex); -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );mutex_unlock (&ifbdev->helper.dev->struct_mutex);drm_framebuffer_remove (&ifbdev->fb->base);drivers/gpu/drm/i915/intel_sprite.c +3
-3@@ -444,7 +444,7 @@ vlv_update_plane(struct drm_plane *dplane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SP_ROTATE_180 ; x += src_w;@@ -577,7 +577,7 @@ ivb_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */ @@ -714,7 +714,7 @@ ilk_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= dvssurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dvscntr |=DVS_ROTATE_180 ; x += src_w;drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +5
-5@@ -78,7 +78,7 @@ 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, -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property) drm_object_attach_property(&plane->base,@@ -309,8 +309,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - hflip = !!(state->rotation &BIT (DRM_REFLECT_X )); - vflip = !!(state->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(state->rotation &DRM_REFLECT_X ); + vflip = !!(state->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,@@ -743,8 +743,8 @@ 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 &BIT (DRM_REFLECT_X )); - vflip = !!(pstate->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(pstate->rotation &DRM_REFLECT_X ); + vflip = !!(pstate->rotation &DRM_REFLECT_Y );spin_lock_irqsave (&mdp5_plane->pipe_lock, flags);drivers/gpu/drm/omapdrm/omap_drv.c +3
-3@@ -295,9 +295,9 @@ static int omap_modeset_init_properties(struct drm_device *dev)if (priv->has_dmm) { dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) |BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) |BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 | +DRM_REFLECT_X |DRM_REFLECT_Y );if (!dev->mode_config.rotation_property)return -ENOMEM ; }drivers/gpu/drm/omapdrm/omap_fb.c +7
-7@@ -179,24 +179,24 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, (uint32_t)win->rotation);/* fallthru to default to no rotation */ case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 : orient =0 ;break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : orient =MASK_XY_FLIP |MASK_X_INVERT ;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : orient =MASK_X_INVERT |MASK_Y_INVERT ;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : orient =MASK_XY_FLIP |MASK_Y_INVERT ;break ; } -if (win->rotation &BIT (DRM_REFLECT_X )) +if (win->rotation &DRM_REFLECT_X ) orient ^=MASK_X_INVERT ; -if (win->rotation &BIT (DRM_REFLECT_Y )) +if (win->rotation &DRM_REFLECT_Y ) orient ^=MASK_Y_INVERT ;/* adjust x,y offset for flip/invert: */ @@ -213,7 +213,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, }else {switch (win->rotation &DRM_ROTATE_MASK ) {case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :/* OK */ break ;drivers/gpu/drm/omapdrm/omap_plane.c +5
-5@@ -109,8 +109,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, win.src_y = state->src_y >>16 ;switch (state->rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_90 : +case DRM_ROTATE_270 : win.src_w = state->src_h >>16 ; win.src_h = state->src_w >>16 ;break ;@@ -149,7 +149,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane,struct omap_plane_state *omap_state =to_omap_plane_state (plane->state);struct omap_plane *omap_plane =to_omap_plane (plane); - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id;@@ -178,7 +178,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,return -EINVAL ;if (state->fb) { -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && !omap_framebuffer_supports_rotation (state->fb))return -EINVAL ; }@@ -269,7 +269,7 @@ static void omap_plane_reset(struct drm_plane *plane)*/ omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id; - omap_state->base.rotation =BIT (DRM_ROTATE_0 ); + omap_state->base.rotation =DRM_ROTATE_0 ; plane->state = &omap_state->base; plane->state->plane = plane;include/drm/drm_crtc.h +0
-0
include/drm/drm_crtc.h static inline uint64_t I642U64(int64_t val) · line 87
Quoted 8 lines
include/drm/drm_crtc.h +1
-4@@ -84,13 +84,13 @@ static inline uint64_t I642U64(int64_t val)* DRM_REFLECT_Y reflects the image along the specified axis prior to rotation */ #define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3 +#define DRM_ROTATE_0 BIT(0)
This seems not to be indented properly?
Quoted 18 lines
include/drm/drm_crtc.h +5
-2+#define DRM_ROTATE_90 BIT(1) +#define DRM_ROTATE_180 BIT(2) +#define DRM_ROTATE_270 BIT(3)#define DRM_REFLECT_MASK (~DRM_ROTATE_MASK) -#define DRM_REFLECT_X 4 -#define DRM_REFLECT_Y 5 +#define DRM_REFLECT_X BIT(4) +#define DRM_REFLECT_Y BIT(5)enum drm_connector_force {DRM_FORCE_UNSPECIFIED ,Signature · 6 lines
2.5.5 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
Freedreno mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/freedrenoJoonas Lahtinen
maintainerQuoted 46 lines · Liviu Dudau
Quoted 46 lines
drivers/gpu/drm/arm/malidp_planes.c +0
-0@@ -108,7 +108,7 @@ static int malidp_de_plane_check(struct drm_plane *plane, return -EINVAL;
/* packed RGB888 / BGR888 can't be rotated or flipped */drivers/gpu/drm/arm/malidp_planes.c +1
-1- if (state->rotation != BIT(DRM_ROTATE_0) && + if (state->rotation != DRM_ROTATE_0 &&(state->fb->pixel_format ==
DRM_FORMAT_RGB888||state->fb->pixel_format==DRM_FORMAT_BGR888)) return-EINVAL;drivers/gpu/drm/arm/malidp_planes.c +2
-2@@ -188,9 +188,9 @@ static void malidp_de_plane_update(struct drm_plane *plane, /* setup the rotation and axis flip bits */ if (plane->state->rotation & DRM_ROTATE_MASK) val = ilog2(plane->state->rotation & DRM_ROTATE_MASK) << LAYER_ROT_OFFSET; -if (plane->state->rotation &BIT (DRM_REFLECT_X )) +if (plane->state->rotation &DRM_REFLECT_X ) val |= LAYER_V_FLIP; -if (plane->state->rotation &BIT (DRM_REFLECT_Y )) +if (plane->state->rotation &DRM_REFLECT_Y ) val |= LAYER_H_FLIP;
/* set the 'enable layer' bit */drivers/gpu/drm/arm/malidp_planes.c +0
-0@@ -255,12 +255,12 @@ int malidp_de_planes_init(struct drm_device *drm) goto cleanup;
if (!drm->mode_config.rotation_property) {drivers/gpu/drm/arm/malidp_planes.c +6
-6-unsigned long flags =BIT (DRM_ROTATE_0 ) | - BIT(DRM_ROTATE_90) | - BIT(DRM_ROTATE_180) | - BIT(DRM_ROTATE_270) | - BIT(DRM_REFLECT_X) | - BIT(DRM_REFLECT_Y); +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); }drivers/gpu/drm/arm/malidp_planes.c +0
-0@@ -268,7 +268,7 @@ int malidp_de_planes_init(struct drm_device *drm) if (drm->mode_config.rotation_property && (id != DE_SMART)) drm_object_attach_property(&plane->base.base, drm->mode_config.rotation_property,
Quoted 9 lines
Quoted 5 lines
drivers/gpu/drm/arm/malidp_planes.c +1
-1- BIT(DRM_ROTATE_0)); + DRM_ROTATE_0);
drm_plane_helper_add(&plane->base, &malidp_de_plane_helper_funcs);This patch touches arm/mali-dp driver but the maintainers have not been Cc-ed in the patch? Did get_maintainer.pl fail to show our e-mails? (Driver has been added recently, wondering if there are issues with
MAINTAINERSentry).
Being a mechanical change, I just picked all mailing lists from "open list" or "maintainer" entries with grep, only adding David and the ones who I've discussed the intent to do the change with (in the hope they will review)
But now looking looking, I missed the "supporter" entries and thus your mailing list. CC'ing the Mali DP mailing list now too.
So my bad, and thanks for notifying.
Quoted 9 lines
The change looks OK to me for mali-dp. So:
Acked-by Liviu Dudau <[email protected]>(one comment at the end of email as well).
Best regards,
Liviu
<SNIP>
Quoted 4 lines
Quoted 4 lines
include/drm/drm_crtc.h +0
-0@@ -84,13 +84,13 @@ static inline uint64_t I642U64(int64_t val) * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation
Quoted 8 lines
include/drm/drm_crtc.h static inline uint64_t I642U64(int64_t val) · line 87
Quoted 7 lines
include/drm/drm_crtc.h +1
-4*/ #define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3 +#define DRM_ROTATE_0 BIT(0)This seems not to be indented properly?
This is result of being in patch form where '+'/' '/'-' is being added to the beginning of line before the tab, so the spacing might be off. When applied, the code is indented properly.
Regards, Joonas
Signature · 3 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation
Quoted 11 lines · Joonas Lahtinen
Only property creation uses the rotation as an index, so convert the #define to the more used
BIT(DRM_ROTATE_?)form and use__builtin_ffsto figure the index when needed.Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Ville Syrjälä <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>
Patch lgtm
Will conflict badly with my stuff, however.
Quoted 779 lines
--- drivers/gpu/drm/arm/malidp_drv.h | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 20 +++++++++--------- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 22 +++++++++---------- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 24 ++++++++++----------- drivers/gpu/drm/drm_fb_helper.c | 4 ++-- drivers/gpu/drm/drm_plane_helper.c | 2 +- drivers/gpu/drm/drm_rect.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/i915_debugfs.c | 12 +++++------ drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_fbdev.c | 6 +++--- drivers/gpu/drm/i915/intel_sprite.c | 6 +++--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 10 ++++----- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +++--- drivers/gpu/drm/omapdrm/omap_fb.c | 14 ++++++------- drivers/gpu/drm/omapdrm/omap_plane.c | 10 ++++----- include/drm/drm_crtc.h | 12 +++++------ 21 files changed, 109 insertions(+), 109 deletions(-)drivers/gpu/drm/arm/malidp_drv.h +1
-1@@ -49,6 +49,6 @@ void malidp_de_planes_destroy(struct drm_device *drm);int malidp_crtc_init (struct drm_device *drm);/* often used combination of rotational bits */ -#define MALIDP_ROTATED_MASK (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)) +#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)#endif /* __MALIDP_DRV_H__ */ drivers/gpu/drm/arm/malidp_planes.c +10
-10@@ -108,7 +108,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,return -EINVAL ;/* packed RGB888 / BGR888 can't be rotated or flipped */ -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && (state->fb->pixel_format ==DRM_FORMAT_RGB888 || state->fb->pixel_format ==DRM_FORMAT_BGR888 ))return -EINVAL ;@@ -188,9 +188,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,/* setup the rotation and axis flip bits */ if (plane->state->rotation &DRM_ROTATE_MASK ) val =ilog2 (plane->state->rotation &DRM_ROTATE_MASK ) <<LAYER_ROT_OFFSET ; -if (plane->state->rotation &BIT (DRM_REFLECT_X )) +if (plane->state->rotation &DRM_REFLECT_X ) val |=LAYER_V_FLIP ; -if (plane->state->rotation &BIT (DRM_REFLECT_Y )) +if (plane->state->rotation &DRM_REFLECT_Y ) val |=LAYER_H_FLIP ;/* set the 'enable layer' bit */ @@ -255,12 +255,12 @@ int malidp_de_planes_init(struct drm_device *drm) goto cleanup;if (!drm->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) | -BIT (DRM_REFLECT_Y ); +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); }@@ -268,7 +268,7 @@ int malidp_de_planes_init(struct drm_device *drm)if (drm->mode_config.rotation_property && (id !=DE_SMART ))drm_object_attach_property (&plane->base.base, drm->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );drm_plane_helper_add (&plane->base, &malidp_de_plane_helper_funcs);drivers/gpu/drm/armada/armada_overlay.c +1
-1@@ -121,7 +121,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,int ret; ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)return ret;drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +11
-11@@ -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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )))) + (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ))) 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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { tmp = state->crtc_w; state->crtc_w = state->crtc_h; state->crtc_h = tmp;@@ -677,7 +677,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,return -EINVAL ;switch (state->base.rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : offset = ((y_offset + state->src_y + patched_src_w -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x) / xdiv) *@@ -686,7 +686,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, fb->pitches[i]; state->pstride[i] = -fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : offset = ((y_offset + state->src_y + patched_src_h -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_w - 1) /@@ -695,7 +695,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, state->bpp[i]) - fb->pitches[i]; state->pstride[i] =-2 * state->bpp[i];break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_h - 1) /@@ -705,7 +705,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, (2 * state->bpp[i]); state->pstride[i] = fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :default : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i];@@ -905,7 +905,7 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,if (desc->layout.xstride && desc->layout.pstride)drm_object_attach_property (&plane->base.base, plane->base.dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );if (desc->layout.csc) {/* @@ -1056,10 +1056,10 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 )); +DRM_ROTATE_0 | +DRM_ROTATE_90 | +DRM_ROTATE_180 | +DRM_ROTATE_270 );if (!dev->mode_config.rotation_property)return ERR_PTR (-ENOMEM );drivers/gpu/drm/drm_atomic_helper.c +2
-2@@ -2348,7 +2348,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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (primary_state->rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { primary_state->src_w = vdisplay <<16 ; primary_state->src_h = hdisplay <<16 ; }else {@@ -3032,7 +3032,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)if (plane->state) { plane->state->plane = plane; - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; } }EXPORT_SYMBOL (drm_atomic_helper_plane_reset);drivers/gpu/drm/drm_crtc.c +12
-12@@ -2804,8 +2804,8 @@ 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 & (BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_270 ))) + crtc->primary->state->rotation & (DRM_ROTATE_90 | +DRM_ROTATE_270 ))swap (hdisplay, vdisplay); return check_src_coords(x << 16, y << 16,@@ -5646,9 +5646,9 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,* Eg. if the hardware supports everything except DRM_REFLECT_X * one could call this function like this: * -* drm_rotation_simplify(rotation, BIT(DRM_ROTATE_0) | -* BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_180) | -* BIT(DRM_ROTATE_270) | BIT(DRM_REFLECT_Y)); +* drm_rotation_simplify(rotation, DRM_ROTATE_0 | +* DRM_ROTATE_90 | DRM_ROTATE_180 | +* DRM_ROTATE_270 | DRM_REFLECT_Y); * * to eliminate the DRM_ROTATE_X flag. Depending on what kind of * transforms the hardware supports, this function may not @@ -5659,7 +5659,7 @@ unsigned int drm_rotation_simplify(unsigned int rotation, unsigned int supported_rotations) {if (rotation & ~supported_rotations) { - rotation ^=BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ); + rotation ^=DRM_REFLECT_X |DRM_REFLECT_Y ; rotation = (rotation &DRM_REFLECT_MASK ) |BIT ((ffs (rotation &DRM_ROTATE_MASK ) +1 ) %4 ); }@@ -5788,12 +5788,12 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, unsigned int supported_rotations) {static const struct drm_prop_enum_list props[] = { - {DRM_ROTATE_0 ,"rotate-0" }, - {DRM_ROTATE_90 ,"rotate-90" }, - {DRM_ROTATE_180 ,"rotate-180" }, - {DRM_ROTATE_270 ,"rotate-270" }, - {DRM_REFLECT_X ,"reflect-x" }, - {DRM_REFLECT_Y ,"reflect-y" }, + {__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",drivers/gpu/drm/drm_fb_helper.c +2
-2@@ -335,7 +335,7 @@ retry: goto fail; } - plane_state->rotation =BIT (DRM_ROTATE_0 ); + plane_state->rotation =DRM_ROTATE_0 ; plane->old_fb = plane->fb; plane_mask |=1 <<drm_plane_index (plane);@@ -395,7 +395,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)if (dev->mode_config.rotation_property) {drm_mode_plane_set_obj_prop (plane, dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 ); } }drivers/gpu/drm/drm_plane_helper.c +1
-1@@ -274,7 +274,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, false, &visible);drivers/gpu/drm/drm_rect.c +14
-14@@ -317,38 +317,38 @@ void drm_rect_rotate(struct drm_rect *r, {struct drm_rect tmp; -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; } }switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2; r->y1 = width - tmp.x2; r->y2 = width - tmp.x1;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = height - tmp.y2; r->x2 = height - tmp.y1;@@ -392,23 +392,23 @@ void drm_rect_rotate_inv(struct drm_rect *r,struct drm_rect tmp;switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = width - tmp.y2; r->x2 = width - tmp.y1; r->y1 = tmp.x1; r->y2 = tmp.x2;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2;@@ -419,15 +419,15 @@ void drm_rect_rotate_inv(struct drm_rect *r,break ; } -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; }drivers/gpu/drm/i915/i915_debugfs.c +6
-6@@ -3081,12 +3081,12 @@ static const char *plane_rotation(unsigned int rotation)*/ snprintf (buf,sizeof (buf),"%s%s%s%s%s%s(0x%08x)" , - (rotation &BIT (DRM_ROTATE_0 )) ?"0 " :"" , - (rotation &BIT (DRM_ROTATE_90 )) ?"90 " :"" , - (rotation &BIT (DRM_ROTATE_180 )) ?"180 " :"" , - (rotation &BIT (DRM_ROTATE_270 )) ?"270 " :"" , - (rotation &BIT (DRM_REFLECT_X )) ?"FLIPX " :"" , - (rotation &BIT (DRM_REFLECT_Y )) ?"FLIPY " :"" , + (rotation &DRM_ROTATE_0 ) ?"0 " :"" , + (rotation &DRM_ROTATE_90 ) ?"90 " :"" , + (rotation &DRM_ROTATE_180 ) ?"180 " :"" , + (rotation &DRM_ROTATE_270 ) ?"270 " :"" , + (rotation &DRM_REFLECT_X ) ?"FLIPX " :"" , + (rotation &DRM_REFLECT_Y ) ?"FLIPY " :"" , rotation);return buf;drivers/gpu/drm/i915/intel_atomic_plane.c +1
-1@@ -55,7 +55,7 @@ intel_create_plane_state(struct drm_plane *plane)return NULL ; state->base.plane = plane; - state->base.rotation =BIT (DRM_ROTATE_0 ); + state->base.rotation =DRM_ROTATE_0 ; state->ckey.flags =I915_SET_COLORKEY_NONE ;return state;drivers/gpu/drm/i915/intel_display.c +14
-14@@ -2688,7 +2688,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset = linear_offset; } -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (crtc_state->pipe_src_w -1 );@@ -2791,7 +2791,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,intel_compute_tile_offset (&x, &y, fb,0 , fb->pitches[0 ], rotation); linear_offset -= intel_crtc->dspaddr_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {@@ -2952,17 +2952,17 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)u32 skl_plane_ctl_rotation (unsigned int rotation) {switch (rotation) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ;/* * DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr * while i915 HW rotation is clockwise, thats why this swapping. */ -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 :return PLANE_CTL_ROTATE_270 ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 :return PLANE_CTL_ROTATE_180 ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 :return PLANE_CTL_ROTATE_90 ;default :MISSING_CASE (rotation);@@ -4248,7 +4248,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state) intel_crtc->pipe, SKL_CRTC_INDEX);return skl_update_scaler (state, !state->base.active,SKL_CRTC_INDEX , - &state->scaler_state.scaler_id,BIT (DRM_ROTATE_0 ), + &state->scaler_state.scaler_id,DRM_ROTATE_0 , state->pipe_src_w, state->pipe_src_h, adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay); }@@ -10263,7 +10263,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 ==BIT (DRM_ROTATE_180 )) +if (plane_state->base.rotation ==DRM_ROTATE_180 ) cntl |=CURSOR_ROTATE_180 ; }@@ -10309,7 +10309,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && - plane_state->base.rotation ==BIT (DRM_ROTATE_180 )) { + plane_state->base.rotation ==DRM_ROTATE_180 ) { base += (plane_state->base.crtc_h * plane_state->base.crtc_w -1 ) *4 ; }@@ -14304,11 +14304,11 @@ fail:void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane) {if (!dev->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 ); +unsigned long flags =DRM_ROTATE_0 | +DRM_ROTATE_180 ;if (INTEL_INFO (dev)->gen >=9 ) - flags |=BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ); + flags |=DRM_ROTATE_90 |DRM_ROTATE_270 ; dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, flags);@@ -14451,8 +14451,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); +DRM_ROTATE_0 | +DRM_ROTATE_180 );if (dev->mode_config.rotation_property) drm_object_attach_property(&cursor->base.base, dev->mode_config.rotation_property,drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -1258,7 +1258,7 @@ unsigned int intel_tile_height(const struct drm_i915_private *dev_priv,static inline bool intel_rotation_90_or_270 (unsigned int rotation) { -return rotation & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )); +return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); } void intel_create_rotation_property(struct drm_device *dev,drivers/gpu/drm/i915/intel_fbc.c +1
-1@@ -775,7 +775,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)return false; }if (INTEL_INFO (dev_priv)->gen <=4 && !IS_G4X (dev_priv) && - cache->plane.rotation !=BIT (DRM_ROTATE_0 )) { + cache->plane.rotation !=DRM_ROTATE_0 ) { fbc->no_fbc_reason ="rotation unsupported" ;return false; }drivers/gpu/drm/i915/intel_fbdev.c +3
-3@@ -223,7 +223,7 @@ static int intelfb_create(struct drm_fb_helper *helper,* This also validates that any existing fb inherited from the * BIOS is suitable for own access. */ - ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); + ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );if (ret) goto out_unlock;@@ -289,7 +289,7 @@ static int intelfb_create(struct drm_fb_helper *helper, out_destroy_fbi:drm_fb_helper_release_fbi (helper); out_unpin: -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 ); out_unlock:mutex_unlock (&dev->struct_mutex);return ret;@@ -554,7 +554,7 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)if (ifbdev->fb) {mutex_lock (&ifbdev->helper.dev->struct_mutex); -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );mutex_unlock (&ifbdev->helper.dev->struct_mutex);drm_framebuffer_remove (&ifbdev->fb->base);drivers/gpu/drm/i915/intel_sprite.c +3
-3@@ -444,7 +444,7 @@ vlv_update_plane(struct drm_plane *dplane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SP_ROTATE_180 ; x += src_w;@@ -577,7 +577,7 @@ ivb_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */ @@ -714,7 +714,7 @@ ilk_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= dvssurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dvscntr |=DVS_ROTATE_180 ; x += src_w;drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +5
-5@@ -78,7 +78,7 @@ 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, -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property) drm_object_attach_property(&plane->base,@@ -309,8 +309,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - hflip = !!(state->rotation &BIT (DRM_REFLECT_X )); - vflip = !!(state->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(state->rotation &DRM_REFLECT_X ); + vflip = !!(state->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,@@ -743,8 +743,8 @@ 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 &BIT (DRM_REFLECT_X )); - vflip = !!(pstate->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(pstate->rotation &DRM_REFLECT_X ); + vflip = !!(pstate->rotation &DRM_REFLECT_Y );spin_lock_irqsave (&mdp5_plane->pipe_lock, flags);drivers/gpu/drm/omapdrm/omap_drv.c +3
-3@@ -295,9 +295,9 @@ static int omap_modeset_init_properties(struct drm_device *dev)if (priv->has_dmm) { dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) |BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) |BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 | +DRM_REFLECT_X |DRM_REFLECT_Y );if (!dev->mode_config.rotation_property)return -ENOMEM ; }drivers/gpu/drm/omapdrm/omap_fb.c +7
-7@@ -179,24 +179,24 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, (uint32_t)win->rotation);/* fallthru to default to no rotation */ case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 : orient =0 ;break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : orient =MASK_XY_FLIP |MASK_X_INVERT ;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : orient =MASK_X_INVERT |MASK_Y_INVERT ;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : orient =MASK_XY_FLIP |MASK_Y_INVERT ;break ; } -if (win->rotation &BIT (DRM_REFLECT_X )) +if (win->rotation &DRM_REFLECT_X ) orient ^=MASK_X_INVERT ; -if (win->rotation &BIT (DRM_REFLECT_Y )) +if (win->rotation &DRM_REFLECT_Y ) orient ^=MASK_Y_INVERT ;/* adjust x,y offset for flip/invert: */ @@ -213,7 +213,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, }else {switch (win->rotation &DRM_ROTATE_MASK ) {case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :/* OK */ break ;drivers/gpu/drm/omapdrm/omap_plane.c +5
-5@@ -109,8 +109,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, win.src_y = state->src_y >>16 ;switch (state->rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_90 : +case DRM_ROTATE_270 : win.src_w = state->src_h >>16 ; win.src_h = state->src_w >>16 ;break ;@@ -149,7 +149,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane,struct omap_plane_state *omap_state =to_omap_plane_state (plane->state);struct omap_plane *omap_plane =to_omap_plane (plane); - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id;@@ -178,7 +178,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,return -EINVAL ;if (state->fb) { -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && !omap_framebuffer_supports_rotation (state->fb))return -EINVAL ; }@@ -269,7 +269,7 @@ static void omap_plane_reset(struct drm_plane *plane)*/ omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id; - omap_state->base.rotation =BIT (DRM_ROTATE_0 ); + omap_state->base.rotation =DRM_ROTATE_0 ; plane->state = &omap_state->base; plane->state->plane = plane;include/drm/drm_crtc.h +6
-6@@ -84,13 +84,13 @@ static inline uint64_t I642U64(int64_t val)* DRM_REFLECT_Y reflects the image along the specified axis prior to rotation */ #define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3 +#define DRM_ROTATE_0 BIT(0) +#define DRM_ROTATE_90 BIT(1) +#define DRM_ROTATE_180 BIT(2) +#define DRM_ROTATE_270 BIT(3)#define DRM_REFLECT_MASK (~DRM_ROTATE_MASK) -#define DRM_REFLECT_X 4 -#define DRM_REFLECT_Y 5 +#define DRM_REFLECT_X BIT(4) +#define DRM_REFLECT_Y BIT(5)enum drm_connector_force {DRM_FORCE_UNSPECIFIED ,Signature · 1 line
2.5.5
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 771 lines · Joonas Lahtinen
Only property creation uses the rotation as an index, so convert the #define to the more used
BIT(DRM_ROTATE_?)form and use__builtin_ffsto figure the index when needed.Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Ville Syrjälä <[email protected]>Signed-off-by Joonas Lahtinen <[email protected]>--- drivers/gpu/drm/arm/malidp_drv.h | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 20 +++++++++--------- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 22 +++++++++---------- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 24 ++++++++++----------- drivers/gpu/drm/drm_fb_helper.c | 4 ++-- drivers/gpu/drm/drm_plane_helper.c | 2 +- drivers/gpu/drm/drm_rect.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/i915_debugfs.c | 12 +++++------ drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_fbdev.c | 6 +++--- drivers/gpu/drm/i915/intel_sprite.c | 6 +++--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 10 ++++----- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +++--- drivers/gpu/drm/omapdrm/omap_fb.c | 14 ++++++------- drivers/gpu/drm/omapdrm/omap_plane.c | 10 ++++----- include/drm/drm_crtc.h | 12 +++++------ 21 files changed, 109 insertions(+), 109 deletions(-)drivers/gpu/drm/arm/malidp_drv.h +1
-1@@ -49,6 +49,6 @@ void malidp_de_planes_destroy(struct drm_device *drm);int malidp_crtc_init (struct drm_device *drm);/* often used combination of rotational bits */ -#define MALIDP_ROTATED_MASK (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)) +#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)#endif /* __MALIDP_DRV_H__ */ drivers/gpu/drm/arm/malidp_planes.c +10
-10@@ -108,7 +108,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,return -EINVAL ;/* packed RGB888 / BGR888 can't be rotated or flipped */ -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && (state->fb->pixel_format ==DRM_FORMAT_RGB888 || state->fb->pixel_format ==DRM_FORMAT_BGR888 ))return -EINVAL ;@@ -188,9 +188,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,/* setup the rotation and axis flip bits */ if (plane->state->rotation &DRM_ROTATE_MASK ) val =ilog2 (plane->state->rotation &DRM_ROTATE_MASK ) <<LAYER_ROT_OFFSET ; -if (plane->state->rotation &BIT (DRM_REFLECT_X )) +if (plane->state->rotation &DRM_REFLECT_X ) val |=LAYER_V_FLIP ; -if (plane->state->rotation &BIT (DRM_REFLECT_Y )) +if (plane->state->rotation &DRM_REFLECT_Y ) val |=LAYER_H_FLIP ;/* set the 'enable layer' bit */ @@ -255,12 +255,12 @@ int malidp_de_planes_init(struct drm_device *drm) goto cleanup;if (!drm->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) | -BIT (DRM_REFLECT_Y ); +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); }@@ -268,7 +268,7 @@ int malidp_de_planes_init(struct drm_device *drm)if (drm->mode_config.rotation_property && (id !=DE_SMART ))drm_object_attach_property (&plane->base.base, drm->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );drm_plane_helper_add (&plane->base, &malidp_de_plane_helper_funcs);drivers/gpu/drm/armada/armada_overlay.c +1
-1@@ -121,7 +121,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,int ret; ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)return ret;drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +11
-11@@ -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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )))) + (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ))) 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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { tmp = state->crtc_w; state->crtc_w = state->crtc_h; state->crtc_h = tmp;@@ -677,7 +677,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,return -EINVAL ;switch (state->base.rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : offset = ((y_offset + state->src_y + patched_src_w -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x) / xdiv) *@@ -686,7 +686,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, fb->pitches[i]; state->pstride[i] = -fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : offset = ((y_offset + state->src_y + patched_src_h -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_w - 1) /@@ -695,7 +695,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, state->bpp[i]) - fb->pitches[i]; state->pstride[i] =-2 * state->bpp[i];break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_h - 1) /@@ -705,7 +705,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, (2 * state->bpp[i]); state->pstride[i] = fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :default : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i];@@ -905,7 +905,7 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,if (desc->layout.xstride && desc->layout.pstride)drm_object_attach_property (&plane->base.base, plane->base.dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );if (desc->layout.csc) {/* @@ -1056,10 +1056,10 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 )); +DRM_ROTATE_0 | +DRM_ROTATE_90 | +DRM_ROTATE_180 | +DRM_ROTATE_270 );if (!dev->mode_config.rotation_property)return ERR_PTR (-ENOMEM );drivers/gpu/drm/drm_atomic_helper.c +2
-2@@ -2348,7 +2348,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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (primary_state->rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { primary_state->src_w = vdisplay <<16 ; primary_state->src_h = hdisplay <<16 ; }else {@@ -3032,7 +3032,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)if (plane->state) { plane->state->plane = plane; - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; } }EXPORT_SYMBOL (drm_atomic_helper_plane_reset);drivers/gpu/drm/drm_crtc.c +12
-12@@ -2804,8 +2804,8 @@ 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 & (BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_270 ))) + crtc->primary->state->rotation & (DRM_ROTATE_90 | +DRM_ROTATE_270 ))swap (hdisplay, vdisplay); return check_src_coords(x << 16, y << 16,@@ -5646,9 +5646,9 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,* Eg. if the hardware supports everything except DRM_REFLECT_X * one could call this function like this: * -* drm_rotation_simplify(rotation, BIT(DRM_ROTATE_0) | -* BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_180) | -* BIT(DRM_ROTATE_270) | BIT(DRM_REFLECT_Y)); +* drm_rotation_simplify(rotation, DRM_ROTATE_0 | +* DRM_ROTATE_90 | DRM_ROTATE_180 | +* DRM_ROTATE_270 | DRM_REFLECT_Y); * * to eliminate the DRM_ROTATE_X flag. Depending on what kind of * transforms the hardware supports, this function may not @@ -5659,7 +5659,7 @@ unsigned int drm_rotation_simplify(unsigned int rotation, unsigned int supported_rotations) {if (rotation & ~supported_rotations) { - rotation ^=BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ); + rotation ^=DRM_REFLECT_X |DRM_REFLECT_Y ; rotation = (rotation &DRM_REFLECT_MASK ) |BIT ((ffs (rotation &DRM_ROTATE_MASK ) +1 ) %4 ); }@@ -5788,12 +5788,12 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, unsigned int supported_rotations) {static const struct drm_prop_enum_list props[] = { - {DRM_ROTATE_0 ,"rotate-0" }, - {DRM_ROTATE_90 ,"rotate-90" }, - {DRM_ROTATE_180 ,"rotate-180" }, - {DRM_ROTATE_270 ,"rotate-270" }, - {DRM_REFLECT_X ,"reflect-x" }, - {DRM_REFLECT_Y ,"reflect-y" }, + {__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",drivers/gpu/drm/drm_fb_helper.c +2
-2@@ -335,7 +335,7 @@ retry: goto fail; } - plane_state->rotation =BIT (DRM_ROTATE_0 ); + plane_state->rotation =DRM_ROTATE_0 ; plane->old_fb = plane->fb; plane_mask |=1 <<drm_plane_index (plane);@@ -395,7 +395,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)if (dev->mode_config.rotation_property) {drm_mode_plane_set_obj_prop (plane, dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 ); } }drivers/gpu/drm/drm_plane_helper.c +1
-1@@ -274,7 +274,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, false, &visible);drivers/gpu/drm/drm_rect.c +14
-14@@ -317,38 +317,38 @@ void drm_rect_rotate(struct drm_rect *r, {struct drm_rect tmp; -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; } }switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2; r->y1 = width - tmp.x2; r->y2 = width - tmp.x1;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = height - tmp.y2; r->x2 = height - tmp.y1;@@ -392,23 +392,23 @@ void drm_rect_rotate_inv(struct drm_rect *r,struct drm_rect tmp;switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = width - tmp.y2; r->x2 = width - tmp.y1; r->y1 = tmp.x1; r->y2 = tmp.x2;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2;@@ -419,15 +419,15 @@ void drm_rect_rotate_inv(struct drm_rect *r,break ; } -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; }drivers/gpu/drm/i915/i915_debugfs.c +6
-6@@ -3081,12 +3081,12 @@ static const char *plane_rotation(unsigned int rotation)*/ snprintf (buf,sizeof (buf),"%s%s%s%s%s%s(0x%08x)" , - (rotation &BIT (DRM_ROTATE_0 )) ?"0 " :"" , - (rotation &BIT (DRM_ROTATE_90 )) ?"90 " :"" , - (rotation &BIT (DRM_ROTATE_180 )) ?"180 " :"" , - (rotation &BIT (DRM_ROTATE_270 )) ?"270 " :"" , - (rotation &BIT (DRM_REFLECT_X )) ?"FLIPX " :"" , - (rotation &BIT (DRM_REFLECT_Y )) ?"FLIPY " :"" , + (rotation &DRM_ROTATE_0 ) ?"0 " :"" , + (rotation &DRM_ROTATE_90 ) ?"90 " :"" , + (rotation &DRM_ROTATE_180 ) ?"180 " :"" , + (rotation &DRM_ROTATE_270 ) ?"270 " :"" , + (rotation &DRM_REFLECT_X ) ?"FLIPX " :"" , + (rotation &DRM_REFLECT_Y ) ?"FLIPY " :"" , rotation);return buf;drivers/gpu/drm/i915/intel_atomic_plane.c +1
-1@@ -55,7 +55,7 @@ intel_create_plane_state(struct drm_plane *plane)return NULL ; state->base.plane = plane; - state->base.rotation =BIT (DRM_ROTATE_0 ); + state->base.rotation =DRM_ROTATE_0 ; state->ckey.flags =I915_SET_COLORKEY_NONE ;return state;drivers/gpu/drm/i915/intel_display.c +14
-14@@ -2688,7 +2688,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset = linear_offset; } -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (crtc_state->pipe_src_w -1 );@@ -2791,7 +2791,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,intel_compute_tile_offset (&x, &y, fb,0 , fb->pitches[0 ], rotation); linear_offset -= intel_crtc->dspaddr_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {@@ -2952,17 +2952,17 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)u32 skl_plane_ctl_rotation (unsigned int rotation) {switch (rotation) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ;/* * DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr * while i915 HW rotation is clockwise, thats why this swapping. */ -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 :return PLANE_CTL_ROTATE_270 ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 :return PLANE_CTL_ROTATE_180 ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 :return PLANE_CTL_ROTATE_90 ;default :MISSING_CASE (rotation);@@ -4248,7 +4248,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state) intel_crtc->pipe, SKL_CRTC_INDEX);return skl_update_scaler (state, !state->base.active,SKL_CRTC_INDEX , - &state->scaler_state.scaler_id,BIT (DRM_ROTATE_0 ), + &state->scaler_state.scaler_id,DRM_ROTATE_0 , state->pipe_src_w, state->pipe_src_h, adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay); }@@ -10263,7 +10263,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 ==BIT (DRM_ROTATE_180 )) +if (plane_state->base.rotation ==DRM_ROTATE_180 ) cntl |=CURSOR_ROTATE_180 ; }@@ -10309,7 +10309,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && - plane_state->base.rotation ==BIT (DRM_ROTATE_180 )) { + plane_state->base.rotation ==DRM_ROTATE_180 ) { base += (plane_state->base.crtc_h * plane_state->base.crtc_w -1 ) *4 ; }@@ -14304,11 +14304,11 @@ fail:void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane) {if (!dev->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 ); +unsigned long flags =DRM_ROTATE_0 | +DRM_ROTATE_180 ;if (INTEL_INFO (dev)->gen >=9 ) - flags |=BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ); + flags |=DRM_ROTATE_90 |DRM_ROTATE_270 ; dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, flags);@@ -14451,8 +14451,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); +DRM_ROTATE_0 | +DRM_ROTATE_180 );if (dev->mode_config.rotation_property) drm_object_attach_property(&cursor->base.base, dev->mode_config.rotation_property,drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -1258,7 +1258,7 @@ unsigned int intel_tile_height(const struct drm_i915_private *dev_priv,static inline bool intel_rotation_90_or_270 (unsigned int rotation) { -return rotation & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )); +return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); } void intel_create_rotation_property(struct drm_device *dev,drivers/gpu/drm/i915/intel_fbc.c +1
-1@@ -775,7 +775,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)return false; }if (INTEL_INFO (dev_priv)->gen <=4 && !IS_G4X (dev_priv) && - cache->plane.rotation !=BIT (DRM_ROTATE_0 )) { + cache->plane.rotation !=DRM_ROTATE_0 ) { fbc->no_fbc_reason ="rotation unsupported" ;return false; }drivers/gpu/drm/i915/intel_fbdev.c +3
-3@@ -223,7 +223,7 @@ static int intelfb_create(struct drm_fb_helper *helper,* This also validates that any existing fb inherited from the * BIOS is suitable for own access. */ - ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); + ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );if (ret) goto out_unlock;@@ -289,7 +289,7 @@ static int intelfb_create(struct drm_fb_helper *helper, out_destroy_fbi:drm_fb_helper_release_fbi (helper); out_unpin: -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 ); out_unlock:mutex_unlock (&dev->struct_mutex);return ret;@@ -554,7 +554,7 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)if (ifbdev->fb) {mutex_lock (&ifbdev->helper.dev->struct_mutex); -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );mutex_unlock (&ifbdev->helper.dev->struct_mutex);drm_framebuffer_remove (&ifbdev->fb->base);drivers/gpu/drm/i915/intel_sprite.c +3
-3@@ -444,7 +444,7 @@ vlv_update_plane(struct drm_plane *dplane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SP_ROTATE_180 ; x += src_w;@@ -577,7 +577,7 @@ ivb_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */ @@ -714,7 +714,7 @@ ilk_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= dvssurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dvscntr |=DVS_ROTATE_180 ; x += src_w;drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +5
-5@@ -78,7 +78,7 @@ 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, -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property) drm_object_attach_property(&plane->base,@@ -309,8 +309,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - hflip = !!(state->rotation &BIT (DRM_REFLECT_X )); - vflip = !!(state->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(state->rotation &DRM_REFLECT_X ); + vflip = !!(state->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,@@ -743,8 +743,8 @@ 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 &BIT (DRM_REFLECT_X )); - vflip = !!(pstate->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(pstate->rotation &DRM_REFLECT_X ); + vflip = !!(pstate->rotation &DRM_REFLECT_Y );spin_lock_irqsave (&mdp5_plane->pipe_lock, flags);drivers/gpu/drm/omapdrm/omap_drv.c +3
-3@@ -295,9 +295,9 @@ static int omap_modeset_init_properties(struct drm_device *dev)if (priv->has_dmm) { dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) |BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) |BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 | +DRM_REFLECT_X |DRM_REFLECT_Y );if (!dev->mode_config.rotation_property)return -ENOMEM ; }drivers/gpu/drm/omapdrm/omap_fb.c +7
-7@@ -179,24 +179,24 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, (uint32_t)win->rotation);/* fallthru to default to no rotation */ case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 : orient =0 ;break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : orient =MASK_XY_FLIP |MASK_X_INVERT ;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : orient =MASK_X_INVERT |MASK_Y_INVERT ;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : orient =MASK_XY_FLIP |MASK_Y_INVERT ;break ; } -if (win->rotation &BIT (DRM_REFLECT_X )) +if (win->rotation &DRM_REFLECT_X ) orient ^=MASK_X_INVERT ; -if (win->rotation &BIT (DRM_REFLECT_Y )) +if (win->rotation &DRM_REFLECT_Y ) orient ^=MASK_Y_INVERT ;/* adjust x,y offset for flip/invert: */ @@ -213,7 +213,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, }else {switch (win->rotation &DRM_ROTATE_MASK ) {case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :/* OK */ break ;drivers/gpu/drm/omapdrm/omap_plane.c +5
-5@@ -109,8 +109,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, win.src_y = state->src_y >>16 ;switch (state->rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_90 : +case DRM_ROTATE_270 : win.src_w = state->src_h >>16 ; win.src_h = state->src_w >>16 ;break ;@@ -149,7 +149,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane,struct omap_plane_state *omap_state =to_omap_plane_state (plane->state);struct omap_plane *omap_plane =to_omap_plane (plane); - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id;@@ -178,7 +178,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,return -EINVAL ;if (state->fb) { -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && !omap_framebuffer_supports_rotation (state->fb))return -EINVAL ; }@@ -269,7 +269,7 @@ static void omap_plane_reset(struct drm_plane *plane)*/ omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id; - omap_state->base.rotation =BIT (DRM_ROTATE_0 ); + omap_state->base.rotation =DRM_ROTATE_0 ; plane->state = &omap_state->base; plane->state->plane = plane;include/drm/drm_crtc.h +0
-0@@ -84,13 +84,13 @@ static inline uint64_t I642U64(int64_t val)* DRM_REFLECT_Y reflects the image along the specified axis prior to rotation */
include/drm/drm_crtc.h static inline uint64_t I642U64(int64_t val) · line 91
Quoted 10 lines
include/drm/drm_crtc.h +4
-4#define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3 +#define DRM_ROTATE_0 BIT(0) +#define DRM_ROTATE_90 BIT(1) +#define DRM_ROTATE_180 BIT(2) +#define DRM_ROTATE_270 BIT(3)#define DRM_REFLECT_MASK (~DRM_ROTATE_MASK)
It's probably a good time to give these masks a little love. Could we just generate them (both ROTATE and REFLECT) from the ROTATE and REFLECT values now?
Sean
Quoted 14 lines
include/drm/drm_crtc.h +2
-3-#define DRM_REFLECT_X 4 -#define DRM_REFLECT_Y 5 +#define DRM_REFLECT_X BIT(4) +#define DRM_REFLECT_Y BIT(5)enum drm_connector_force {DRM_FORCE_UNSPECIFIED , --2.5.5
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
A message that is not in the archive (sent off-list or not yet received): CAOw6vbKGJYdN+aZqM7+EDGut3LU3YkDD1HT4QE=AObh4r2UVtQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
Quoted 14 lines · Sean Paul
Quoted 12 lines · Joonas Lahtinen
include/drm/drm_crtc.h +0
-4@@ -84,13 +84,13 @@ static inline uint64_t I642U64(int64_t val)* DRM_REFLECT_Y reflects the image along the specified axis prior to rotation */ #define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3
Quoted 8 lines
include/drm/drm_crtc.h static inline uint64_t I642U64(int64_t val) · line 91
Quoted 5 lines
include/drm/drm_crtc.h +4
-0+#define DRM_ROTATE_0 BIT(0) +#define DRM_ROTATE_90 BIT(1) +#define DRM_ROTATE_180 BIT(2) +#define DRM_ROTATE_270 BIT(3) #define DRM_REFLECT_MASK (~DRM_ROTATE_MASK)It's probably a good time to give these masks a little love. Could we just generate them (both ROTATE and REFLECT) from the ROTATE and REFLECT values now?
I was consider it too, so I think it would be an OK change. Fine with the patch otherwise? I can send a revised version with that changed.
Regards, Joonas
Quoted 18 lines
Sean
Quoted 15 lines
include/drm/drm_crtc.h +2
-3-#define DRM_REFLECT_X 4 -#define DRM_REFLECT_Y 5 +#define DRM_REFLECT_X BIT(4) +#define DRM_REFLECT_Y BIT(5) enum drm_connector_force { DRM_FORCE_UNSPECIFIED, --2.5.5
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation _______________________________________________ Freedreno mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/freedreno
Quoted 24 lines · Joonas Lahtinen
Quoted 14 lines · Sean Paul
Quoted 12 lines · Joonas Lahtinen
include/drm/drm_crtc.h +0
-4@@ -84,13 +84,13 @@ static inline uint64_t I642U64(int64_t val)* DRM_REFLECT_Y reflects the image along the specified axis prior to rotation */ #define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3Quoted 8 lines
include/drm/drm_crtc.h static inline uint64_t I642U64(int64_t val) · line 91
Quoted 5 lines
include/drm/drm_crtc.h +4
-0+#define DRM_ROTATE_0 BIT(0) +#define DRM_ROTATE_90 BIT(1) +#define DRM_ROTATE_180 BIT(2) +#define DRM_ROTATE_270 BIT(3)#define DRM_REFLECT_MASK (~DRM_ROTATE_MASK)It's probably a good time to give these masks a little love. Could we just generate them (both ROTATE and REFLECT) from the ROTATE and REFLECT values now?
Quoted 3 lines
I was consider it too, so I think it would be an OK change. Fine with the patch otherwise? I can send a revised version with that changed.
Yeah, everything else looks good to me. Please resend.
Sean
Quoted 24 lines
Regards, Joonas
Quoted 14 lines
Sean
Quoted 11 lines
include/drm/drm_crtc.h +2
-3-#define DRM_REFLECT_X 4 -#define DRM_REFLECT_Y 5 +#define DRM_REFLECT_X BIT(4) +#define DRM_REFLECT_Y BIT(5)enum drm_connector_force {DRM_FORCE_UNSPECIFIED , --2.5.5
Quoted 4 lines
Quoted 4 lines
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel--
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
Joonas Lahtinen
maintainerPATCH 1/1 drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
Only property creation uses the rotation as an index, so convert the to figure the index when needed.
v2: Use the new defines to build the _MASK defines (Sean)
--- drivers/gpu/drm/arm/malidp_drv.h | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 20 +++++++++--------- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 22 +++++++++---------- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 24 ++++++++++----------- drivers/gpu/drm/drm_fb_helper.c | 4 ++-- drivers/gpu/drm/drm_plane_helper.c | 2 +- drivers/gpu/drm/drm_rect.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/i915_debugfs.c | 12 +++++------ drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_fbdev.c | 6 +++--- drivers/gpu/drm/i915/intel_sprite.c | 6 +++--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 10 ++++----- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +++--- drivers/gpu/drm/omapdrm/omap_fb.c | 14 ++++++------- drivers/gpu/drm/omapdrm/omap_plane.c | 10 ++++----- include/drm/drm_crtc.h | 17 ++++++++------- 21 files changed, 112 insertions(+), 111 deletions(-)
drivers/gpu/drm/arm/malidp_drv.h +1 -1
@@ -49,6 +49,6 @@ void malidp_de_planes_destroy(struct drm_device *drm);int malidp_crtc_init (struct drm_device *drm);/* often used combination of rotational bits */ -#define MALIDP_ROTATED_MASK (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)) +#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)#endif /* __MALIDP_DRV_H__ */
drivers/gpu/drm/arm/malidp_planes.c +10 -10
@@ -108,7 +108,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,return -EINVAL ;/* packed RGB888 / BGR888 can't be rotated or flipped */ -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && (state->fb->pixel_format ==DRM_FORMAT_RGB888 || state->fb->pixel_format ==DRM_FORMAT_BGR888 ))return -EINVAL ;
@@ -188,9 +188,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,/* setup the rotation and axis flip bits */ if (plane->state->rotation &DRM_ROTATE_MASK ) val =ilog2 (plane->state->rotation &DRM_ROTATE_MASK ) <<LAYER_ROT_OFFSET ; -if (plane->state->rotation &BIT (DRM_REFLECT_X )) +if (plane->state->rotation &DRM_REFLECT_X ) val |=LAYER_V_FLIP ; -if (plane->state->rotation &BIT (DRM_REFLECT_Y )) +if (plane->state->rotation &DRM_REFLECT_Y ) val |=LAYER_H_FLIP ;/* set the 'enable layer' bit */
@@ -255,12 +255,12 @@ int malidp_de_planes_init(struct drm_device *drm) goto cleanup;if (!drm->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) | -BIT (DRM_REFLECT_Y ); +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); }
@@ -268,7 +268,7 @@ int malidp_de_planes_init(struct drm_device *drm)if (drm->mode_config.rotation_property && (id !=DE_SMART ))drm_object_attach_property (&plane->base.base, drm->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );drm_plane_helper_add (&plane->base, &malidp_de_plane_helper_funcs);
drivers/gpu/drm/armada/armada_overlay.c +1 -1
@@ -121,7 +121,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,int ret; ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)return ret;
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +11 -11
@@ -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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )))) + (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ))) 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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { tmp = state->crtc_w; state->crtc_w = state->crtc_h; state->crtc_h = tmp;
@@ -677,7 +677,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,return -EINVAL ;switch (state->base.rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : offset = ((y_offset + state->src_y + patched_src_w -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x) / xdiv) *
@@ -686,7 +686,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, fb->pitches[i]; state->pstride[i] = -fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : offset = ((y_offset + state->src_y + patched_src_h -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_w - 1) /
@@ -695,7 +695,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, state->bpp[i]) - fb->pitches[i]; state->pstride[i] =-2 * state->bpp[i];break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_h - 1) /
@@ -705,7 +705,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, (2 * state->bpp[i]); state->pstride[i] = fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :default : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i];
@@ -905,7 +905,7 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,if (desc->layout.xstride && desc->layout.pstride)drm_object_attach_property (&plane->base.base, plane->base.dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );if (desc->layout.csc) {/*
@@ -1056,10 +1056,10 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 )); +DRM_ROTATE_0 | +DRM_ROTATE_90 | +DRM_ROTATE_180 | +DRM_ROTATE_270 );if (!dev->mode_config.rotation_property)return ERR_PTR (-ENOMEM );
drivers/gpu/drm/drm_atomic_helper.c +2 -2
@@ -2348,7 +2348,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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (primary_state->rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { primary_state->src_w = vdisplay <<16 ; primary_state->src_h = hdisplay <<16 ; }else {
@@ -3032,7 +3032,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)if (plane->state) { plane->state->plane = plane; - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; } }EXPORT_SYMBOL (drm_atomic_helper_plane_reset);
drivers/gpu/drm/drm_crtc.c +12 -12
@@ -2804,8 +2804,8 @@ 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 & (BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_270 ))) + crtc->primary->state->rotation & (DRM_ROTATE_90 | +DRM_ROTATE_270 ))swap (hdisplay, vdisplay); return check_src_coords(x << 16, y << 16,
@@ -5646,9 +5646,9 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,* Eg. if the hardware supports everything except DRM_REFLECT_X * one could call this function like this: * -* drm_rotation_simplify(rotation, BIT(DRM_ROTATE_0) | -* BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_180) | -* BIT(DRM_ROTATE_270) | BIT(DRM_REFLECT_Y)); +* drm_rotation_simplify(rotation, DRM_ROTATE_0 | +* DRM_ROTATE_90 | DRM_ROTATE_180 | +* DRM_ROTATE_270 | DRM_REFLECT_Y); * * to eliminate the DRM_ROTATE_X flag. Depending on what kind of * transforms the hardware supports, this function may not
@@ -5659,7 +5659,7 @@ unsigned int drm_rotation_simplify(unsigned int rotation, unsigned int supported_rotations) {if (rotation & ~supported_rotations) { - rotation ^=BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ); + rotation ^=DRM_REFLECT_X |DRM_REFLECT_Y ; rotation = (rotation &DRM_REFLECT_MASK ) |BIT ((ffs (rotation &DRM_ROTATE_MASK ) +1 ) %4 ); }
@@ -5788,12 +5788,12 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, unsigned int supported_rotations) {static const struct drm_prop_enum_list props[] = { - {DRM_ROTATE_0 ,"rotate-0" }, - {DRM_ROTATE_90 ,"rotate-90" }, - {DRM_ROTATE_180 ,"rotate-180" }, - {DRM_ROTATE_270 ,"rotate-270" }, - {DRM_REFLECT_X ,"reflect-x" }, - {DRM_REFLECT_Y ,"reflect-y" }, + {__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",
drivers/gpu/drm/drm_fb_helper.c +2 -2
@@ -335,7 +335,7 @@ retry: goto fail; } - plane_state->rotation =BIT (DRM_ROTATE_0 ); + plane_state->rotation =DRM_ROTATE_0 ; plane->old_fb = plane->fb; plane_mask |=1 <<drm_plane_index (plane);
@@ -395,7 +395,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)if (dev->mode_config.rotation_property) {drm_mode_plane_set_obj_prop (plane, dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 ); } }
drivers/gpu/drm/drm_plane_helper.c +1 -1
@@ -274,7 +274,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, false, &visible);
drivers/gpu/drm/drm_rect.c +14 -14
@@ -317,38 +317,38 @@ void drm_rect_rotate(struct drm_rect *r, {struct drm_rect tmp; -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; } }switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2; r->y1 = width - tmp.x2; r->y2 = width - tmp.x1;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = height - tmp.y2; r->x2 = height - tmp.y1;
@@ -392,23 +392,23 @@ void drm_rect_rotate_inv(struct drm_rect *r,struct drm_rect tmp;switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = width - tmp.y2; r->x2 = width - tmp.y1; r->y1 = tmp.x1; r->y2 = tmp.x2;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2;
@@ -419,15 +419,15 @@ void drm_rect_rotate_inv(struct drm_rect *r,break ; } -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; }
drivers/gpu/drm/i915/i915_debugfs.c +6 -6
@@ -3081,12 +3081,12 @@ static const char *plane_rotation(unsigned int rotation)*/ snprintf (buf,sizeof (buf),"%s%s%s%s%s%s(0x%08x)" , - (rotation &BIT (DRM_ROTATE_0 )) ?"0 " :"" , - (rotation &BIT (DRM_ROTATE_90 )) ?"90 " :"" , - (rotation &BIT (DRM_ROTATE_180 )) ?"180 " :"" , - (rotation &BIT (DRM_ROTATE_270 )) ?"270 " :"" , - (rotation &BIT (DRM_REFLECT_X )) ?"FLIPX " :"" , - (rotation &BIT (DRM_REFLECT_Y )) ?"FLIPY " :"" , + (rotation &DRM_ROTATE_0 ) ?"0 " :"" , + (rotation &DRM_ROTATE_90 ) ?"90 " :"" , + (rotation &DRM_ROTATE_180 ) ?"180 " :"" , + (rotation &DRM_ROTATE_270 ) ?"270 " :"" , + (rotation &DRM_REFLECT_X ) ?"FLIPX " :"" , + (rotation &DRM_REFLECT_Y ) ?"FLIPY " :"" , rotation);return buf;
drivers/gpu/drm/i915/intel_atomic_plane.c +1 -1
@@ -55,7 +55,7 @@ intel_create_plane_state(struct drm_plane *plane)return NULL ; state->base.plane = plane; - state->base.rotation =BIT (DRM_ROTATE_0 ); + state->base.rotation =DRM_ROTATE_0 ; state->ckey.flags =I915_SET_COLORKEY_NONE ;return state;
drivers/gpu/drm/i915/intel_display.c +14 -14
@@ -2688,7 +2688,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset = linear_offset; } -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (crtc_state->pipe_src_w -1 );
@@ -2791,7 +2791,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,intel_compute_tile_offset (&x, &y, fb,0 , fb->pitches[0 ], rotation); linear_offset -= intel_crtc->dspaddr_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {
@@ -2952,17 +2952,17 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)u32 skl_plane_ctl_rotation (unsigned int rotation) {switch (rotation) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ;/* * DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr * while i915 HW rotation is clockwise, thats why this swapping. */ -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 :return PLANE_CTL_ROTATE_270 ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 :return PLANE_CTL_ROTATE_180 ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 :return PLANE_CTL_ROTATE_90 ;default :MISSING_CASE (rotation);
@@ -4248,7 +4248,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state) intel_crtc->pipe, SKL_CRTC_INDEX);return skl_update_scaler (state, !state->base.active,SKL_CRTC_INDEX , - &state->scaler_state.scaler_id,BIT (DRM_ROTATE_0 ), + &state->scaler_state.scaler_id,DRM_ROTATE_0 , state->pipe_src_w, state->pipe_src_h, adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay); }
@@ -10255,7 +10255,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 ==BIT (DRM_ROTATE_180 )) +if (plane_state->base.rotation ==DRM_ROTATE_180 ) cntl |=CURSOR_ROTATE_180 ; }
@@ -10301,7 +10301,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && - plane_state->base.rotation ==BIT (DRM_ROTATE_180 )) { + plane_state->base.rotation ==DRM_ROTATE_180 ) { base += (plane_state->base.crtc_h * plane_state->base.crtc_w -1 ) *4 ; }
@@ -14296,11 +14296,11 @@ fail:void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane) {if (!dev->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 ); +unsigned long flags =DRM_ROTATE_0 | +DRM_ROTATE_180 ;if (INTEL_INFO (dev)->gen >=9 ) - flags |=BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ); + flags |=DRM_ROTATE_90 |DRM_ROTATE_270 ; dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, flags);
@@ -14443,8 +14443,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); +DRM_ROTATE_0 | +DRM_ROTATE_180 );if (dev->mode_config.rotation_property) drm_object_attach_property(&cursor->base.base, dev->mode_config.rotation_property,
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -1258,7 +1258,7 @@ unsigned int intel_tile_height(const struct drm_i915_private *dev_priv,static inline bool intel_rotation_90_or_270 (unsigned int rotation) { -return rotation & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )); +return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); } void intel_create_rotation_property(struct drm_device *dev,
drivers/gpu/drm/i915/intel_fbc.c +1 -1
@@ -775,7 +775,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)return false; }if (INTEL_INFO (dev_priv)->gen <=4 && !IS_G4X (dev_priv) && - cache->plane.rotation !=BIT (DRM_ROTATE_0 )) { + cache->plane.rotation !=DRM_ROTATE_0 ) { fbc->no_fbc_reason ="rotation unsupported" ;return false; }
drivers/gpu/drm/i915/intel_fbdev.c +3 -3
@@ -223,7 +223,7 @@ static int intelfb_create(struct drm_fb_helper *helper,* This also validates that any existing fb inherited from the * BIOS is suitable for own access. */ - ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); + ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );if (ret) goto out_unlock;
@@ -289,7 +289,7 @@ static int intelfb_create(struct drm_fb_helper *helper, out_destroy_fbi:drm_fb_helper_release_fbi (helper); out_unpin: -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 ); out_unlock:mutex_unlock (&dev->struct_mutex);return ret;
@@ -554,7 +554,7 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)if (ifbdev->fb) {mutex_lock (&ifbdev->helper.dev->struct_mutex); -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );mutex_unlock (&ifbdev->helper.dev->struct_mutex);drm_framebuffer_remove (&ifbdev->fb->base);
drivers/gpu/drm/i915/intel_sprite.c +3 -3
@@ -444,7 +444,7 @@ vlv_update_plane(struct drm_plane *dplane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SP_ROTATE_180 ; x += src_w;
@@ -577,7 +577,7 @@ ivb_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */
@@ -714,7 +714,7 @@ ilk_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= dvssurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dvscntr |=DVS_ROTATE_180 ; x += src_w;
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +5 -5
@@ -78,7 +78,7 @@ 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, -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property) drm_object_attach_property(&plane->base,
@@ -309,8 +309,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - hflip = !!(state->rotation &BIT (DRM_REFLECT_X )); - vflip = !!(state->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(state->rotation &DRM_REFLECT_X ); + vflip = !!(state->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,
@@ -743,8 +743,8 @@ 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 &BIT (DRM_REFLECT_X )); - vflip = !!(pstate->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(pstate->rotation &DRM_REFLECT_X ); + vflip = !!(pstate->rotation &DRM_REFLECT_Y );spin_lock_irqsave (&mdp5_plane->pipe_lock, flags);
drivers/gpu/drm/omapdrm/omap_drv.c +3 -3
@@ -295,9 +295,9 @@ static int omap_modeset_init_properties(struct drm_device *dev)if (priv->has_dmm) { dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) |BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) |BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 | +DRM_REFLECT_X |DRM_REFLECT_Y );if (!dev->mode_config.rotation_property)return -ENOMEM ; }
drivers/gpu/drm/omapdrm/omap_fb.c +7 -7
@@ -179,24 +179,24 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, (uint32_t)win->rotation);/* fallthru to default to no rotation */ case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 : orient =0 ;break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : orient =MASK_XY_FLIP |MASK_X_INVERT ;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : orient =MASK_X_INVERT |MASK_Y_INVERT ;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : orient =MASK_XY_FLIP |MASK_Y_INVERT ;break ; } -if (win->rotation &BIT (DRM_REFLECT_X )) +if (win->rotation &DRM_REFLECT_X ) orient ^=MASK_X_INVERT ; -if (win->rotation &BIT (DRM_REFLECT_Y )) +if (win->rotation &DRM_REFLECT_Y ) orient ^=MASK_Y_INVERT ;/* adjust x,y offset for flip/invert: */
@@ -213,7 +213,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, }else {switch (win->rotation &DRM_ROTATE_MASK ) {case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :/* OK */ break ;
drivers/gpu/drm/omapdrm/omap_plane.c +5 -5
@@ -109,8 +109,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, win.src_y = state->src_y >>16 ;switch (state->rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_90 : +case DRM_ROTATE_270 : win.src_w = state->src_h >>16 ; win.src_h = state->src_w >>16 ;break ;
@@ -149,7 +149,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane,struct omap_plane_state *omap_state =to_omap_plane_state (plane->state);struct omap_plane *omap_plane =to_omap_plane (plane); - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id;
@@ -178,7 +178,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,return -EINVAL ;if (state->fb) { -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && !omap_framebuffer_supports_rotation (state->fb))return -EINVAL ; }
@@ -269,7 +269,7 @@ static void omap_plane_reset(struct drm_plane *plane)*/ omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id; - omap_state->base.rotation =BIT (DRM_ROTATE_0 ); + omap_state->base.rotation =DRM_ROTATE_0 ; plane->state = &omap_state->base; plane->state->plane = plane;
include/drm/drm_crtc.h +9 -8
@@ -83,14 +83,15 @@ static inline uint64_t I642U64(int64_t val)* specified amount in degrees in counter clockwise direction. DRM_REFLECT_X and * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation */ -#define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3 -#define DRM_REFLECT_MASK (~DRM_ROTATE_MASK) -#define DRM_REFLECT_X 4 -#define DRM_REFLECT_Y 5 +#define DRM_ROTATE_0 BIT(0) +#define DRM_ROTATE_90 BIT(1) +#define DRM_ROTATE_180 BIT(2) +#define DRM_ROTATE_270 BIT(3) +#define DRM_ROTATE_MASK (DRM_ROTATE_0 | DRM_ROTATE_90 | \ + DRM_ROTATE_180 | DRM_ROTATE_270) +#define DRM_REFLECT_X BIT(4) +#define DRM_REFLECT_Y BIT(5) +#define DRM_REFLECT_MASK (DRM_REFLECT_X | DRM_REFLECT_Y)enum drm_connector_force {DRM_FORCE_UNSPECIFIED ,
Signature · 1 line
2.5.5
Joonas Lahtinen
maintainerThis can be disregarded.
Signature · 3 lines
Joonas Lahtinen Open Source Technology Center Intel Corporation
Joonas Lahtinen
maintainerPATCH v2 1/1 drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
In reply to Sean PaulOnly property creation uses the rotation as an index, so convert the to figure the index when needed.
v2: Use the new defines to build the _MASK defines (Sean)
--- drivers/gpu/drm/arm/malidp_drv.h | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 20 +++++++++--------- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 22 +++++++++---------- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 24 ++++++++++----------- drivers/gpu/drm/drm_fb_helper.c | 4 ++-- drivers/gpu/drm/drm_plane_helper.c | 2 +- drivers/gpu/drm/drm_rect.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/i915_debugfs.c | 12 +++++------ drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_fbdev.c | 6 +++--- drivers/gpu/drm/i915/intel_sprite.c | 6 +++--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 10 ++++----- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +++--- drivers/gpu/drm/omapdrm/omap_fb.c | 14 ++++++------- drivers/gpu/drm/omapdrm/omap_plane.c | 10 ++++----- include/drm/drm_crtc.h | 17 ++++++++------- 21 files changed, 112 insertions(+), 111 deletions(-)
drivers/gpu/drm/arm/malidp_drv.h +1 -1
@@ -49,6 +49,6 @@ void malidp_de_planes_destroy(struct drm_device *drm);int malidp_crtc_init (struct drm_device *drm);/* often used combination of rotational bits */ -#define MALIDP_ROTATED_MASK (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)) +#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)#endif /* __MALIDP_DRV_H__ */
drivers/gpu/drm/arm/malidp_planes.c +10 -10
@@ -108,7 +108,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,return -EINVAL ;/* packed RGB888 / BGR888 can't be rotated or flipped */ -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && (state->fb->pixel_format ==DRM_FORMAT_RGB888 || state->fb->pixel_format ==DRM_FORMAT_BGR888 ))return -EINVAL ;
@@ -188,9 +188,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,/* setup the rotation and axis flip bits */ if (plane->state->rotation &DRM_ROTATE_MASK ) val =ilog2 (plane->state->rotation &DRM_ROTATE_MASK ) <<LAYER_ROT_OFFSET ; -if (plane->state->rotation &BIT (DRM_REFLECT_X )) +if (plane->state->rotation &DRM_REFLECT_X ) val |=LAYER_V_FLIP ; -if (plane->state->rotation &BIT (DRM_REFLECT_Y )) +if (plane->state->rotation &DRM_REFLECT_Y ) val |=LAYER_H_FLIP ;/* set the 'enable layer' bit */
@@ -255,12 +255,12 @@ int malidp_de_planes_init(struct drm_device *drm) goto cleanup;if (!drm->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) | -BIT (DRM_REFLECT_Y ); +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); }
@@ -268,7 +268,7 @@ int malidp_de_planes_init(struct drm_device *drm)if (drm->mode_config.rotation_property && (id !=DE_SMART ))drm_object_attach_property (&plane->base.base, drm->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );drm_plane_helper_add (&plane->base, &malidp_de_plane_helper_funcs);
drivers/gpu/drm/armada/armada_overlay.c +1 -1
@@ -121,7 +121,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,int ret; ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)return ret;
drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +11 -11
@@ -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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )))) + (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ))) 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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { tmp = state->crtc_w; state->crtc_w = state->crtc_h; state->crtc_h = tmp;
@@ -677,7 +677,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,return -EINVAL ;switch (state->base.rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : offset = ((y_offset + state->src_y + patched_src_w -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x) / xdiv) *
@@ -686,7 +686,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, fb->pitches[i]; state->pstride[i] = -fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : offset = ((y_offset + state->src_y + patched_src_h -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_w - 1) /
@@ -695,7 +695,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, state->bpp[i]) - fb->pitches[i]; state->pstride[i] =-2 * state->bpp[i];break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_h - 1) /
@@ -705,7 +705,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, (2 * state->bpp[i]); state->pstride[i] = fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :default : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i];
@@ -905,7 +905,7 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,if (desc->layout.xstride && desc->layout.pstride)drm_object_attach_property (&plane->base.base, plane->base.dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );if (desc->layout.csc) {/*
@@ -1056,10 +1056,10 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 )); +DRM_ROTATE_0 | +DRM_ROTATE_90 | +DRM_ROTATE_180 | +DRM_ROTATE_270 );if (!dev->mode_config.rotation_property)return ERR_PTR (-ENOMEM );
drivers/gpu/drm/drm_atomic_helper.c +2 -2
@@ -2348,7 +2348,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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (primary_state->rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { primary_state->src_w = vdisplay <<16 ; primary_state->src_h = hdisplay <<16 ; }else {
@@ -3032,7 +3032,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)if (plane->state) { plane->state->plane = plane; - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; } }EXPORT_SYMBOL (drm_atomic_helper_plane_reset);
drivers/gpu/drm/drm_crtc.c +12 -12
@@ -2804,8 +2804,8 @@ 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 & (BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_270 ))) + crtc->primary->state->rotation & (DRM_ROTATE_90 | +DRM_ROTATE_270 ))swap (hdisplay, vdisplay); return check_src_coords(x << 16, y << 16,
@@ -5646,9 +5646,9 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,* Eg. if the hardware supports everything except DRM_REFLECT_X * one could call this function like this: * -* drm_rotation_simplify(rotation, BIT(DRM_ROTATE_0) | -* BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_180) | -* BIT(DRM_ROTATE_270) | BIT(DRM_REFLECT_Y)); +* drm_rotation_simplify(rotation, DRM_ROTATE_0 | +* DRM_ROTATE_90 | DRM_ROTATE_180 | +* DRM_ROTATE_270 | DRM_REFLECT_Y); * * to eliminate the DRM_ROTATE_X flag. Depending on what kind of * transforms the hardware supports, this function may not
@@ -5659,7 +5659,7 @@ unsigned int drm_rotation_simplify(unsigned int rotation, unsigned int supported_rotations) {if (rotation & ~supported_rotations) { - rotation ^=BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ); + rotation ^=DRM_REFLECT_X |DRM_REFLECT_Y ; rotation = (rotation &DRM_REFLECT_MASK ) |BIT ((ffs (rotation &DRM_ROTATE_MASK ) +1 ) %4 ); }
@@ -5788,12 +5788,12 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, unsigned int supported_rotations) {static const struct drm_prop_enum_list props[] = { - {DRM_ROTATE_0 ,"rotate-0" }, - {DRM_ROTATE_90 ,"rotate-90" }, - {DRM_ROTATE_180 ,"rotate-180" }, - {DRM_ROTATE_270 ,"rotate-270" }, - {DRM_REFLECT_X ,"reflect-x" }, - {DRM_REFLECT_Y ,"reflect-y" }, + {__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",
drivers/gpu/drm/drm_fb_helper.c +2 -2
@@ -335,7 +335,7 @@ retry: goto fail; } - plane_state->rotation =BIT (DRM_ROTATE_0 ); + plane_state->rotation =DRM_ROTATE_0 ; plane->old_fb = plane->fb; plane_mask |=1 <<drm_plane_index (plane);
@@ -395,7 +395,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)if (dev->mode_config.rotation_property) {drm_mode_plane_set_obj_prop (plane, dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 ); } }
drivers/gpu/drm/drm_plane_helper.c +1 -1
@@ -274,7 +274,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, false, &visible);
drivers/gpu/drm/drm_rect.c +14 -14
@@ -317,38 +317,38 @@ void drm_rect_rotate(struct drm_rect *r, {struct drm_rect tmp; -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; } }switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2; r->y1 = width - tmp.x2; r->y2 = width - tmp.x1;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = height - tmp.y2; r->x2 = height - tmp.y1;
@@ -392,23 +392,23 @@ void drm_rect_rotate_inv(struct drm_rect *r,struct drm_rect tmp;switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = width - tmp.y2; r->x2 = width - tmp.y1; r->y1 = tmp.x1; r->y2 = tmp.x2;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2;
@@ -419,15 +419,15 @@ void drm_rect_rotate_inv(struct drm_rect *r,break ; } -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; }
drivers/gpu/drm/i915/i915_debugfs.c +6 -6
@@ -3081,12 +3081,12 @@ static const char *plane_rotation(unsigned int rotation)*/ snprintf (buf,sizeof (buf),"%s%s%s%s%s%s(0x%08x)" , - (rotation &BIT (DRM_ROTATE_0 )) ?"0 " :"" , - (rotation &BIT (DRM_ROTATE_90 )) ?"90 " :"" , - (rotation &BIT (DRM_ROTATE_180 )) ?"180 " :"" , - (rotation &BIT (DRM_ROTATE_270 )) ?"270 " :"" , - (rotation &BIT (DRM_REFLECT_X )) ?"FLIPX " :"" , - (rotation &BIT (DRM_REFLECT_Y )) ?"FLIPY " :"" , + (rotation &DRM_ROTATE_0 ) ?"0 " :"" , + (rotation &DRM_ROTATE_90 ) ?"90 " :"" , + (rotation &DRM_ROTATE_180 ) ?"180 " :"" , + (rotation &DRM_ROTATE_270 ) ?"270 " :"" , + (rotation &DRM_REFLECT_X ) ?"FLIPX " :"" , + (rotation &DRM_REFLECT_Y ) ?"FLIPY " :"" , rotation);return buf;
drivers/gpu/drm/i915/intel_atomic_plane.c +1 -1
@@ -55,7 +55,7 @@ intel_create_plane_state(struct drm_plane *plane)return NULL ; state->base.plane = plane; - state->base.rotation =BIT (DRM_ROTATE_0 ); + state->base.rotation =DRM_ROTATE_0 ; state->ckey.flags =I915_SET_COLORKEY_NONE ;return state;
drivers/gpu/drm/i915/intel_display.c +14 -14
@@ -2688,7 +2688,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset = linear_offset; } -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (crtc_state->pipe_src_w -1 );
@@ -2791,7 +2791,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,intel_compute_tile_offset (&x, &y, fb,0 , fb->pitches[0 ], rotation); linear_offset -= intel_crtc->dspaddr_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {
@@ -2952,17 +2952,17 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)u32 skl_plane_ctl_rotation (unsigned int rotation) {switch (rotation) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ;/* * DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr * while i915 HW rotation is clockwise, thats why this swapping. */ -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 :return PLANE_CTL_ROTATE_270 ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 :return PLANE_CTL_ROTATE_180 ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 :return PLANE_CTL_ROTATE_90 ;default :MISSING_CASE (rotation);
@@ -4248,7 +4248,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state) intel_crtc->pipe, SKL_CRTC_INDEX);return skl_update_scaler (state, !state->base.active,SKL_CRTC_INDEX , - &state->scaler_state.scaler_id,BIT (DRM_ROTATE_0 ), + &state->scaler_state.scaler_id,DRM_ROTATE_0 , state->pipe_src_w, state->pipe_src_h, adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay); }
@@ -10255,7 +10255,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 ==BIT (DRM_ROTATE_180 )) +if (plane_state->base.rotation ==DRM_ROTATE_180 ) cntl |=CURSOR_ROTATE_180 ; }
@@ -10301,7 +10301,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && - plane_state->base.rotation ==BIT (DRM_ROTATE_180 )) { + plane_state->base.rotation ==DRM_ROTATE_180 ) { base += (plane_state->base.crtc_h * plane_state->base.crtc_w -1 ) *4 ; }
@@ -14296,11 +14296,11 @@ fail:void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane) {if (!dev->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 ); +unsigned long flags =DRM_ROTATE_0 | +DRM_ROTATE_180 ;if (INTEL_INFO (dev)->gen >=9 ) - flags |=BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ); + flags |=DRM_ROTATE_90 |DRM_ROTATE_270 ; dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, flags);
@@ -14443,8 +14443,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); +DRM_ROTATE_0 | +DRM_ROTATE_180 );if (dev->mode_config.rotation_property) drm_object_attach_property(&cursor->base.base, dev->mode_config.rotation_property,
drivers/gpu/drm/i915/intel_drv.h +1 -1
@@ -1258,7 +1258,7 @@ unsigned int intel_tile_height(const struct drm_i915_private *dev_priv,static inline bool intel_rotation_90_or_270 (unsigned int rotation) { -return rotation & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )); +return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); } void intel_create_rotation_property(struct drm_device *dev,
drivers/gpu/drm/i915/intel_fbc.c +1 -1
@@ -775,7 +775,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)return false; }if (INTEL_INFO (dev_priv)->gen <=4 && !IS_G4X (dev_priv) && - cache->plane.rotation !=BIT (DRM_ROTATE_0 )) { + cache->plane.rotation !=DRM_ROTATE_0 ) { fbc->no_fbc_reason ="rotation unsupported" ;return false; }
drivers/gpu/drm/i915/intel_fbdev.c +3 -3
@@ -223,7 +223,7 @@ static int intelfb_create(struct drm_fb_helper *helper,* This also validates that any existing fb inherited from the * BIOS is suitable for own access. */ - ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); + ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );if (ret) goto out_unlock;
@@ -289,7 +289,7 @@ static int intelfb_create(struct drm_fb_helper *helper, out_destroy_fbi:drm_fb_helper_release_fbi (helper); out_unpin: -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 ); out_unlock:mutex_unlock (&dev->struct_mutex);return ret;
@@ -554,7 +554,7 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)if (ifbdev->fb) {mutex_lock (&ifbdev->helper.dev->struct_mutex); -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );mutex_unlock (&ifbdev->helper.dev->struct_mutex);drm_framebuffer_remove (&ifbdev->fb->base);
drivers/gpu/drm/i915/intel_sprite.c +3 -3
@@ -444,7 +444,7 @@ vlv_update_plane(struct drm_plane *dplane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SP_ROTATE_180 ; x += src_w;
@@ -577,7 +577,7 @@ ivb_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */
@@ -714,7 +714,7 @@ ilk_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= dvssurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dvscntr |=DVS_ROTATE_180 ; x += src_w;
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +5 -5
@@ -78,7 +78,7 @@ 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, -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property) drm_object_attach_property(&plane->base,
@@ -309,8 +309,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - hflip = !!(state->rotation &BIT (DRM_REFLECT_X )); - vflip = !!(state->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(state->rotation &DRM_REFLECT_X ); + vflip = !!(state->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,
@@ -743,8 +743,8 @@ 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 &BIT (DRM_REFLECT_X )); - vflip = !!(pstate->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(pstate->rotation &DRM_REFLECT_X ); + vflip = !!(pstate->rotation &DRM_REFLECT_Y );spin_lock_irqsave (&mdp5_plane->pipe_lock, flags);
drivers/gpu/drm/omapdrm/omap_drv.c +3 -3
@@ -295,9 +295,9 @@ static int omap_modeset_init_properties(struct drm_device *dev)if (priv->has_dmm) { dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) |BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) |BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 | +DRM_REFLECT_X |DRM_REFLECT_Y );if (!dev->mode_config.rotation_property)return -ENOMEM ; }
drivers/gpu/drm/omapdrm/omap_fb.c +7 -7
@@ -179,24 +179,24 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, (uint32_t)win->rotation);/* fallthru to default to no rotation */ case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 : orient =0 ;break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : orient =MASK_XY_FLIP |MASK_X_INVERT ;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : orient =MASK_X_INVERT |MASK_Y_INVERT ;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : orient =MASK_XY_FLIP |MASK_Y_INVERT ;break ; } -if (win->rotation &BIT (DRM_REFLECT_X )) +if (win->rotation &DRM_REFLECT_X ) orient ^=MASK_X_INVERT ; -if (win->rotation &BIT (DRM_REFLECT_Y )) +if (win->rotation &DRM_REFLECT_Y ) orient ^=MASK_Y_INVERT ;/* adjust x,y offset for flip/invert: */
@@ -213,7 +213,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, }else {switch (win->rotation &DRM_ROTATE_MASK ) {case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :/* OK */ break ;
drivers/gpu/drm/omapdrm/omap_plane.c +5 -5
@@ -109,8 +109,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, win.src_y = state->src_y >>16 ;switch (state->rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_90 : +case DRM_ROTATE_270 : win.src_w = state->src_h >>16 ; win.src_h = state->src_w >>16 ;break ;
@@ -149,7 +149,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane,struct omap_plane_state *omap_state =to_omap_plane_state (plane->state);struct omap_plane *omap_plane =to_omap_plane (plane); - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id;
@@ -178,7 +178,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,return -EINVAL ;if (state->fb) { -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && !omap_framebuffer_supports_rotation (state->fb))return -EINVAL ; }
@@ -269,7 +269,7 @@ static void omap_plane_reset(struct drm_plane *plane)*/ omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id; - omap_state->base.rotation =BIT (DRM_ROTATE_0 ); + omap_state->base.rotation =DRM_ROTATE_0 ; plane->state = &omap_state->base; plane->state->plane = plane;
include/drm/drm_crtc.h +9 -8
@@ -83,14 +83,15 @@ static inline uint64_t I642U64(int64_t val)* specified amount in degrees in counter clockwise direction. DRM_REFLECT_X and * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation */ -#define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3 -#define DRM_REFLECT_MASK (~DRM_ROTATE_MASK) -#define DRM_REFLECT_X 4 -#define DRM_REFLECT_Y 5 +#define DRM_ROTATE_0 BIT(0) +#define DRM_ROTATE_90 BIT(1) +#define DRM_ROTATE_180 BIT(2) +#define DRM_ROTATE_270 BIT(3) +#define DRM_ROTATE_MASK (DRM_ROTATE_0 | DRM_ROTATE_90 | \ + DRM_ROTATE_180 | DRM_ROTATE_270) +#define DRM_REFLECT_X BIT(4) +#define DRM_REFLECT_Y BIT(5) +#define DRM_REFLECT_MASK (DRM_REFLECT_X | DRM_REFLECT_Y)enum drm_connector_force {DRM_FORCE_UNSPECIFIED ,
Signature · 1 line
2.5.5
Quoted 5 lines · Joonas Lahtinen
Only property creation uses the rotation as an index, so convert the to figure the index when needed.
v2: Use the new defines to build the
_MASKdefines (Sean)
Quoted 12 lines
Cc David Airlie <[email protected]>Cc Daniel Vetter <[email protected]>Cc Ville Syrjälä <[email protected]>Cc Liviu Dudau <[email protected]>Cc Sean Paul <[email protected]>Acked-by Liviu Dudau <[email protected]>Reviewed-by Ville Syrjälä <[email protected]> (v1)Signed-off-by Joonas Lahtinen <[email protected]>
Thanks for respinning this, Joonas. I've added this to my queue for -misc after the merge window is closed.
Quoted 788 lines
--- drivers/gpu/drm/arm/malidp_drv.h | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 20 +++++++++--------- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 22 +++++++++---------- drivers/gpu/drm/drm_atomic_helper.c | 4 ++-- drivers/gpu/drm/drm_crtc.c | 24 ++++++++++----------- drivers/gpu/drm/drm_fb_helper.c | 4 ++-- drivers/gpu/drm/drm_plane_helper.c | 2 +- drivers/gpu/drm/drm_rect.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/i915_debugfs.c | 12 +++++------ drivers/gpu/drm/i915/intel_atomic_plane.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 2 +- drivers/gpu/drm/i915/intel_fbc.c | 2 +- drivers/gpu/drm/i915/intel_fbdev.c | 6 +++--- drivers/gpu/drm/i915/intel_sprite.c | 6 +++--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 10 ++++----- drivers/gpu/drm/omapdrm/omap_drv.c | 6 +++--- drivers/gpu/drm/omapdrm/omap_fb.c | 14 ++++++------- drivers/gpu/drm/omapdrm/omap_plane.c | 10 ++++----- include/drm/drm_crtc.h | 17 ++++++++------- 21 files changed, 112 insertions(+), 111 deletions(-)drivers/gpu/drm/arm/malidp_drv.h +1
-1@@ -49,6 +49,6 @@ void malidp_de_planes_destroy(struct drm_device *drm);int malidp_crtc_init (struct drm_device *drm);/* often used combination of rotational bits */ -#define MALIDP_ROTATED_MASK (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)) +#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)#endif /* __MALIDP_DRV_H__ */ drivers/gpu/drm/arm/malidp_planes.c +10
-10@@ -108,7 +108,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,return -EINVAL ;/* packed RGB888 / BGR888 can't be rotated or flipped */ -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && (state->fb->pixel_format ==DRM_FORMAT_RGB888 || state->fb->pixel_format ==DRM_FORMAT_BGR888 ))return -EINVAL ;@@ -188,9 +188,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,/* setup the rotation and axis flip bits */ if (plane->state->rotation &DRM_ROTATE_MASK ) val =ilog2 (plane->state->rotation &DRM_ROTATE_MASK ) <<LAYER_ROT_OFFSET ; -if (plane->state->rotation &BIT (DRM_REFLECT_X )) +if (plane->state->rotation &DRM_REFLECT_X ) val |=LAYER_V_FLIP ; -if (plane->state->rotation &BIT (DRM_REFLECT_Y )) +if (plane->state->rotation &DRM_REFLECT_Y ) val |=LAYER_H_FLIP ;/* set the 'enable layer' bit */ @@ -255,12 +255,12 @@ int malidp_de_planes_init(struct drm_device *drm) goto cleanup;if (!drm->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) | -BIT (DRM_REFLECT_Y ); +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); }@@ -268,7 +268,7 @@ int malidp_de_planes_init(struct drm_device *drm)if (drm->mode_config.rotation_property && (id !=DE_SMART ))drm_object_attach_property (&plane->base.base, drm->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );drm_plane_helper_add (&plane->base, &malidp_de_plane_helper_funcs);drivers/gpu/drm/armada/armada_overlay.c +1
-1@@ -121,7 +121,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,int ret; ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)return ret;drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c +11
-11@@ -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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )))) + (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ))) 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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (state->base.rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { tmp = state->crtc_w; state->crtc_w = state->crtc_h; state->crtc_h = tmp;@@ -677,7 +677,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,return -EINVAL ;switch (state->base.rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : offset = ((y_offset + state->src_y + patched_src_w -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x) / xdiv) *@@ -686,7 +686,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, fb->pitches[i]; state->pstride[i] = -fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : offset = ((y_offset + state->src_y + patched_src_h -1 ) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_w - 1) /@@ -695,7 +695,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, state->bpp[i]) - fb->pitches[i]; state->pstride[i] =-2 * state->bpp[i];break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i]; offset += ((x_offset + state->src_x + patched_src_h - 1) /@@ -705,7 +705,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p, (2 * state->bpp[i]); state->pstride[i] = fb->pitches[i] - state->bpp[i];break ; -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :default : offset = ((y_offset + state->src_y) / ydiv) * fb->pitches[i];@@ -905,7 +905,7 @@ static void atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,if (desc->layout.xstride && desc->layout.pstride)drm_object_attach_property (&plane->base.base, plane->base.dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 );if (desc->layout.csc) {/* @@ -1056,10 +1056,10 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) | -BIT (DRM_ROTATE_270 )); +DRM_ROTATE_0 | +DRM_ROTATE_90 | +DRM_ROTATE_180 | +DRM_ROTATE_270 );if (!dev->mode_config.rotation_property)return ERR_PTR (-ENOMEM );drivers/gpu/drm/drm_atomic_helper.c +2
-2@@ -2348,7 +2348,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 & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ))) { +if (primary_state->rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 )) { primary_state->src_w = vdisplay <<16 ; primary_state->src_h = hdisplay <<16 ; }else {@@ -3032,7 +3032,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)if (plane->state) { plane->state->plane = plane; - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; } }EXPORT_SYMBOL (drm_atomic_helper_plane_reset);drivers/gpu/drm/drm_crtc.c +12
-12@@ -2804,8 +2804,8 @@ 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 & (BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_270 ))) + crtc->primary->state->rotation & (DRM_ROTATE_90 | +DRM_ROTATE_270 ))swap (hdisplay, vdisplay); return check_src_coords(x << 16, y << 16,@@ -5646,9 +5646,9 @@ int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,* Eg. if the hardware supports everything except DRM_REFLECT_X * one could call this function like this: * -* drm_rotation_simplify(rotation, BIT(DRM_ROTATE_0) | -* BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_180) | -* BIT(DRM_ROTATE_270) | BIT(DRM_REFLECT_Y)); +* drm_rotation_simplify(rotation, DRM_ROTATE_0 | +* DRM_ROTATE_90 | DRM_ROTATE_180 | +* DRM_ROTATE_270 | DRM_REFLECT_Y); * * to eliminate the DRM_ROTATE_X flag. Depending on what kind of * transforms the hardware supports, this function may not @@ -5659,7 +5659,7 @@ unsigned int drm_rotation_simplify(unsigned int rotation, unsigned int supported_rotations) {if (rotation & ~supported_rotations) { - rotation ^=BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ); + rotation ^=DRM_REFLECT_X |DRM_REFLECT_Y ; rotation = (rotation &DRM_REFLECT_MASK ) |BIT ((ffs (rotation &DRM_ROTATE_MASK ) +1 ) %4 ); }@@ -5788,12 +5788,12 @@ struct drm_property *drm_mode_create_rotation_property(struct drm_device *dev, unsigned int supported_rotations) {static const struct drm_prop_enum_list props[] = { - {DRM_ROTATE_0 ,"rotate-0" }, - {DRM_ROTATE_90 ,"rotate-90" }, - {DRM_ROTATE_180 ,"rotate-180" }, - {DRM_ROTATE_270 ,"rotate-270" }, - {DRM_REFLECT_X ,"reflect-x" }, - {DRM_REFLECT_Y ,"reflect-y" }, + {__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",drivers/gpu/drm/drm_fb_helper.c +2
-2@@ -335,7 +335,7 @@ retry: goto fail; } - plane_state->rotation =BIT (DRM_ROTATE_0 ); + plane_state->rotation =DRM_ROTATE_0 ; plane->old_fb = plane->fb; plane_mask |=1 <<drm_plane_index (plane);@@ -395,7 +395,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)if (dev->mode_config.rotation_property) {drm_mode_plane_set_obj_prop (plane, dev->mode_config.rotation_property, -BIT (DRM_ROTATE_0 )); +DRM_ROTATE_0 ); } }drivers/gpu/drm/drm_plane_helper.c +1
-1@@ -274,7 +274,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, -BIT (DRM_ROTATE_0 ), +DRM_ROTATE_0 ,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, false, &visible);drivers/gpu/drm/drm_rect.c +14
-14@@ -317,38 +317,38 @@ void drm_rect_rotate(struct drm_rect *r, {struct drm_rect tmp; -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; } }switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2; r->y1 = width - tmp.x2; r->y2 = width - tmp.x1;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = height - tmp.y2; r->x2 = height - tmp.y1;@@ -392,23 +392,23 @@ void drm_rect_rotate_inv(struct drm_rect *r,struct drm_rect tmp;switch (rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : tmp = *r; r->x1 = width - tmp.y2; r->x2 = width - tmp.y1; r->y1 = tmp.x1; r->y2 = tmp.x2;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : tmp = *r; r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; r->y1 = height - tmp.y2; r->y2 = height - tmp.y1;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : tmp = *r; r->x1 = tmp.y1; r->x2 = tmp.y2;@@ -419,15 +419,15 @@ void drm_rect_rotate_inv(struct drm_rect *r,break ; } -if (rotation & (BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y ))) { +if (rotation & (DRM_REFLECT_X |DRM_REFLECT_Y )) { tmp = *r; -if (rotation &BIT (DRM_REFLECT_X )) { +if (rotation &DRM_REFLECT_X ) { r->x1 = width - tmp.x2; r->x2 = width - tmp.x1; } -if (rotation &BIT (DRM_REFLECT_Y )) { +if (rotation &DRM_REFLECT_Y ) { r->y1 = height - tmp.y2; r->y2 = height - tmp.y1; }drivers/gpu/drm/i915/i915_debugfs.c +6
-6@@ -3081,12 +3081,12 @@ static const char *plane_rotation(unsigned int rotation)*/ snprintf (buf,sizeof (buf),"%s%s%s%s%s%s(0x%08x)" , - (rotation &BIT (DRM_ROTATE_0 )) ?"0 " :"" , - (rotation &BIT (DRM_ROTATE_90 )) ?"90 " :"" , - (rotation &BIT (DRM_ROTATE_180 )) ?"180 " :"" , - (rotation &BIT (DRM_ROTATE_270 )) ?"270 " :"" , - (rotation &BIT (DRM_REFLECT_X )) ?"FLIPX " :"" , - (rotation &BIT (DRM_REFLECT_Y )) ?"FLIPY " :"" , + (rotation &DRM_ROTATE_0 ) ?"0 " :"" , + (rotation &DRM_ROTATE_90 ) ?"90 " :"" , + (rotation &DRM_ROTATE_180 ) ?"180 " :"" , + (rotation &DRM_ROTATE_270 ) ?"270 " :"" , + (rotation &DRM_REFLECT_X ) ?"FLIPX " :"" , + (rotation &DRM_REFLECT_Y ) ?"FLIPY " :"" , rotation);return buf;drivers/gpu/drm/i915/intel_atomic_plane.c +1
-1@@ -55,7 +55,7 @@ intel_create_plane_state(struct drm_plane *plane)return NULL ; state->base.plane = plane; - state->base.rotation =BIT (DRM_ROTATE_0 ); + state->base.rotation =DRM_ROTATE_0 ; state->ckey.flags =I915_SET_COLORKEY_NONE ;return state;drivers/gpu/drm/i915/intel_display.c +14
-14@@ -2688,7 +2688,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary, intel_crtc->dspaddr_offset = linear_offset; } -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ; x += (crtc_state->pipe_src_w -1 );@@ -2791,7 +2791,7 @@ static void ironlake_update_primary_plane(struct drm_plane *primary,intel_compute_tile_offset (&x, &y, fb,0 , fb->pitches[0 ], rotation); linear_offset -= intel_crtc->dspaddr_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dspcntr |=DISPPLANE_ROTATE_180 ;if (!IS_HASWELL (dev) && !IS_BROADWELL (dev)) {@@ -2952,17 +2952,17 @@ u32 skl_plane_ctl_tiling(uint64_t fb_modifier)u32 skl_plane_ctl_rotation (unsigned int rotation) {switch (rotation) { -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :break ;/* * DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr * while i915 HW rotation is clockwise, thats why this swapping. */ -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 :return PLANE_CTL_ROTATE_270 ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 :return PLANE_CTL_ROTATE_180 ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 :return PLANE_CTL_ROTATE_90 ;default :MISSING_CASE (rotation);@@ -4248,7 +4248,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state) intel_crtc->pipe, SKL_CRTC_INDEX);return skl_update_scaler (state, !state->base.active,SKL_CRTC_INDEX , - &state->scaler_state.scaler_id,BIT (DRM_ROTATE_0 ), + &state->scaler_state.scaler_id,DRM_ROTATE_0 , state->pipe_src_w, state->pipe_src_h, adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay); }@@ -10255,7 +10255,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 ==BIT (DRM_ROTATE_180 )) +if (plane_state->base.rotation ==DRM_ROTATE_180 ) cntl |=CURSOR_ROTATE_180 ; }@@ -10301,7 +10301,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,/* ILK+ do this automagically */ if (HAS_GMCH_DISPLAY (dev) && - plane_state->base.rotation ==BIT (DRM_ROTATE_180 )) { + plane_state->base.rotation ==DRM_ROTATE_180 ) { base += (plane_state->base.crtc_h * plane_state->base.crtc_w -1 ) *4 ; }@@ -14296,11 +14296,11 @@ fail:void intel_create_rotation_property (struct drm_device *dev,struct intel_plane *plane) {if (!dev->mode_config.rotation_property) { -unsigned long flags =BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 ); +unsigned long flags =DRM_ROTATE_0 | +DRM_ROTATE_180 ;if (INTEL_INFO (dev)->gen >=9 ) - flags |=BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 ); + flags |=DRM_ROTATE_90 |DRM_ROTATE_270 ; dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, flags);@@ -14443,8 +14443,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,if (!dev->mode_config.rotation_property) dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) | -BIT (DRM_ROTATE_180 )); +DRM_ROTATE_0 | +DRM_ROTATE_180 );if (dev->mode_config.rotation_property) drm_object_attach_property(&cursor->base.base, dev->mode_config.rotation_property,drivers/gpu/drm/i915/intel_drv.h +1
-1@@ -1258,7 +1258,7 @@ unsigned int intel_tile_height(const struct drm_i915_private *dev_priv,static inline bool intel_rotation_90_or_270 (unsigned int rotation) { -return rotation & (BIT (DRM_ROTATE_90 ) |BIT (DRM_ROTATE_270 )); +return rotation & (DRM_ROTATE_90 |DRM_ROTATE_270 ); } void intel_create_rotation_property(struct drm_device *dev,drivers/gpu/drm/i915/intel_fbc.c +1
-1@@ -775,7 +775,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)return false; }if (INTEL_INFO (dev_priv)->gen <=4 && !IS_G4X (dev_priv) && - cache->plane.rotation !=BIT (DRM_ROTATE_0 )) { + cache->plane.rotation !=DRM_ROTATE_0 ) { fbc->no_fbc_reason ="rotation unsupported" ;return false; }drivers/gpu/drm/i915/intel_fbdev.c +3
-3@@ -223,7 +223,7 @@ static int intelfb_create(struct drm_fb_helper *helper,* This also validates that any existing fb inherited from the * BIOS is suitable for own access. */ - ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); + ret =intel_pin_and_fence_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );if (ret) goto out_unlock;@@ -289,7 +289,7 @@ static int intelfb_create(struct drm_fb_helper *helper, out_destroy_fbi:drm_fb_helper_release_fbi (helper); out_unpin: -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 ); out_unlock:mutex_unlock (&dev->struct_mutex);return ret;@@ -554,7 +554,7 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)if (ifbdev->fb) {mutex_lock (&ifbdev->helper.dev->struct_mutex); -intel_unpin_fb_obj (&ifbdev->fb->base,BIT (DRM_ROTATE_0 )); +intel_unpin_fb_obj (&ifbdev->fb->base,DRM_ROTATE_0 );mutex_unlock (&ifbdev->helper.dev->struct_mutex);drm_framebuffer_remove (&ifbdev->fb->base);drivers/gpu/drm/i915/intel_sprite.c +3
-3@@ -444,7 +444,7 @@ vlv_update_plane(struct drm_plane *dplane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SP_ROTATE_180 ; x += src_w;@@ -577,7 +577,7 @@ ivb_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= sprsurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { sprctl |=SPRITE_ROTATE_180 ;/* HSW and BDW does this automagically in hardware */ @@ -714,7 +714,7 @@ ilk_update_plane(struct drm_plane *plane, fb->pitches[0], rotation); linear_offset -= dvssurf_offset; -if (rotation ==BIT (DRM_ROTATE_180 )) { +if (rotation ==DRM_ROTATE_180 ) { dvscntr |=DVS_ROTATE_180 ; x += src_w;drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +5
-5@@ -78,7 +78,7 @@ 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, -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_REFLECT_X |DRM_REFLECT_Y );if (dev->mode_config.rotation_property) drm_object_attach_property(&plane->base,@@ -309,8 +309,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - hflip = !!(state->rotation &BIT (DRM_REFLECT_X )); - vflip = !!(state->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(state->rotation &DRM_REFLECT_X ); + vflip = !!(state->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,@@ -743,8 +743,8 @@ 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 &BIT (DRM_REFLECT_X )); - vflip = !!(pstate->rotation &BIT (DRM_REFLECT_Y )); + hflip = !!(pstate->rotation &DRM_REFLECT_X ); + vflip = !!(pstate->rotation &DRM_REFLECT_Y );spin_lock_irqsave (&mdp5_plane->pipe_lock, flags);drivers/gpu/drm/omapdrm/omap_drv.c +3
-3@@ -295,9 +295,9 @@ static int omap_modeset_init_properties(struct drm_device *dev)if (priv->has_dmm) { dev->mode_config.rotation_property =drm_mode_create_rotation_property (dev, -BIT (DRM_ROTATE_0 ) |BIT (DRM_ROTATE_90 ) | -BIT (DRM_ROTATE_180 ) |BIT (DRM_ROTATE_270 ) | -BIT (DRM_REFLECT_X ) |BIT (DRM_REFLECT_Y )); +DRM_ROTATE_0 |DRM_ROTATE_90 | +DRM_ROTATE_180 |DRM_ROTATE_270 | +DRM_REFLECT_X |DRM_REFLECT_Y );if (!dev->mode_config.rotation_property)return -ENOMEM ; }drivers/gpu/drm/omapdrm/omap_fb.c +7
-7@@ -179,24 +179,24 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, (uint32_t)win->rotation);/* fallthru to default to no rotation */ case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 : orient =0 ;break ; -case BIT (DRM_ROTATE_90 ): +case DRM_ROTATE_90 : orient =MASK_XY_FLIP |MASK_X_INVERT ;break ; -case BIT (DRM_ROTATE_180 ): +case DRM_ROTATE_180 : orient =MASK_X_INVERT |MASK_Y_INVERT ;break ; -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_270 : orient =MASK_XY_FLIP |MASK_Y_INVERT ;break ; } -if (win->rotation &BIT (DRM_REFLECT_X )) +if (win->rotation &DRM_REFLECT_X ) orient ^=MASK_X_INVERT ; -if (win->rotation &BIT (DRM_REFLECT_Y )) +if (win->rotation &DRM_REFLECT_Y ) orient ^=MASK_Y_INVERT ;/* adjust x,y offset for flip/invert: */ @@ -213,7 +213,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb, }else {switch (win->rotation &DRM_ROTATE_MASK ) {case 0 : -case BIT (DRM_ROTATE_0 ): +case DRM_ROTATE_0 :/* OK */ break ;drivers/gpu/drm/omapdrm/omap_plane.c +5
-5@@ -109,8 +109,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane, win.src_y = state->src_y >>16 ;switch (state->rotation &DRM_ROTATE_MASK ) { -case BIT (DRM_ROTATE_90 ): -case BIT (DRM_ROTATE_270 ): +case DRM_ROTATE_90 : +case DRM_ROTATE_270 : win.src_w = state->src_h >>16 ; win.src_h = state->src_w >>16 ;break ;@@ -149,7 +149,7 @@ static void omap_plane_atomic_disable(struct drm_plane *plane,struct omap_plane_state *omap_state =to_omap_plane_state (plane->state);struct omap_plane *omap_plane =to_omap_plane (plane); - plane->state->rotation =BIT (DRM_ROTATE_0 ); + plane->state->rotation =DRM_ROTATE_0 ; omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id;@@ -178,7 +178,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,return -EINVAL ;if (state->fb) { -if (state->rotation !=BIT (DRM_ROTATE_0 ) && +if (state->rotation !=DRM_ROTATE_0 && !omap_framebuffer_supports_rotation (state->fb))return -EINVAL ; }@@ -269,7 +269,7 @@ static void omap_plane_reset(struct drm_plane *plane)*/ omap_state->zorder = plane->type ==DRM_PLANE_TYPE_PRIMARY ?0 : omap_plane->id; - omap_state->base.rotation =BIT (DRM_ROTATE_0 ); + omap_state->base.rotation =DRM_ROTATE_0 ; plane->state = &omap_state->base; plane->state->plane = plane;include/drm/drm_crtc.h +9
-8@@ -83,14 +83,15 @@ static inline uint64_t I642U64(int64_t val)* specified amount in degrees in counter clockwise direction. DRM_REFLECT_X and * DRM_REFLECT_Y reflects the image along the specified axis prior to rotation */ -#define DRM_ROTATE_MASK 0x0f -#define DRM_ROTATE_0 0 -#define DRM_ROTATE_90 1 -#define DRM_ROTATE_180 2 -#define DRM_ROTATE_270 3 -#define DRM_REFLECT_MASK (~DRM_ROTATE_MASK) -#define DRM_REFLECT_X 4 -#define DRM_REFLECT_Y 5 +#define DRM_ROTATE_0 BIT(0) +#define DRM_ROTATE_90 BIT(1) +#define DRM_ROTATE_180 BIT(2) +#define DRM_ROTATE_270 BIT(3) +#define DRM_ROTATE_MASK (DRM_ROTATE_0 | DRM_ROTATE_90 | \ + DRM_ROTATE_180 | DRM_ROTATE_270) +#define DRM_REFLECT_X BIT(4) +#define DRM_REFLECT_Y BIT(5) +#define DRM_REFLECT_MASK (DRM_REFLECT_X | DRM_REFLECT_Y)enum drm_connector_force {DRM_FORCE_UNSPECIFIED ,Signature · 6 lines
2.5.5 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Ro.CI.BAT: failure for drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_? (rev3)
In reply to Joonas Lahtinen== Series Details ==
== Series Details ==
Series: drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_? (rev3)
URL : https://patchwork.freedesktop.org/series/10229/
State : failure
== Summary ==
Series 10229v3 drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
http://patchwork.freedesktop.org/api/1.0/series/10229/revisions/3/mbox
Test drv_module_reload_basic:
skip -> PASS (ro-ivb-i7-3770)
skip -> PASS (ro-skl3-i5-6260u)
Test gem_exec_suspend:
Subgroup basic-s3:
pass -> INCOMPLETE (fi-skl-i5-6260u)
pass -> INCOMPLETE (fi-skl-i7-6700k)
Test kms_cursor_legacy:
Subgroup basic-cursor-vs-flip-legacy:
fail -> PASS (ro-ilk1-i5-650)
Subgroup basic-cursor-vs-flip-varying-size:
pass -> FAIL (ro-ilk1-i5-650)
Subgroup basic-flip-vs-cursor-varying-size:
fail -> PASS (ro-snb-i7-2620M)
pass -> FAIL (ro-bdw-i5-5250u)fi-hsw-i7-4770k total:239 pass:217 dwarn:0 dfail:0 fail:0 skip:22 fi-skl-i5-6260u total:107 pass:98 dwarn:0 dfail:0 fail:0 skip:8 fi-skl-i7-6700k total:107 pass:84 dwarn:0 dfail:0 fail:0 skip:22 fi-snb-i7-2600 total:239 pass:197 dwarn:0 dfail:0 fail:0 skip:42 ro-bdw-i5-5250u total:239 pass:218 dwarn:4 dfail:0 fail:1 skip:16 ro-bdw-i7-5557U total:239 pass:222 dwarn:0 dfail:0 fail:1 skip:16 ro-bdw-i7-5600u total:239 pass:206 dwarn:0 dfail:0 fail:1 skip:32 ro-bsw-n3050 total:239 pass:193 dwarn:0 dfail:0 fail:4 skip:42 ro-hsw-i3-4010u total:239 pass:213 dwarn:0 dfail:0 fail:0 skip:26 ro-hsw-i7-4770r total:239 pass:213 dwarn:0 dfail:0 fail:0 skip:26 ro-ilk-i7-620lm total:239 pass:172 dwarn:1 dfail:0 fail:1 skip:65 ro-ilk1-i5-650 total:234 pass:172 dwarn:0 dfail:0 fail:2 skip:60 ro-ivb-i7-3770 total:239 pass:204 dwarn:0 dfail:0 fail:0 skip:35 ro-ivb2-i7-3770 total:239 pass:208 dwarn:0 dfail:0 fail:0 skip:31 ro-skl3-i5-6260u total:239 pass:221 dwarn:0 dfail:0 fail:4 skip:14 ro-snb-i7-2620M total:239 pass:197 dwarn:0 dfail:0 fail:1 skip:41
Results at /archive/results/CI_IGT_test/RO_Patchwork_1637/
cb7629d drm-intel-nightly: 2016y-07m-28d-11h-02m-33s UTC integration manifest 784b86f drm: BIT(DRM_ROTATE_?) -> DRM_ROTATE_?
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx