Skip to content

Commit b2fb7d1

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 e437e90 commit b2fb7d1

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
@@ -261,11 +261,11 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn,
261261

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

0 commit comments

Comments
 (0)