Skip to content

Commit 0605e9d

Browse files
name2965pelwell
authored andcommitted
drm/vc4: txp: fix incorrect width and height check logic in vc4_txp_atomic_check
Since incorrect conditional operator was used in vc4_txp_atomic_check(), the check may be bypassed if only one of the width or height does not match. To prevent this, the conditional operator must be corrected. Fixes: c5d3a57 ("drm/vc4: txp: Add a rotation property to the writeback connector") Signed-off-by: Jeongjun Park <aha310510@gmail.com>
1 parent 4d2358c commit 0605e9d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/vc4/vc4_txp.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn,
262262

263263
fb = conn_state->writeback_job->fb;
264264
if ((conn_state->rotation == DRM_MODE_ROTATE_0 &&
265-
fb->width != crtc_state->mode.hdisplay &&
266-
fb->height != crtc_state->mode.vdisplay) ||
265+
(fb->width != crtc_state->mode.hdisplay ||
266+
fb->height != crtc_state->mode.vdisplay)) ||
267267
(conn_state->rotation == (DRM_MODE_ROTATE_0 | DRM_MODE_TRANSPOSE) &&
268-
fb->width != crtc_state->mode.vdisplay &&
269-
fb->height != crtc_state->mode.hdisplay)) {
268+
(fb->width != crtc_state->mode.vdisplay ||
269+
fb->height != crtc_state->mode.hdisplay))) {
270270
DRM_DEBUG_KMS("Invalid framebuffer size %ux%u vs mode %ux%u\n",
271271
fb->width, fb->height,
272272
crtc_state->mode.hdisplay, crtc_state->mode.vdisplay);

0 commit comments

Comments
 (0)