public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 4/5] drm/i915: Use new atomic iterator macros in display code
Date: Wed, 19 Jul 2017 13:58:33 +0200	[thread overview]
Message-ID: <f2eb1e7e-ade7-745f-361b-6a2a61a781da@linux.intel.com> (raw)
In-Reply-To: <20170316084755.y6e5uzv23o3in2y3@phenom.ffwll.local>

Op 16-03-17 om 09:47 schreef Daniel Vetter:
> On Wed, Mar 15, 2017 at 09:23:30AM +0100, Maarten Lankhorst wrote:
>> Op 14-03-17 om 07:50 schreef Daniel Vetter:
>>> On Mon, Mar 13, 2017 at 12:08:19PM +0100, Maarten Lankhorst wrote:
>>>> Op 13-03-17 om 11:15 schreef Daniel Vetter:
>>>>> On Thu, Mar 09, 2017 at 03:52:04PM +0100, Maarten Lankhorst wrote:
>>>>>> Add a big fat warning in __intel_display_resume that the old state is
>>>>>> invalid, and use the correct state everywhere.
>>>>>>
>>>>>> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
>>>>>> ---
>>>>>>  drivers/gpu/drm/i915/intel_display.c | 161 ++++++++++++++++++-----------------
>>>>> This file is too big. Because it's one big mess this patch here is way too
>>>>> big and one big mess :(
>>>>>
>>>>>>  1 file changed, 82 insertions(+), 79 deletions(-)
>>>>>>
>>>>>> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
>>>>>> index 5526a196e8a2..83f86cf44f66 100644
>>>>>> --- a/drivers/gpu/drm/i915/intel_display.c
>>>>>> +++ b/drivers/gpu/drm/i915/intel_display.c
>>>>>> @@ -3464,7 +3464,12 @@ __intel_display_resume(struct drm_device *dev,
>>>>>>  	if (!state)
>>>>>>  		return 0;
>>>>>>  
>>>>>> -	for_each_crtc_in_state(state, crtc, crtc_state, i) {
>>>>>> +	/*
>>>>>> +	 * We've duplicated the state, pointers to the old state are invalid.
>>>>>> +	 *
>>>>>> +	 * Don't attempt to use the old state until we commit the duplicated state.
>>>>>> +	 */
>>>>>> +	for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
>>>>> Just a drive-by comment, but why exactly do we need this hack? We read out
>>>>> full hw state like on boot-up, assuming our commit machinery computes the
>>>>> diff correctly it should noticed that we have to do a full commit here.
>>>>>
>>>>> Hacks like this imo show that we still have a fairly significant design
>>>>> issue in our fastbook code ...
>>>> We read out the full hw state, but we cannot trust the hw state to be correct. In general when we poke a property we set mode_changed,
>>>> and the fastboot code may downgrade it to a pipe update if it's compatible enough. We only check on mode_changed because not all
>>>> planes and connectors may otherwise be part of the atomic state.
>>> drm_atomic.c doesn't set mode_changed anywhere, it's all derived state.
>>> And we call the full atomic commit, which mean we do re-compute all the
>>> derived stuff like mode_changed. I still don't get why we need this.
>> In the core resume, all crtc's are disabled on suspend, and are assumed to be off on resume.
>>
>> But with i915 hw readout, the hw may also be resumed by bios and by chance the connectors from bios match up to the state we
>> want to set, the mode also being the same.
>>
>> The only thing different could be (for example) crtc_state->has_audio or lane configuration, the bios might not set the same. We have to
>> force a modeset (which might be downgraded to a fastset) in order to notice that this has to be restored as well.
> But we compare crtc_states and upgrade them to a modeset already when e.g.
> has_audio changed. Or at least we should.
>
> This smells like you're papering over a bug in our atomic_check code
> still. The state compare stuff /should/ be able to figure this out. If
> it's broken, then we might run into this in normal modesets too.
We don't run the state comparison until
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-07-20 16:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-09 14:52 [PATCH 0/5] drm/i915: Use new atomic iterator macros Maarten Lankhorst
2017-03-09 14:52 ` [PATCH 1/5] drm/i915: Use new atomic iterator macros in ddi Maarten Lankhorst
2017-03-13  8:40   ` Daniel Vetter
2017-03-09 14:52 ` [PATCH 2/5] drm/i915: Use new atomic iterator macros in fbc Maarten Lankhorst
2017-03-13 10:05   ` Daniel Vetter
2017-03-09 14:52 ` [PATCH 3/5] drm/i915: Use new atomic iterator macros in wm code Maarten Lankhorst
2017-03-13 10:07   ` Daniel Vetter
2017-03-09 14:52 ` [PATCH 4/5] drm/i915: Use new atomic iterator macros in display code Maarten Lankhorst
2017-03-13 10:15   ` Daniel Vetter
2017-03-13 11:08     ` Maarten Lankhorst
2017-03-14  6:50       ` Daniel Vetter
2017-03-15  8:23         ` Maarten Lankhorst
2017-03-16  8:47           ` Daniel Vetter
2017-07-19 11:58             ` Maarten Lankhorst [this message]
2017-03-09 14:52 ` [PATCH 5/5] drm/i915: Use new atomic iterator macros in cdclk Maarten Lankhorst
2017-03-13 10:15   ` Daniel Vetter
2017-03-09 18:18 ` ✓ Fi.CI.BAT: success for drm/i915: Use new atomic iterator macros Patchwork
2017-03-09 18:35 ` [PATCH 0/5] " Ville Syrjälä
2017-03-13 11:08   ` Maarten Lankhorst

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=f2eb1e7e-ade7-745f-361b-6a2a61a781da@linux.intel.com \
    --to=maarten.lankhorst@linux.intel.com \
    --cc=daniel@ffwll.ch \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox