• Mario Kleiner's avatar
    drm: Prevent invalid use of vblank_disable_immediate. (v2) · 5a8b21b2
    Mario Kleiner authored
    For a kms driver to support immediate disable of vblank
    irq's reliably without introducing off by one errors or
    other mayhem for clients, it must not only support a
    hardware vblank counter query, but also high precision
    vblank timestamping, so vblank count and timestamp can be
    instantaneously reinitialzed to valid values. Additionally
    the exposed hardware counter must behave as if it is
    incrementing at leading edge of vblank to avoid off by
    one errors during reinitialization of the counter while
    the display happens to be inside or close to vblank.
    
    Check during drm_vblank_init that a driver which claims to
    be capable of vblank_disable_immediate at least supports
    high precision timestamping and prevent use of instant
    disable if that isn't present as a minimum requirement.
    
    v2: Changed from DRM_ERROR to DRM_INFO and made message
        more clear, as suggested by Michel Dänzer.
    Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
    Reviewed-by: default avatarMichel Dänzer <michel.daenzer@amd.com>
    Cc: Dave Airlie <airlied@redhat.com>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    5a8b21b2
drm_irq.c 52.5 KB