drm: Reorganize drm_pending_event to support future event types [v2]
authorKeith Packard <keithp@keithp.com>
Wed, 5 Jul 2017 21:34:23 +0000 (14:34 -0700)
committerTao Zeng <tao.zeng@amlogic.com>
Tue, 30 Jul 2019 01:52:54 +0000 (18:52 -0700)
commit9c779fb7d59a7073b02645d1435f431992ace934
treeb50367a6424404a0fb2d12ef014f5c34ca879399
parentcb0491f2cab55e0a67a54873119a4a6b457ed7af
drm: Reorganize drm_pending_event to support future event types [v2]

PD#SWPL-4863

Place drm_event_vblank in a new union that includes that and a bare
drm_event structure. This will allow new members of that union to be
added in the future without changing code related to the existing vbl
event type.

Assignments to the crtc_id field are now done when the event is
allocated, rather than when delievered. This way, delivery doesn't
need to have the crtc ID available.

v2:
 * Remove 'dev' argument from create_vblank_event

It wasn't being used anyways, and if we need it in the future,
we can always get it from crtc->dev.

 * Check for MODESETTING before looking for crtc in queue_vblank_event

UMS drivers will oops if we try to get a crtc, so make sure
we're modesetting before we try to find a crtc_id to fill into
the event.

(cherry picked from commit dc695b85fde88eca3ef3b03fcd82f15b6bc6e462)

Change-Id: I6f0feabcba9373fcc434b148752d9cd28bea67e6
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
drivers/gpu/drm/drm_atomic.c
drivers/gpu/drm/drm_crtc.c
drivers/gpu/drm/drm_irq.c
include/drm/drm_crtc.h