All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sean Paul <seanpaul@chromium.org>
To: John Stultz <john.stultz@linaro.org>
Cc: Rob Herring <rob.herring@linaro.org>,
	Matt Szczesiak <matt.szczesiak@arm.com>,
	Dmitry Shmidt <dimitrysh@google.com>,
	Sean Paul <seanpaul@google.com>,
	Robert Foss <robert.foss@collabora.com>,
	Liviu Dudau <Liviu.Dudau@arm.com>,
	dri-devel@lists.freedesktop.org,
	Marissa Wall <marissaw@google.com>,
	David Hanna <david.hanna11@gmail.com>
Subject: Re: [RFC][PATCH 1/4 v2] drm_hwcomposer: Make sure we set the active state when doing modesets
Date: Wed, 24 Jan 2018 10:28:22 -0500	[thread overview]
Message-ID: <20180124152822.xvagv3vexehe5hbk@art_vandelay> (raw)
In-Reply-To: <1516749399-29504-2-git-send-email-john.stultz@linaro.org>

On Tue, Jan 23, 2018 at 03:16:36PM -0800, John Stultz wrote:
> 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>

Applied.

Thanks for the patch!

Sean

> ---
>  drmdisplaycompositor.cpp | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/drmdisplaycompositor.cpp b/drmdisplaycompositor.cpp
> index acd13b8..3a20b31 100644
> --- a/drmdisplaycompositor.cpp
> +++ b/drmdisplaycompositor.cpp
> @@ -520,6 +520,13 @@ int DrmDisplayCompositor::CommitFrame(DrmDisplayComposition *display_comp,
>    }
>  
>    if (mode_.needs_modeset) {
> +    ret = drmModeAtomicAddProperty(pset, crtc->id(), crtc->active_property().id(), 1);
> +    if (ret < 0) {
> +      ALOGE("Failed to add crtc active to pset\n");
> +      drmModeAtomicFree(pset);
> +      return ret;
> +    }
> +
>      ret = drmModeAtomicAddProperty(pset, crtc->id(), crtc->mode_property().id(),
>                                     mode_.blob_id) < 0 ||
>            drmModeAtomicAddProperty(pset, connector->id(),
> -- 
> 2.7.4
> 

-- 
Sean Paul, Software Engineer, Google / Chromium OS
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-01-24 15:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23 23:16 [RFC][PATCH 0/4 v2] drm_hwcomposer: Changes to support HiKey/HiKey960 John Stultz
2018-01-23 23:16 ` [RFC][PATCH 1/4 v2] drm_hwcomposer: Make sure we set the active state when doing modesets John Stultz
2018-01-24 15:28   ` Sean Paul [this message]
2018-01-23 23:16 ` [RFC][PATCH 2/4 v2] drm_hwcomposer: Add platformhisi buffer importer for hikey and hikey960 John Stultz
2018-01-24 15:23   ` Sean Paul
2018-01-24 19:05     ` John Stultz
2018-01-24 19:32       ` Rob Herring
2018-01-26 19:29         ` John Stultz
2018-01-29 11:33           ` Robert Foss
2018-01-24 15:46   ` Sean Paul
2018-01-26  5:23     ` John Stultz
2018-01-29 20:02       ` Sean Paul
2018-01-30  6:11         ` John Stultz
2018-01-23 23:16 ` [RFC][PATCH 3/4 v2] drm_hwcomposer: Use client compositing if there is only one plane John Stultz
2018-01-24 14:47   ` Rob Herring
2018-01-23 23:16 ` [RFC][PATCH 4/4 v2] drm_hwcomposer: Try to fallback if GLCompisition fails John Stultz
2018-01-24 15:26   ` Sean Paul
2018-01-24 19:26     ` John Stultz
2018-01-24 19:58       ` Rob Herring
2018-01-31 18:51         ` Alexandru-Cosmin Gheorghe
2018-01-31 19:03           ` John Stultz
2018-02-13  4:43             ` John Stultz
2018-02-13 10:45               ` Alexandru-Cosmin Gheorghe
2018-02-13 22:03                 ` John Stultz
2018-03-07  5:40                   ` John Stultz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180124152822.xvagv3vexehe5hbk@art_vandelay \
    --to=seanpaul@chromium.org \
    --cc=Liviu.Dudau@arm.com \
    --cc=david.hanna11@gmail.com \
    --cc=dimitrysh@google.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=john.stultz@linaro.org \
    --cc=marissaw@google.com \
    --cc=matt.szczesiak@arm.com \
    --cc=rob.herring@linaro.org \
    --cc=robert.foss@collabora.com \
    --cc=seanpaul@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.