linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: Chris Wilson <chris@chris-wilson.co.uk>,
	Russell King - ARM Linux <linux@armlinux.org.uk>,
	Jose Abreu <Jose.Abreu@synopsys.com>,
	<dri-devel@lists.freedesktop.org>,
	Carlos Palminha <CARLOS.PALMINHA@synopsys.com>,
	Archit Taneja <architt@codeaurora.org>,
	David Airlie <airlied@linux.ie>,
	Fabio Estevam <fabio.estevam@freescale.com>,
	Takashi Iwai <tiwai@suse.de>,
	"Vladimir Zapolskiy" <vladimir_zapolskiy@mentor.com>,
	Thierry Reding <treding@nvidia.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 3/3 v3] drm: bridge/dw-hdmi: Move edid reading to .detect() callback
Date: Mon, 8 Aug 2016 17:25:38 +0100	[thread overview]
Message-ID: <57A8B282.6070401@synopsys.com> (raw)
In-Reply-To: <20160805081349.GI12034@nuc-i3427.alporthouse.com>

Hi,


On 05-08-2016 09:13, Chris Wilson wrote:
> On Fri, Aug 05, 2016 at 10:06:08AM +0200, Daniel Vetter wrote:
>> On Fri, Aug 05, 2016 at 12:01:25AM +0100, Russell King - ARM Linux wrote:
>>> On Thu, Aug 04, 2016 at 06:13:18PM +0100, Jose Abreu wrote:
>>>> Hi Russell,
>>>>
>>>> So, I didn't use framebuffer console but used X instead and it is
>>>> working as it should. I think we can drop this patch. I am now
>>>> making interoperability with DVI and I am facing the following
>>>> scenario:
>>>>     - I start the driver
>>>>     - An EDID is sent which tells the driver that HDMI is NOT
>>>> supported;
>>>>     - The driver configures itself to a DVI mode;
>>>>
>>>> Until this point everything is working as it should. But:
>>>>
>>>>     - Now I send an EDID which tells the driver that HDMI is
>>>> supported;
>>>>     - As the EDID has the same preferred mode the user will not
>>>> reconfigure the mode and there will be no change to HDMI mode.
>>> The EDID should still be read, but as you say, userspace doesn't take
>>> any action because it sees that the mode parameters are still the same,
>>> as you have identified.
>>>
>>>> The missing change to HDMI mode will cause the test to fail. The
>>>> workaround that I am using is to reconfigure to another video
>>>> mode and then configure to the preferred one but I think this
>>>> could be fixed in the driver, right?
>>> This one is extremely awkward - to fix it, we would need to check to
>>> see whether we reconfigure the hardware each time we read the EDID,
>>> and I don't think that's a particularly nice thing to do.
>>>
>>> I'd like to hear what other DRM developers think about this issue.
>> I pondored whether we should have a counter on each connector for probe
>> state, which helpers would increment whenever something changes, like:
>> - connector_status (as tracked by probe helpers)
>> - anything in the edid changes (when setting it
>>   drm_mode_connector_update_edid_property)
>> - other changes (like sink state changes in dpcd or whatever)
>>
>> That way userspace would be able to reliably spot such changes and do a
>> new modeset.
> Yes, please. I have had similar wishes for state changes and overall
> modeset counters.
> -Chris
>

What about this: Assuming that the modes probed by EDID have the
picture aspect ratio field set we can check for one of this
probed modes when receiving a mode from userspace and then if the
modes match (except from the picture aspect field, which is not
set by userspace) then we can use the picture aspect value of the
probed mode. I am using something like this in my modeset callback:

    /* 'mode' comes from userspace, 'pmode' comes from EDID */
    if (mode->picture_aspect_ratio == HDMI_PICTURE_ASPECT_NONE) {
        struct drm_display_mode *pmode;

        list_for_each_entry(pmode, &connector.modes, head) {
            if (drm_mode_equal(pmode, mode))
                mode->picture_aspect_ratio =
pmode->picture_aspect_ratio;
        }
    }

Of course if the EDID has for example two exactly equal modes
that only differ in the picture aspect ratio then this will not
work unless user passes the picture aspect when setting the mode.

Best regards,
Jose Miguel Abreu

  reply	other threads:[~2016-08-08 16:27 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-04 10:44 [PATCH 0/3 v3] drm: bridge/dw-hdmi: Fixes for dw-hdmi and DWC support Jose Abreu
2016-08-04 10:44 ` [PATCH 1/3 v3] drm: bridge/dw-hdmi: Add support for DWC Phy Jose Abreu
2016-08-04 10:44 ` [PATCH 2/3 v3] drm: bridge/dw-hdmi: Enable ISCR1, ISCR2 and ACP packets Jose Abreu
2016-08-04 15:32   ` Russell King - ARM Linux
2016-08-04 16:18     ` Jose Abreu
2016-08-04 10:44 ` [PATCH 3/3 v3] drm: bridge/dw-hdmi: Move edid reading to .detect() callback Jose Abreu
2016-08-04 10:47   ` Russell King - ARM Linux
2016-08-04 13:58     ` Jose Abreu
2016-08-04 14:31       ` Russell King - ARM Linux
2016-08-04 14:57         ` Jose Abreu
2016-08-04 15:04           ` Russell King - ARM Linux
2016-08-04 17:13             ` Jose Abreu
2016-08-04 23:01               ` Russell King - ARM Linux
2016-08-05  8:06                 ` Daniel Vetter
2016-08-05  8:13                   ` Chris Wilson
2016-08-08 16:25                     ` Jose Abreu [this message]
2016-08-09  6:09                       ` Daniel Vetter

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=57A8B282.6070401@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=CARLOS.PALMINHA@synopsys.com \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=chris@chris-wilson.co.uk \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=fabio.estevam@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=tiwai@suse.de \
    --cc=treding@nvidia.com \
    --cc=vladimir_zapolskiy@mentor.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).