Skip to content

Commit 76f0544

Browse files
committed
Merge tag 'drm-msm-fixes-2022-06-28' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
Fixes for v5.19-rc5 - Fix to increment vsync_cnt before calling drm_crtc_handle_vblank so that userspace sees the value *after* it is incremented if waiting for vblank events - Fix to reset drm_dev to NULL in dp_display_unbind to avoid a crash in probe/bind error paths - Fix to resolve the smatch error of de-referencing before NULL check in dpu_encoder_phys_wb.c - Fix error return to userspace if fence-id allocation fails in submit ioctl Signed-off-by: Dave Airlie <[email protected]> From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvswNKdd02EYKYv5Zjv7f+mcqeWC7hHQ1SBjqYzN_ZHnA@mail.gmail.com
2 parents 03c765b + 08de214 commit 76f0544

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1251,12 +1251,13 @@ static void dpu_encoder_vblank_callback(struct drm_encoder *drm_enc,
12511251
DPU_ATRACE_BEGIN("encoder_vblank_callback");
12521252
dpu_enc = to_dpu_encoder_virt(drm_enc);
12531253

1254+
atomic_inc(&phy_enc->vsync_cnt);
1255+
12541256
spin_lock_irqsave(&dpu_enc->enc_spinlock, lock_flags);
12551257
if (dpu_enc->crtc)
12561258
dpu_crtc_vblank_callback(dpu_enc->crtc);
12571259
spin_unlock_irqrestore(&dpu_enc->enc_spinlock, lock_flags);
12581260

1259-
atomic_inc(&phy_enc->vsync_cnt);
12601261
DPU_ATRACE_END("encoder_vblank_callback");
12611262
}
12621263

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -252,11 +252,6 @@ static int dpu_encoder_phys_wb_atomic_check(
252252
DPU_DEBUG("[atomic_check:%d, \"%s\",%d,%d]\n",
253253
phys_enc->wb_idx, mode->name, mode->hdisplay, mode->vdisplay);
254254

255-
if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
256-
return 0;
257-
258-
fb = conn_state->writeback_job->fb;
259-
260255
if (!conn_state || !conn_state->connector) {
261256
DPU_ERROR("invalid connector state\n");
262257
return -EINVAL;
@@ -267,6 +262,11 @@ static int dpu_encoder_phys_wb_atomic_check(
267262
return -EINVAL;
268263
}
269264

265+
if (!conn_state->writeback_job || !conn_state->writeback_job->fb)
266+
return 0;
267+
268+
fb = conn_state->writeback_job->fb;
269+
270270
DPU_DEBUG("[fb_id:%u][fb:%u,%u]\n", fb->base.id,
271271
fb->width, fb->height);
272272

drivers/gpu/drm/msm/dp/dp_display.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,8 @@ static void dp_display_unbind(struct device *dev, struct device *master,
316316

317317
dp_power_client_deinit(dp->power);
318318
dp_aux_unregister(dp->aux);
319+
dp->drm_dev = NULL;
320+
dp->aux->drm_dev = NULL;
319321
priv->dp[dp->id] = NULL;
320322
}
321323

drivers/gpu/drm/msm/msm_gem_submit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -928,7 +928,7 @@ int msm_ioctl_gem_submit(struct drm_device *dev, void *data,
928928
INT_MAX, GFP_KERNEL);
929929
}
930930
if (submit->fence_id < 0) {
931-
ret = submit->fence_id = 0;
931+
ret = submit->fence_id;
932932
submit->fence_id = 0;
933933
}
934934

0 commit comments

Comments
 (0)