[PATCH 2/2] drm: get lock before accessing vblank refcount

Li, Yunxiang (Teddy) Yunxiang.Li at amd.com
Tue Sep 6 20:18:30 UTC 2022


[Public]

Hi Daniel,

I added the check because I saw that the refcount was always updated/read with lock held elsewhere, and the pattern looked very similar to in the put e.g. drm_crtc_vblank_reset. This patchset is outdated by now and I've sent a fix to amd-gfx for the specific issue in amdgpu.

However, I think the way drm_crtc_vblank_on/off functions increments the refcount without enabling the vblank is still a bit risky given how many unchecked calls to drm_vblank_get there is elsewhere. Maybe it's more appropriate to simply add an WARN to drm_vblank_get when it's called with inmodeset set? This way the WARN happens right at the problematic point, instead of far into the future when the put is called.

Yunxiang


More information about the dri-devel mailing list