From: "Indan Zupancic" <indan@nul.nu>
To: "Chris Wilson" <chris@chris-wilson.co.uk>
Cc: "Jeff Chua" <jeff.chua.linux@gmail.com>,
"Takashi Iwai" <tiwai@suse.de>,
"Linus Torvalds" <torvalds@linux-foundation.org>,
"Rafael J. Wysocki" <rjw@sisk.pl>, "Len Brown" <lenb@kernel.org>,
"LKML" <linux-kernel@vger.kernel.org>
Subject: Re: Commit 500f7147cf5bafd139056d521536b10c2bc2e154 breaks _resume_
Date: Wed, 9 Feb 2011 11:20:46 +0100 (CET) [thread overview]
Message-ID: <e2336ca0c80cf43f018fcb797de3441d.squirrel@webmail.greenhost.nl> (raw)
In-Reply-To: <b7da2f$qco1ng@fmsmga001.fm.intel.com>
On Wed, February 9, 2011 10:32, Chris Wilson wrote:
> On Wed, 9 Feb 2011 03:56:36 +0100 (CET), "Indan Zupancic" <indan@nul.nu> wrote:
>> All in all it seems quite wrong, no matter if it happens to work, because
>> it depends on the calling order done by the drm layer. If *_crtc_enable()
>> is called instead it won't do anything because of that active = true thing.
>> This seems to be happening in your case.
>
> The order is very well defined.
>
> modesetting (upon resume we set the previous mode):
> for each enabled crtc:
> crtc_helper->prepare -> intel_crtc_disable()
> crtc->mode_set -> intel_crtc_mode_set()
> crtc_helper->commit -> intel_crtc_enable()
> for each !enabled crtc:
> crtc->disable -> intel_crtc_disable()
Prepare for what? That could mean anything. Is it only used to
prepare changing a mode, or suspend, or what? Same for commit.
Should it have been named modes_set_prepare and mode_set_commit?
It's clear if you've worked a lot on the code, but if you're just
debugging it's had to tell when anything will be called, the
function pointer chasing isn't fun. And that doesn't guarantee
a driver function won't be called in a different way in the
future anyway.
I'd go as far as saying that if that's always the order, then
just get rid of prepare and commit and do what's needed in the
mode_set function. If prepare and commit don't have any other
purpose or reason for existence.
And back to the original thing, where does that reset() callback
fit in? It's absent from the very well defined order. And judging
by its name, it should be okay to call at any moment, but it seems
that isn't the case.
But the real wrong thing is fiddling with "active" outside of those
state changing functions to force a certain behaviour later on if a
specific function is called just after this (fingers crossed).
My advise is to just remove that active = true line and fix any
breakage that results in some other way. It acts as an out-of-band
message to *crtc_disable() to re-disable already disabled crtcs,
which doesn't always work (either now or in the future). If the state
wasn't already messed up, it is after doing the active = true thing.
Greetings,
Indan
next prev parent reply other threads:[~2011-02-09 10:20 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-06 1:50 Jeff Chua
2011-02-06 8:19 ` Marc Koschewski
2011-02-06 11:02 ` Takashi Iwai
2011-02-06 11:06 ` Dave Airlie
2011-02-06 12:21 ` Marc Koschewski
2011-02-06 13:04 ` Rafael J. Wysocki
2011-02-06 13:44 ` Marc Koschewski
2011-02-06 13:55 ` Rafael J. Wysocki
2011-02-06 11:00 ` Takashi Iwai
2011-02-06 12:24 ` Marc Koschewski
2011-02-06 13:19 ` Takashi Iwai
2011-02-06 14:01 ` Jeff Chua
2011-02-06 14:47 ` Chris Wilson
2011-02-06 14:51 ` Jeff Chua
2011-02-06 14:49 ` Jeff Chua
2011-02-06 15:27 ` Chris Wilson
2011-02-07 4:48 ` Jeff Chua
2011-02-07 5:02 ` Jeff Chua
2011-02-07 8:25 ` Takashi Iwai
2011-02-07 8:36 ` Jeff Chua
2011-02-07 8:45 ` Jeff Chua
2011-02-07 8:54 ` Takashi Iwai
2011-02-07 8:52 ` Takashi Iwai
2011-02-07 10:15 ` Takashi Iwai
2011-02-07 13:38 ` Jeff Chua
2011-02-07 14:11 ` Jeff Chua
2011-02-07 21:20 ` Rafael J. Wysocki
2011-02-08 1:40 ` Jeff Chua
2011-02-08 13:36 ` Chris Wilson
2011-02-09 0:55 ` Jeff Chua
2011-02-09 1:05 ` Jeff Chua
2011-02-09 2:56 ` Indan Zupancic
2011-02-09 5:45 ` Jeff Chua
2011-02-09 9:42 ` Indan Zupancic
2011-02-09 9:32 ` Chris Wilson
2011-02-09 10:20 ` Indan Zupancic [this message]
2011-02-07 10:02 ` Marc Koschewski
2011-02-07 10:06 ` Takashi Iwai
2011-02-07 10:09 ` Marc Koschewski
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=e2336ca0c80cf43f018fcb797de3441d.squirrel@webmail.greenhost.nl \
--to=indan@nul.nu \
--cc=chris@chris-wilson.co.uk \
--cc=jeff.chua.linux@gmail.com \
--cc=lenb@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=tiwai@suse.de \
--cc=torvalds@linux-foundation.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
Powered by JetHome