Commit 9fe4f5a2 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'imx-drm-fixes-2021-08-18' of git://git.pengutronix.de/pza/linux into drm-fixes

drm/imx: imx-drm alignment and plane offset fixes

Fix an accidental partial revert of commit 94dfec48 ("drm/imx: Add 8
pixel alignment fix") and plane offset calculations for capture of
non-aligned resolutions.
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>

From: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://patchwork.freedesktop.org/patch/msgid/85a41af99beb2c9e7d6020435a135bf9f205a5ff.camel@pengutronix.de
parents 589744db 72fc2752
...@@ -683,7 +683,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane, ...@@ -683,7 +683,7 @@ static void ipu_plane_atomic_update(struct drm_plane *plane,
break; break;
} }
ipu_dmfc_config_wait4eot(ipu_plane->dmfc, drm_rect_width(dst)); ipu_dmfc_config_wait4eot(ipu_plane->dmfc, ALIGN(drm_rect_width(dst), 8));
width = ipu_src_rect_width(new_state); width = ipu_src_rect_width(new_state);
height = drm_rect_height(&new_state->src) >> 16; height = drm_rect_height(&new_state->src) >> 16;
......
...@@ -585,21 +585,21 @@ static const struct ipu_rgb def_bgra_16 = { ...@@ -585,21 +585,21 @@ static const struct ipu_rgb def_bgra_16 = {
.bits_per_pixel = 16, .bits_per_pixel = 16,
}; };
#define Y_OFFSET(pix, x, y) ((x) + pix->width * (y)) #define Y_OFFSET(pix, x, y) ((x) + pix->bytesperline * (y))
#define U_OFFSET(pix, x, y) ((pix->width * pix->height) + \ #define U_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \
(pix->width * ((y) / 2) / 2) + (x) / 2) (pix->bytesperline * ((y) / 2) / 2) + (x) / 2)
#define V_OFFSET(pix, x, y) ((pix->width * pix->height) + \ #define V_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \
(pix->width * pix->height / 4) + \ (pix->bytesperline * pix->height / 4) + \
(pix->width * ((y) / 2) / 2) + (x) / 2) (pix->bytesperline * ((y) / 2) / 2) + (x) / 2)
#define U2_OFFSET(pix, x, y) ((pix->width * pix->height) + \ #define U2_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \
(pix->width * (y) / 2) + (x) / 2) (pix->bytesperline * (y) / 2) + (x) / 2)
#define V2_OFFSET(pix, x, y) ((pix->width * pix->height) + \ #define V2_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \
(pix->width * pix->height / 2) + \ (pix->bytesperline * pix->height / 2) + \
(pix->width * (y) / 2) + (x) / 2) (pix->bytesperline * (y) / 2) + (x) / 2)
#define UV_OFFSET(pix, x, y) ((pix->width * pix->height) + \ #define UV_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \
(pix->width * ((y) / 2)) + (x)) (pix->bytesperline * ((y) / 2)) + (x))
#define UV2_OFFSET(pix, x, y) ((pix->width * pix->height) + \ #define UV2_OFFSET(pix, x, y) ((pix->bytesperline * pix->height) + \
(pix->width * y) + (x)) (pix->bytesperline * y) + (x))
#define NUM_ALPHA_CHANNELS 7 #define NUM_ALPHA_CHANNELS 7
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment