OSDN Git Service

drm_hwcomposer: Make sure we set the active state when doing modesets
authorJohn Stultz <john.stultz@linaro.org>
Tue, 23 Jan 2018 23:16:36 +0000 (15:16 -0800)
committerSean Paul <seanpaul@chromium.org>
Wed, 24 Jan 2018 15:27:17 +0000 (10:27 -0500)
commitb365b792a7373cf09068633b45df178f8a78a67c
treead3f905e9eebbee10d09679d4120b77fc639f25b
parent556bedf2714dcb4e3c46f96e1610ab89c5b54994
drm_hwcomposer: Make sure we set the active state when doing modesets

In trying to use drm_hwcomposer with HiKey/HiKey960 boards, I
found that the crtc wouldn't intitalize and the atomic commit
calls were failing.

I initially chased this down to following check in the kernel
drm_atomic_crtc_check() function failing:

 if (state->event && !state->active && !crtc->state->active) {
     DRM_DEBUG_ATOMIC("[CRTC:%d:%s] requesting event but off\n",
                      crtc->base.id, crtc->name);
     return -EINVAL;
 }

Where because a fence was submitted state->event was set, but
the crtc state was not active. This results in the atomic commit
to fail and no mode to be set.

After hacking around this in the kernel, Sean Paul helped me
understand that it was the kernel complaining about the crtc
state being provided in the atomic commit which did not have the
active flag set.

Thus, the proper fix is to make sure when we do the modesetting
that we also set the crtc state active flag in property set.

With this change, the kernel no longer rejects the atomic commit
and the crtc initializes properly.

Cc: Marissa Wall <marissaw@google.com>
Cc: Sean Paul <seanpaul@google.com>
Cc: Dmitry Shmidt <dimitrysh@google.com>
Cc: Robert Foss <robert.foss@collabora.com>
Cc: Matt Szczesiak <matt.szczesiak@arm.com>
Cc: Liviu Dudau <Liviu.Dudau@arm.com>
Cc: David Hanna <david.hanna11@gmail.com>
Cc: Rob Herring <rob.herring@linaro.org>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drmdisplaycompositor.cpp