[PATCH] drm: Don't oops in drm_calc_timestamping_constants() if drm_vblank_init() wasn't called

Jeff Moyer jmoyer at redhat.com
Thu Nov 12 06:12:43 PST 2015


ville.syrjala at linux.intel.com writes:

> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Seems the crtc helpers call drm_calc_timestamping_constants()
> unconditionally even if the driver didn't initialize vblank support by
> calling drm_vblank_init(). That used to be OK since the constants were
> stored under drm_crtc.
>
> However I broke this with
> commit eba1f35dfe14 ("drm: Move timestamping constants into drm_vblank_crtc")
> when I moved the constants to live inside the drm_vblank_crtc struct
> instead. If drm_vblank_init() isn't called, we don't allocate these
> structures, and so drm_calc_timestamping_constants() will oops.
>
> Fix it by adding a check into drm_calc_timestamping_constants() to see
> if vblank support was initialized at all. And to keep in line with other
> such checks, also toss in a check and warn for the case where vblank
> support was initialized, but the wrong number of crtcs was specified.

That was fast, thanks!  Works for me.

Tested-by: Jeff Moyer <jmoyer at redhat.com>


More information about the dri-devel mailing list