You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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) Cc: intel-gfx@lists.freedesktop.org Cc: linux-arm-msm@vger.kernel.org Cc: freedreno@lists.freedesktop.org Cc: malidp@foss.arm.com Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Liviu Dudau <Liviu.Dudau@arm.com> Cc: Sean Paul <seanpaul@chromium.org> Acked-by: Liviu Dudau <Liviu.Dudau@arm.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> (v1) Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1469771405-17653-1-git-send-email-joonas.lahtinen@linux.intel.com
This commit is contained in:
committed by
Sean Paul
parent
fcc60b413d
commit
31ad61e4af
@@ -49,6 +49,6 @@ void malidp_de_planes_destroy(struct drm_device *drm);
|
|||||||
int malidp_crtc_init(struct drm_device *drm);
|
int malidp_crtc_init(struct drm_device *drm);
|
||||||
|
|
||||||
/* often used combination of rotational bits */
|
/* 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__ */
|
#endif /* __MALIDP_DRV_H__ */
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* packed RGB888 / BGR888 can't be rotated or flipped */
|
/* 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_RGB888 ||
|
||||||
state->fb->pixel_format == DRM_FORMAT_BGR888))
|
state->fb->pixel_format == DRM_FORMAT_BGR888))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
@@ -188,9 +188,9 @@ static void malidp_de_plane_update(struct drm_plane *plane,
|
|||||||
/* setup the rotation and axis flip bits */
|
/* setup the rotation and axis flip bits */
|
||||||
if (plane->state->rotation & DRM_ROTATE_MASK)
|
if (plane->state->rotation & DRM_ROTATE_MASK)
|
||||||
val = ilog2(plane->state->rotation & DRM_ROTATE_MASK) << LAYER_ROT_OFFSET;
|
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;
|
val |= LAYER_V_FLIP;
|
||||||
if (plane->state->rotation & BIT(DRM_REFLECT_Y))
|
if (plane->state->rotation & DRM_REFLECT_Y)
|
||||||
val |= LAYER_H_FLIP;
|
val |= LAYER_H_FLIP;
|
||||||
|
|
||||||
/* set the 'enable layer' bit */
|
/* set the 'enable layer' bit */
|
||||||
@@ -255,12 +255,12 @@ int malidp_de_planes_init(struct drm_device *drm)
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (!drm->mode_config.rotation_property) {
|
if (!drm->mode_config.rotation_property) {
|
||||||
unsigned long flags = BIT(DRM_ROTATE_0) |
|
unsigned long flags = DRM_ROTATE_0 |
|
||||||
BIT(DRM_ROTATE_90) |
|
DRM_ROTATE_90 |
|
||||||
BIT(DRM_ROTATE_180) |
|
DRM_ROTATE_180 |
|
||||||
BIT(DRM_ROTATE_270) |
|
DRM_ROTATE_270 |
|
||||||
BIT(DRM_REFLECT_X) |
|
DRM_REFLECT_X |
|
||||||
BIT(DRM_REFLECT_Y);
|
DRM_REFLECT_Y;
|
||||||
drm->mode_config.rotation_property =
|
drm->mode_config.rotation_property =
|
||||||
drm_mode_create_rotation_property(drm, flags);
|
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))
|
if (drm->mode_config.rotation_property && (id != DE_SMART))
|
||||||
drm_object_attach_property(&plane->base.base,
|
drm_object_attach_property(&plane->base.base,
|
||||||
drm->mode_config.rotation_property,
|
drm->mode_config.rotation_property,
|
||||||
BIT(DRM_ROTATE_0));
|
DRM_ROTATE_0);
|
||||||
|
|
||||||
drm_plane_helper_add(&plane->base,
|
drm_plane_helper_add(&plane->base,
|
||||||
&malidp_de_plane_helper_funcs);
|
&malidp_de_plane_helper_funcs);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip,
|
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);
|
0, INT_MAX, true, false, &visible);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -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 ||
|
if ((state->base.fb->pixel_format == DRM_FORMAT_YUV422 ||
|
||||||
state->base.fb->pixel_format == DRM_FORMAT_NV61) &&
|
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;
|
cfg |= ATMEL_HLCDC_YUV422ROT;
|
||||||
|
|
||||||
atmel_hlcdc_layer_update_cfg(&plane->layer,
|
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
|
* 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;
|
tmp = state->crtc_w;
|
||||||
state->crtc_w = state->crtc_h;
|
state->crtc_w = state->crtc_h;
|
||||||
state->crtc_h = tmp;
|
state->crtc_h = tmp;
|
||||||
@@ -677,7 +677,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
switch (state->base.rotation & DRM_ROTATE_MASK) {
|
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) /
|
offset = ((y_offset + state->src_y + patched_src_w - 1) /
|
||||||
ydiv) * fb->pitches[i];
|
ydiv) * fb->pitches[i];
|
||||||
offset += ((x_offset + state->src_x) / xdiv) *
|
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];
|
fb->pitches[i];
|
||||||
state->pstride[i] = -fb->pitches[i] - state->bpp[i];
|
state->pstride[i] = -fb->pitches[i] - state->bpp[i];
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_180):
|
case DRM_ROTATE_180:
|
||||||
offset = ((y_offset + state->src_y + patched_src_h - 1) /
|
offset = ((y_offset + state->src_y + patched_src_h - 1) /
|
||||||
ydiv) * fb->pitches[i];
|
ydiv) * fb->pitches[i];
|
||||||
offset += ((x_offset + state->src_x + patched_src_w - 1) /
|
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->bpp[i]) - fb->pitches[i];
|
||||||
state->pstride[i] = -2 * state->bpp[i];
|
state->pstride[i] = -2 * state->bpp[i];
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_270):
|
case DRM_ROTATE_270:
|
||||||
offset = ((y_offset + state->src_y) / ydiv) *
|
offset = ((y_offset + state->src_y) / ydiv) *
|
||||||
fb->pitches[i];
|
fb->pitches[i];
|
||||||
offset += ((x_offset + state->src_x + patched_src_h - 1) /
|
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]);
|
(2 * state->bpp[i]);
|
||||||
state->pstride[i] = fb->pitches[i] - state->bpp[i];
|
state->pstride[i] = fb->pitches[i] - state->bpp[i];
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_0):
|
case DRM_ROTATE_0:
|
||||||
default:
|
default:
|
||||||
offset = ((y_offset + state->src_y) / ydiv) *
|
offset = ((y_offset + state->src_y) / ydiv) *
|
||||||
fb->pitches[i];
|
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)
|
if (desc->layout.xstride && desc->layout.pstride)
|
||||||
drm_object_attach_property(&plane->base.base,
|
drm_object_attach_property(&plane->base.base,
|
||||||
plane->base.dev->mode_config.rotation_property,
|
plane->base.dev->mode_config.rotation_property,
|
||||||
BIT(DRM_ROTATE_0));
|
DRM_ROTATE_0);
|
||||||
|
|
||||||
if (desc->layout.csc) {
|
if (desc->layout.csc) {
|
||||||
/*
|
/*
|
||||||
@@ -1056,10 +1056,10 @@ atmel_hlcdc_plane_create_properties(struct drm_device *dev)
|
|||||||
|
|
||||||
dev->mode_config.rotation_property =
|
dev->mode_config.rotation_property =
|
||||||
drm_mode_create_rotation_property(dev,
|
drm_mode_create_rotation_property(dev,
|
||||||
BIT(DRM_ROTATE_0) |
|
DRM_ROTATE_0 |
|
||||||
BIT(DRM_ROTATE_90) |
|
DRM_ROTATE_90 |
|
||||||
BIT(DRM_ROTATE_180) |
|
DRM_ROTATE_180 |
|
||||||
BIT(DRM_ROTATE_270));
|
DRM_ROTATE_270);
|
||||||
if (!dev->mode_config.rotation_property)
|
if (!dev->mode_config.rotation_property)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
|
|||||||
@@ -2362,7 +2362,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set,
|
|||||||
primary_state->crtc_h = vdisplay;
|
primary_state->crtc_h = vdisplay;
|
||||||
primary_state->src_x = set->x << 16;
|
primary_state->src_x = set->x << 16;
|
||||||
primary_state->src_y = set->y << 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_w = vdisplay << 16;
|
||||||
primary_state->src_h = hdisplay << 16;
|
primary_state->src_h = hdisplay << 16;
|
||||||
} else {
|
} else {
|
||||||
@@ -3047,7 +3047,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)
|
|||||||
|
|
||||||
if (plane->state) {
|
if (plane->state) {
|
||||||
plane->state->plane = plane;
|
plane->state->plane = plane;
|
||||||
plane->state->rotation = BIT(DRM_ROTATE_0);
|
plane->state->rotation = DRM_ROTATE_0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
|
EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
|
||||||
|
|||||||
+12
-12
@@ -2804,8 +2804,8 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc,
|
|||||||
drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
|
drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay);
|
||||||
|
|
||||||
if (crtc->state &&
|
if (crtc->state &&
|
||||||
crtc->primary->state->rotation & (BIT(DRM_ROTATE_90) |
|
crtc->primary->state->rotation & (DRM_ROTATE_90 |
|
||||||
BIT(DRM_ROTATE_270)))
|
DRM_ROTATE_270))
|
||||||
swap(hdisplay, vdisplay);
|
swap(hdisplay, vdisplay);
|
||||||
|
|
||||||
return check_src_coords(x << 16, y << 16,
|
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
|
* Eg. if the hardware supports everything except DRM_REFLECT_X
|
||||||
* one could call this function like this:
|
* one could call this function like this:
|
||||||
*
|
*
|
||||||
* drm_rotation_simplify(rotation, BIT(DRM_ROTATE_0) |
|
* drm_rotation_simplify(rotation, DRM_ROTATE_0 |
|
||||||
* BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_180) |
|
* DRM_ROTATE_90 | DRM_ROTATE_180 |
|
||||||
* BIT(DRM_ROTATE_270) | BIT(DRM_REFLECT_Y));
|
* DRM_ROTATE_270 | DRM_REFLECT_Y);
|
||||||
*
|
*
|
||||||
* to eliminate the DRM_ROTATE_X flag. Depending on what kind of
|
* to eliminate the DRM_ROTATE_X flag. Depending on what kind of
|
||||||
* transforms the hardware supports, this function may not
|
* transforms the hardware supports, this function may not
|
||||||
@@ -5659,7 +5659,7 @@ unsigned int drm_rotation_simplify(unsigned int rotation,
|
|||||||
unsigned int supported_rotations)
|
unsigned int supported_rotations)
|
||||||
{
|
{
|
||||||
if (rotation & ~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) |
|
rotation = (rotation & DRM_REFLECT_MASK) |
|
||||||
BIT((ffs(rotation & DRM_ROTATE_MASK) + 1) % 4);
|
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)
|
unsigned int supported_rotations)
|
||||||
{
|
{
|
||||||
static const struct drm_prop_enum_list props[] = {
|
static const struct drm_prop_enum_list props[] = {
|
||||||
{ DRM_ROTATE_0, "rotate-0" },
|
{ __builtin_ffs(DRM_ROTATE_0) - 1, "rotate-0" },
|
||||||
{ DRM_ROTATE_90, "rotate-90" },
|
{ __builtin_ffs(DRM_ROTATE_90) - 1, "rotate-90" },
|
||||||
{ DRM_ROTATE_180, "rotate-180" },
|
{ __builtin_ffs(DRM_ROTATE_180) - 1, "rotate-180" },
|
||||||
{ DRM_ROTATE_270, "rotate-270" },
|
{ __builtin_ffs(DRM_ROTATE_270) - 1, "rotate-270" },
|
||||||
{ DRM_REFLECT_X, "reflect-x" },
|
{ __builtin_ffs(DRM_REFLECT_X) - 1, "reflect-x" },
|
||||||
{ DRM_REFLECT_Y, "reflect-y" },
|
{ __builtin_ffs(DRM_REFLECT_Y) - 1, "reflect-y" },
|
||||||
};
|
};
|
||||||
|
|
||||||
return drm_property_create_bitmask(dev, 0, "rotation",
|
return drm_property_create_bitmask(dev, 0, "rotation",
|
||||||
|
|||||||
@@ -335,7 +335,7 @@ retry:
|
|||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
plane_state->rotation = BIT(DRM_ROTATE_0);
|
plane_state->rotation = DRM_ROTATE_0;
|
||||||
|
|
||||||
plane->old_fb = plane->fb;
|
plane->old_fb = plane->fb;
|
||||||
plane_mask |= 1 << drm_plane_index(plane);
|
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) {
|
if (dev->mode_config.rotation_property) {
|
||||||
drm_mode_plane_set_obj_prop(plane,
|
drm_mode_plane_set_obj_prop(plane,
|
||||||
dev->mode_config.rotation_property,
|
dev->mode_config.rotation_property,
|
||||||
BIT(DRM_ROTATE_0));
|
DRM_ROTATE_0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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,
|
ret = drm_plane_helper_check_update(plane, crtc, fb,
|
||||||
&src, &dest, &clip,
|
&src, &dest, &clip,
|
||||||
BIT(DRM_ROTATE_0),
|
DRM_ROTATE_0,
|
||||||
DRM_PLANE_HELPER_NO_SCALING,
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
DRM_PLANE_HELPER_NO_SCALING,
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
false, false, &visible);
|
false, false, &visible);
|
||||||
|
|||||||
+14
-14
@@ -317,38 +317,38 @@ void drm_rect_rotate(struct drm_rect *r,
|
|||||||
{
|
{
|
||||||
struct drm_rect tmp;
|
struct drm_rect tmp;
|
||||||
|
|
||||||
if (rotation & (BIT(DRM_REFLECT_X) | BIT(DRM_REFLECT_Y))) {
|
if (rotation & (DRM_REFLECT_X | DRM_REFLECT_Y)) {
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
|
|
||||||
if (rotation & BIT(DRM_REFLECT_X)) {
|
if (rotation & DRM_REFLECT_X) {
|
||||||
r->x1 = width - tmp.x2;
|
r->x1 = width - tmp.x2;
|
||||||
r->x2 = width - tmp.x1;
|
r->x2 = width - tmp.x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rotation & BIT(DRM_REFLECT_Y)) {
|
if (rotation & DRM_REFLECT_Y) {
|
||||||
r->y1 = height - tmp.y2;
|
r->y1 = height - tmp.y2;
|
||||||
r->y2 = height - tmp.y1;
|
r->y2 = height - tmp.y1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (rotation & DRM_ROTATE_MASK) {
|
switch (rotation & DRM_ROTATE_MASK) {
|
||||||
case BIT(DRM_ROTATE_0):
|
case DRM_ROTATE_0:
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_90):
|
case DRM_ROTATE_90:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = tmp.y1;
|
r->x1 = tmp.y1;
|
||||||
r->x2 = tmp.y2;
|
r->x2 = tmp.y2;
|
||||||
r->y1 = width - tmp.x2;
|
r->y1 = width - tmp.x2;
|
||||||
r->y2 = width - tmp.x1;
|
r->y2 = width - tmp.x1;
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_180):
|
case DRM_ROTATE_180:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = width - tmp.x2;
|
r->x1 = width - tmp.x2;
|
||||||
r->x2 = width - tmp.x1;
|
r->x2 = width - tmp.x1;
|
||||||
r->y1 = height - tmp.y2;
|
r->y1 = height - tmp.y2;
|
||||||
r->y2 = height - tmp.y1;
|
r->y2 = height - tmp.y1;
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_270):
|
case DRM_ROTATE_270:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = height - tmp.y2;
|
r->x1 = height - tmp.y2;
|
||||||
r->x2 = height - tmp.y1;
|
r->x2 = height - tmp.y1;
|
||||||
@@ -392,23 +392,23 @@ void drm_rect_rotate_inv(struct drm_rect *r,
|
|||||||
struct drm_rect tmp;
|
struct drm_rect tmp;
|
||||||
|
|
||||||
switch (rotation & DRM_ROTATE_MASK) {
|
switch (rotation & DRM_ROTATE_MASK) {
|
||||||
case BIT(DRM_ROTATE_0):
|
case DRM_ROTATE_0:
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_90):
|
case DRM_ROTATE_90:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = width - tmp.y2;
|
r->x1 = width - tmp.y2;
|
||||||
r->x2 = width - tmp.y1;
|
r->x2 = width - tmp.y1;
|
||||||
r->y1 = tmp.x1;
|
r->y1 = tmp.x1;
|
||||||
r->y2 = tmp.x2;
|
r->y2 = tmp.x2;
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_180):
|
case DRM_ROTATE_180:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = width - tmp.x2;
|
r->x1 = width - tmp.x2;
|
||||||
r->x2 = width - tmp.x1;
|
r->x2 = width - tmp.x1;
|
||||||
r->y1 = height - tmp.y2;
|
r->y1 = height - tmp.y2;
|
||||||
r->y2 = height - tmp.y1;
|
r->y2 = height - tmp.y1;
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_270):
|
case DRM_ROTATE_270:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = tmp.y1;
|
r->x1 = tmp.y1;
|
||||||
r->x2 = tmp.y2;
|
r->x2 = tmp.y2;
|
||||||
@@ -419,15 +419,15 @@ void drm_rect_rotate_inv(struct drm_rect *r,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rotation & (BIT(DRM_REFLECT_X) | BIT(DRM_REFLECT_Y))) {
|
if (rotation & (DRM_REFLECT_X | DRM_REFLECT_Y)) {
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
|
|
||||||
if (rotation & BIT(DRM_REFLECT_X)) {
|
if (rotation & DRM_REFLECT_X) {
|
||||||
r->x1 = width - tmp.x2;
|
r->x1 = width - tmp.x2;
|
||||||
r->x2 = width - tmp.x1;
|
r->x2 = width - tmp.x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rotation & BIT(DRM_REFLECT_Y)) {
|
if (rotation & DRM_REFLECT_Y) {
|
||||||
r->y1 = height - tmp.y2;
|
r->y1 = height - tmp.y2;
|
||||||
r->y2 = height - tmp.y1;
|
r->y2 = height - tmp.y1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3089,12 +3089,12 @@ static const char *plane_rotation(unsigned int rotation)
|
|||||||
*/
|
*/
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"%s%s%s%s%s%s(0x%08x)",
|
"%s%s%s%s%s%s(0x%08x)",
|
||||||
(rotation & BIT(DRM_ROTATE_0)) ? "0 " : "",
|
(rotation & DRM_ROTATE_0) ? "0 " : "",
|
||||||
(rotation & BIT(DRM_ROTATE_90)) ? "90 " : "",
|
(rotation & DRM_ROTATE_90) ? "90 " : "",
|
||||||
(rotation & BIT(DRM_ROTATE_180)) ? "180 " : "",
|
(rotation & DRM_ROTATE_180) ? "180 " : "",
|
||||||
(rotation & BIT(DRM_ROTATE_270)) ? "270 " : "",
|
(rotation & DRM_ROTATE_270) ? "270 " : "",
|
||||||
(rotation & BIT(DRM_REFLECT_X)) ? "FLIPX " : "",
|
(rotation & DRM_REFLECT_X) ? "FLIPX " : "",
|
||||||
(rotation & BIT(DRM_REFLECT_Y)) ? "FLIPY " : "",
|
(rotation & DRM_REFLECT_Y) ? "FLIPY " : "",
|
||||||
rotation);
|
rotation);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ intel_create_plane_state(struct drm_plane *plane)
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
state->base.plane = plane;
|
state->base.plane = plane;
|
||||||
state->base.rotation = BIT(DRM_ROTATE_0);
|
state->base.rotation = DRM_ROTATE_0;
|
||||||
state->ckey.flags = I915_SET_COLORKEY_NONE;
|
state->ckey.flags = I915_SET_COLORKEY_NONE;
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
|
|||||||
@@ -2688,7 +2688,7 @@ static void i9xx_update_primary_plane(struct drm_plane *primary,
|
|||||||
intel_crtc->dspaddr_offset = linear_offset;
|
intel_crtc->dspaddr_offset = linear_offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rotation == BIT(DRM_ROTATE_180)) {
|
if (rotation == DRM_ROTATE_180) {
|
||||||
dspcntr |= DISPPLANE_ROTATE_180;
|
dspcntr |= DISPPLANE_ROTATE_180;
|
||||||
|
|
||||||
x += (crtc_state->pipe_src_w - 1);
|
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,
|
intel_compute_tile_offset(&x, &y, fb, 0,
|
||||||
fb->pitches[0], rotation);
|
fb->pitches[0], rotation);
|
||||||
linear_offset -= intel_crtc->dspaddr_offset;
|
linear_offset -= intel_crtc->dspaddr_offset;
|
||||||
if (rotation == BIT(DRM_ROTATE_180)) {
|
if (rotation == DRM_ROTATE_180) {
|
||||||
dspcntr |= DISPPLANE_ROTATE_180;
|
dspcntr |= DISPPLANE_ROTATE_180;
|
||||||
|
|
||||||
if (!IS_HASWELL(dev) && !IS_BROADWELL(dev)) {
|
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)
|
u32 skl_plane_ctl_rotation(unsigned int rotation)
|
||||||
{
|
{
|
||||||
switch (rotation) {
|
switch (rotation) {
|
||||||
case BIT(DRM_ROTATE_0):
|
case DRM_ROTATE_0:
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
* DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr
|
* DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr
|
||||||
* while i915 HW rotation is clockwise, thats why this swapping.
|
* while i915 HW rotation is clockwise, thats why this swapping.
|
||||||
*/
|
*/
|
||||||
case BIT(DRM_ROTATE_90):
|
case DRM_ROTATE_90:
|
||||||
return PLANE_CTL_ROTATE_270;
|
return PLANE_CTL_ROTATE_270;
|
||||||
case BIT(DRM_ROTATE_180):
|
case DRM_ROTATE_180:
|
||||||
return PLANE_CTL_ROTATE_180;
|
return PLANE_CTL_ROTATE_180;
|
||||||
case BIT(DRM_ROTATE_270):
|
case DRM_ROTATE_270:
|
||||||
return PLANE_CTL_ROTATE_90;
|
return PLANE_CTL_ROTATE_90;
|
||||||
default:
|
default:
|
||||||
MISSING_CASE(rotation);
|
MISSING_CASE(rotation);
|
||||||
@@ -4248,7 +4248,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state)
|
|||||||
intel_crtc->pipe, SKL_CRTC_INDEX);
|
intel_crtc->pipe, SKL_CRTC_INDEX);
|
||||||
|
|
||||||
return skl_update_scaler(state, !state->base.active, 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,
|
state->pipe_src_w, state->pipe_src_h,
|
||||||
adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay);
|
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))
|
if (HAS_DDI(dev))
|
||||||
cntl |= CURSOR_PIPE_CSC_ENABLE;
|
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;
|
cntl |= CURSOR_ROTATE_180;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10309,7 +10309,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
|
|||||||
|
|
||||||
/* ILK+ do this automagically */
|
/* ILK+ do this automagically */
|
||||||
if (HAS_GMCH_DISPLAY(dev) &&
|
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 *
|
base += (plane_state->base.crtc_h *
|
||||||
plane_state->base.crtc_w - 1) * 4;
|
plane_state->base.crtc_w - 1) * 4;
|
||||||
}
|
}
|
||||||
@@ -14306,11 +14306,11 @@ fail:
|
|||||||
void intel_create_rotation_property(struct drm_device *dev, struct intel_plane *plane)
|
void intel_create_rotation_property(struct drm_device *dev, struct intel_plane *plane)
|
||||||
{
|
{
|
||||||
if (!dev->mode_config.rotation_property) {
|
if (!dev->mode_config.rotation_property) {
|
||||||
unsigned long flags = BIT(DRM_ROTATE_0) |
|
unsigned long flags = DRM_ROTATE_0 |
|
||||||
BIT(DRM_ROTATE_180);
|
DRM_ROTATE_180;
|
||||||
|
|
||||||
if (INTEL_INFO(dev)->gen >= 9)
|
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 =
|
dev->mode_config.rotation_property =
|
||||||
drm_mode_create_rotation_property(dev, flags);
|
drm_mode_create_rotation_property(dev, flags);
|
||||||
@@ -14453,8 +14453,8 @@ static struct drm_plane *intel_cursor_plane_create(struct drm_device *dev,
|
|||||||
if (!dev->mode_config.rotation_property)
|
if (!dev->mode_config.rotation_property)
|
||||||
dev->mode_config.rotation_property =
|
dev->mode_config.rotation_property =
|
||||||
drm_mode_create_rotation_property(dev,
|
drm_mode_create_rotation_property(dev,
|
||||||
BIT(DRM_ROTATE_0) |
|
DRM_ROTATE_0 |
|
||||||
BIT(DRM_ROTATE_180));
|
DRM_ROTATE_180);
|
||||||
if (dev->mode_config.rotation_property)
|
if (dev->mode_config.rotation_property)
|
||||||
drm_object_attach_property(&cursor->base.base,
|
drm_object_attach_property(&cursor->base.base,
|
||||||
dev->mode_config.rotation_property,
|
dev->mode_config.rotation_property,
|
||||||
|
|||||||
@@ -1258,7 +1258,7 @@ unsigned int intel_tile_height(const struct drm_i915_private *dev_priv,
|
|||||||
static inline bool
|
static inline bool
|
||||||
intel_rotation_90_or_270(unsigned int rotation)
|
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,
|
void intel_create_rotation_property(struct drm_device *dev,
|
||||||
|
|||||||
@@ -775,7 +775,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (INTEL_INFO(dev_priv)->gen <= 4 && !IS_G4X(dev_priv) &&
|
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";
|
fbc->no_fbc_reason = "rotation unsupported";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -223,7 +223,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
|||||||
* This also validates that any existing fb inherited from the
|
* This also validates that any existing fb inherited from the
|
||||||
* BIOS is suitable for own access.
|
* 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)
|
if (ret)
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
|||||||
out_destroy_fbi:
|
out_destroy_fbi:
|
||||||
drm_fb_helper_release_fbi(helper);
|
drm_fb_helper_release_fbi(helper);
|
||||||
out_unpin:
|
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:
|
out_unlock:
|
||||||
mutex_unlock(&dev->struct_mutex);
|
mutex_unlock(&dev->struct_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
@@ -554,7 +554,7 @@ static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)
|
|||||||
|
|
||||||
if (ifbdev->fb) {
|
if (ifbdev->fb) {
|
||||||
mutex_lock(&ifbdev->helper.dev->struct_mutex);
|
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);
|
mutex_unlock(&ifbdev->helper.dev->struct_mutex);
|
||||||
|
|
||||||
drm_framebuffer_remove(&ifbdev->fb->base);
|
drm_framebuffer_remove(&ifbdev->fb->base);
|
||||||
|
|||||||
@@ -444,7 +444,7 @@ vlv_update_plane(struct drm_plane *dplane,
|
|||||||
fb->pitches[0], rotation);
|
fb->pitches[0], rotation);
|
||||||
linear_offset -= sprsurf_offset;
|
linear_offset -= sprsurf_offset;
|
||||||
|
|
||||||
if (rotation == BIT(DRM_ROTATE_180)) {
|
if (rotation == DRM_ROTATE_180) {
|
||||||
sprctl |= SP_ROTATE_180;
|
sprctl |= SP_ROTATE_180;
|
||||||
|
|
||||||
x += src_w;
|
x += src_w;
|
||||||
@@ -577,7 +577,7 @@ ivb_update_plane(struct drm_plane *plane,
|
|||||||
fb->pitches[0], rotation);
|
fb->pitches[0], rotation);
|
||||||
linear_offset -= sprsurf_offset;
|
linear_offset -= sprsurf_offset;
|
||||||
|
|
||||||
if (rotation == BIT(DRM_ROTATE_180)) {
|
if (rotation == DRM_ROTATE_180) {
|
||||||
sprctl |= SPRITE_ROTATE_180;
|
sprctl |= SPRITE_ROTATE_180;
|
||||||
|
|
||||||
/* HSW and BDW does this automagically in hardware */
|
/* HSW and BDW does this automagically in hardware */
|
||||||
@@ -714,7 +714,7 @@ ilk_update_plane(struct drm_plane *plane,
|
|||||||
fb->pitches[0], rotation);
|
fb->pitches[0], rotation);
|
||||||
linear_offset -= dvssurf_offset;
|
linear_offset -= dvssurf_offset;
|
||||||
|
|
||||||
if (rotation == BIT(DRM_ROTATE_180)) {
|
if (rotation == DRM_ROTATE_180) {
|
||||||
dvscntr |= DVS_ROTATE_180;
|
dvscntr |= DVS_ROTATE_180;
|
||||||
|
|
||||||
x += src_w;
|
x += src_w;
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ static void mdp5_plane_install_rotation_property(struct drm_device *dev,
|
|||||||
if (!dev->mode_config.rotation_property)
|
if (!dev->mode_config.rotation_property)
|
||||||
dev->mode_config.rotation_property =
|
dev->mode_config.rotation_property =
|
||||||
drm_mode_create_rotation_property(dev,
|
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)
|
if (dev->mode_config.rotation_property)
|
||||||
drm_object_attach_property(&plane->base,
|
drm_object_attach_property(&plane->base,
|
||||||
@@ -309,8 +309,8 @@ static int mdp5_plane_atomic_check(struct drm_plane *plane,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
hflip = !!(state->rotation & BIT(DRM_REFLECT_X));
|
hflip = !!(state->rotation & DRM_REFLECT_X);
|
||||||
vflip = !!(state->rotation & BIT(DRM_REFLECT_Y));
|
vflip = !!(state->rotation & DRM_REFLECT_Y);
|
||||||
if ((vflip && !(mdp5_plane->caps & MDP_PIPE_CAP_VFLIP)) ||
|
if ((vflip && !(mdp5_plane->caps & MDP_PIPE_CAP_VFLIP)) ||
|
||||||
(hflip && !(mdp5_plane->caps & MDP_PIPE_CAP_HFLIP))) {
|
(hflip && !(mdp5_plane->caps & MDP_PIPE_CAP_HFLIP))) {
|
||||||
dev_err(plane->dev->dev,
|
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);
|
config |= get_scale_config(format, src_h, crtc_h, false);
|
||||||
DBG("scale config = %x", config);
|
DBG("scale config = %x", config);
|
||||||
|
|
||||||
hflip = !!(pstate->rotation & BIT(DRM_REFLECT_X));
|
hflip = !!(pstate->rotation & DRM_REFLECT_X);
|
||||||
vflip = !!(pstate->rotation & BIT(DRM_REFLECT_Y));
|
vflip = !!(pstate->rotation & DRM_REFLECT_Y);
|
||||||
|
|
||||||
spin_lock_irqsave(&mdp5_plane->pipe_lock, flags);
|
spin_lock_irqsave(&mdp5_plane->pipe_lock, flags);
|
||||||
|
|
||||||
|
|||||||
@@ -295,9 +295,9 @@ static int omap_modeset_init_properties(struct drm_device *dev)
|
|||||||
if (priv->has_dmm) {
|
if (priv->has_dmm) {
|
||||||
dev->mode_config.rotation_property =
|
dev->mode_config.rotation_property =
|
||||||
drm_mode_create_rotation_property(dev,
|
drm_mode_create_rotation_property(dev,
|
||||||
BIT(DRM_ROTATE_0) | BIT(DRM_ROTATE_90) |
|
DRM_ROTATE_0 | DRM_ROTATE_90 |
|
||||||
BIT(DRM_ROTATE_180) | BIT(DRM_ROTATE_270) |
|
DRM_ROTATE_180 | DRM_ROTATE_270 |
|
||||||
BIT(DRM_REFLECT_X) | BIT(DRM_REFLECT_Y));
|
DRM_REFLECT_X | DRM_REFLECT_Y);
|
||||||
if (!dev->mode_config.rotation_property)
|
if (!dev->mode_config.rotation_property)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,24 +179,24 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
|
|||||||
(uint32_t)win->rotation);
|
(uint32_t)win->rotation);
|
||||||
/* fallthru to default to no rotation */
|
/* fallthru to default to no rotation */
|
||||||
case 0:
|
case 0:
|
||||||
case BIT(DRM_ROTATE_0):
|
case DRM_ROTATE_0:
|
||||||
orient = 0;
|
orient = 0;
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_90):
|
case DRM_ROTATE_90:
|
||||||
orient = MASK_XY_FLIP | MASK_X_INVERT;
|
orient = MASK_XY_FLIP | MASK_X_INVERT;
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_180):
|
case DRM_ROTATE_180:
|
||||||
orient = MASK_X_INVERT | MASK_Y_INVERT;
|
orient = MASK_X_INVERT | MASK_Y_INVERT;
|
||||||
break;
|
break;
|
||||||
case BIT(DRM_ROTATE_270):
|
case DRM_ROTATE_270:
|
||||||
orient = MASK_XY_FLIP | MASK_Y_INVERT;
|
orient = MASK_XY_FLIP | MASK_Y_INVERT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (win->rotation & BIT(DRM_REFLECT_X))
|
if (win->rotation & DRM_REFLECT_X)
|
||||||
orient ^= MASK_X_INVERT;
|
orient ^= MASK_X_INVERT;
|
||||||
|
|
||||||
if (win->rotation & BIT(DRM_REFLECT_Y))
|
if (win->rotation & DRM_REFLECT_Y)
|
||||||
orient ^= MASK_Y_INVERT;
|
orient ^= MASK_Y_INVERT;
|
||||||
|
|
||||||
/* adjust x,y offset for flip/invert: */
|
/* adjust x,y offset for flip/invert: */
|
||||||
@@ -213,7 +213,7 @@ void omap_framebuffer_update_scanout(struct drm_framebuffer *fb,
|
|||||||
} else {
|
} else {
|
||||||
switch (win->rotation & DRM_ROTATE_MASK) {
|
switch (win->rotation & DRM_ROTATE_MASK) {
|
||||||
case 0:
|
case 0:
|
||||||
case BIT(DRM_ROTATE_0):
|
case DRM_ROTATE_0:
|
||||||
/* OK */
|
/* OK */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -109,8 +109,8 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
|
|||||||
win.src_y = state->src_y >> 16;
|
win.src_y = state->src_y >> 16;
|
||||||
|
|
||||||
switch (state->rotation & DRM_ROTATE_MASK) {
|
switch (state->rotation & DRM_ROTATE_MASK) {
|
||||||
case BIT(DRM_ROTATE_90):
|
case DRM_ROTATE_90:
|
||||||
case BIT(DRM_ROTATE_270):
|
case DRM_ROTATE_270:
|
||||||
win.src_w = state->src_h >> 16;
|
win.src_w = state->src_h >> 16;
|
||||||
win.src_h = state->src_w >> 16;
|
win.src_h = state->src_w >> 16;
|
||||||
break;
|
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_state *omap_state = to_omap_plane_state(plane->state);
|
||||||
struct omap_plane *omap_plane = to_omap_plane(plane);
|
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
|
omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY
|
||||||
? 0 : omap_plane->id;
|
? 0 : omap_plane->id;
|
||||||
|
|
||||||
@@ -178,7 +178,7 @@ static int omap_plane_atomic_check(struct drm_plane *plane,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (state->fb) {
|
if (state->fb) {
|
||||||
if (state->rotation != BIT(DRM_ROTATE_0) &&
|
if (state->rotation != DRM_ROTATE_0 &&
|
||||||
!omap_framebuffer_supports_rotation(state->fb))
|
!omap_framebuffer_supports_rotation(state->fb))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@@ -269,7 +269,7 @@ static void omap_plane_reset(struct drm_plane *plane)
|
|||||||
*/
|
*/
|
||||||
omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY
|
omap_state->zorder = plane->type == DRM_PLANE_TYPE_PRIMARY
|
||||||
? 0 : omap_plane->id;
|
? 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 = &omap_state->base;
|
||||||
plane->state->plane = plane;
|
plane->state->plane = plane;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user