All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [RESEND PATCH 4/6] drm/i915: Update atomic modeset state synchronously
Date: Mon, 24 Oct 2016 12:43:18 +0200	[thread overview]
Message-ID: <a6a0c306-84ec-06ca-c082-d58040f4315a@linux.intel.com> (raw)
In-Reply-To: <20161024101956.GH4617@intel.com>

Op 24-10-16 om 12:19 schreef Ville Syrjälä:
> On Mon, Oct 24, 2016 at 12:07:30PM +0200, Maarten Lankhorst wrote:
>> Op 21-10-16 om 16:08 schreef Ville Syrjälä:
>>> On Wed, Oct 19, 2016 at 03:55:37PM +0200, Maarten Lankhorst wrote:
>>>> All of this state should be updated as soon as possible. It shouldn't be
>>>> done later because then future updates may not depend on it.
>>>>
>>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>>> ---
>>>>  drivers/gpu/drm/i915/intel_display.c | 15 ++++++++-------
>>>>  1 file changed, 8 insertions(+), 7 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>>>> index 69b9e91f071e..ba7f7be3aa4f 100644
>>>> --- a/drivers/gpu/drm/i915/intel_display.c
>>>> +++ b/drivers/gpu/drm/i915/intel_display.c
>>>> @@ -14341,14 +14341,8 @@ static void intel_atomic_commit_tail(struct drm_atomic_state *state)
>>>>  
>>>>  	drm_atomic_helper_wait_for_dependencies(state);
>>>>  
>>>> -	if (intel_state->modeset) {
>>>> -		memcpy(dev_priv->min_pixclk, intel_state->min_pixclk,
>>>> -		       sizeof(intel_state->min_pixclk));
>>>> -		dev_priv->active_crtcs = intel_state->active_crtcs;
>>>> -		dev_priv->atomic_cdclk_freq = intel_state->cdclk;
>>>> -
>>>> +	if (intel_state->modeset)
>>>>  		intel_display_power_get(dev_priv, POWER_DOMAIN_MODESET);
>>>> -	}
>>>>  
>>>>  	for_each_crtc_in_state(state, crtc, old_crtc_state, i) {
>>>>  		struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
>>>> @@ -14558,6 +14552,13 @@ static int intel_atomic_commit(struct drm_device *dev,
>>>>  	intel_atomic_track_fbs(state);
>>>>  
>>>>  	drm_atomic_state_get(state);
>>>> +	if (intel_state->modeset) {
>>>> +		memcpy(dev_priv->min_pixclk, intel_state->min_pixclk,
>>>> +		       sizeof(intel_state->min_pixclk));
>>>> +		dev_priv->active_crtcs = intel_state->active_crtcs;
>>>> +		dev_priv->atomic_cdclk_freq = intel_state->cdclk;
>>>> +	}
>>>> +
>>> I'm not very happy about this whole intel_atomic_state <-> dev_priv
>>> mess. I think what might be nicer is to have an intel_atomic_device_state
>>> or something, which would be part of the top level atomic state just
>>> like the other states, and we would just a pointer to the current
>>> device state under dev_priv I suppose. This way the top level atomic
>>> state would be more like an atomic transaction thing.
>>>
>> Neither, but I don't see a way to separate it cleanly. The updated members are too random to be put together in a struct.
> What do you mean random? Just not related to each other. That doesn't
> prohibit from collecting them up in a struct. They're already there
> in intel_atomic_state after all.
>
>> And some are used read-only when !modeset, and others are not meant to be used at all in that case. Might even depend
>> on the platform.
> How is one supposed to tell when they're to be used or not?
Outside of modeset I think only intel_atomic_state->cdclk is valid. But only used by skl watermark sanitization. It uses a trick
in which intel_state->active_crtcs is valid too. I think that requirement can be removed though with some small changes. It
looks wrong anyway..

Some more looking shows that the wrong cdclk is used for scaler calculations with !modeset, only matters in the dpms off case.
But that needs fixing too..

~Maarten
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2016-10-24 10:43 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-19 13:55 [RESEND PATCH 0/6] drm/i915: Enable support for nonblocking modeset Maarten Lankhorst
2016-10-19 13:55 ` [RESEND PATCH 1/6] drm/i915: Convert intel_hdmi to use atomic state Maarten Lankhorst
2016-10-21 14:14   ` Ville Syrjälä
2016-10-19 13:55 ` [RESEND PATCH 2/6] drm/i915: Pass atomic state to intel_audio_codec_enable Maarten Lankhorst
2016-10-21 14:04   ` Ville Syrjälä
2016-10-21 14:16     ` Ville Syrjälä
2016-10-24  8:45       ` Maarten Lankhorst
2016-10-24 10:04         ` Ville Syrjälä
2016-10-24 10:12           ` Maarten Lankhorst
2016-10-24 10:17             ` Ville Syrjälä
2016-10-24 10:47               ` Maarten Lankhorst
2016-10-24 11:41                 ` Ville Syrjälä
2016-10-25 11:00                   ` Maarten Lankhorst
2016-10-19 13:55 ` [RESEND PATCH 3/6] drm/edid: Remove drm_select_eld Maarten Lankhorst
2016-10-21 14:05   ` Ville Syrjälä
2016-10-21 14:17     ` Ville Syrjälä
2016-10-24  8:44       ` [Intel-gfx] " Maarten Lankhorst
2016-10-19 13:55 ` [RESEND PATCH 4/6] drm/i915: Update atomic modeset state synchronously Maarten Lankhorst
2016-10-21 14:08   ` Ville Syrjälä
2016-10-24 10:07     ` Maarten Lankhorst
2016-10-24 10:19       ` Ville Syrjälä
2016-10-24 10:43         ` Maarten Lankhorst [this message]
2016-10-21 14:21   ` Ville Syrjälä
2016-10-24  8:47     ` Maarten Lankhorst
2016-10-19 13:55 ` [RESEND PATCH 5/6] drm/i915: Pass atomic state to verify_connector_state Maarten Lankhorst
2016-11-01 13:01   ` Ville Syrjälä
2016-10-19 13:55 ` [RESEND PATCH 6/6] drm/i915: Enable support for nonblocking modeset Maarten Lankhorst
2016-10-19 17:28 ` ✗ Fi.CI.BAT: failure for " Patchwork

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=a6a0c306-84ec-06ca-c082-d58040f4315a@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=ville.syrjala@linux.intel.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.