mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jose Abreu <Jose.Abreu@synopsys.com>
To: John Stultz <john.stultz@linaro.org>,
	lkml <linux-kernel@vger.kernel.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Sean Paul <seanpaul@chromium.org>,
	"David Airlie" <airlied@linux.ie>,
	Rob Clark <robdclark@gmail.com>,
	Xinliang Liu <xinliang.liu@linaro.org>,
	Xinliang Liu <z.liuxinliang@hisilicon.com>,
	Rongrong Zou <zourongrong@gmail.com>,
	Xinwei Kong <kong.kongxinwei@hisilicon.com>,
	Chen Feng <puck.chen@hisilicon.com>,
	"Jose Abreu" <Jose.Abreu@synopsys.com>,
	Archit Taneja <architt@codeaurora.org>,
	<dri-devel@lists.freedesktop.org>
Subject: Re: [RFC][PATCH v2] drm: kirin: Add mode_valid logic to avoid mode clocks we can't generate
Date: Tue, 18 Jul 2017 12:10:31 +0100	[thread overview]
Message-ID: <35948cc2-201d-77c4-f3b8-c63f1ca9f11f@synopsys.com> (raw)
In-Reply-To: <1500351730-26391-1-git-send-email-john.stultz@linaro.org>

Hi John,


On 18-07-2017 05:22, John Stultz wrote:
> Currently the hikey dsi logic cannot generate accurate byte
> clocks values for all pixel clock values. Thus if a mode clock
> is selected that cannot match the calculated byte clock, the
> device will boot with a blank screen.
>
> This patch uses the new mode_valid callback (many thanks to
> Jose Abreu for upstreaming it!) to ensure we don't select
> modes we cannot generate.
>
> NOTE: Stylistically I suspect there are better ways to do what
> I'm trying to do here. The encoder -> crtc bit is terrible, and
> getting the crtc adjusted mode from the encoder logic feels
> less then ideal. So feedback would be greatly appreciated!
>
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Jani Nikula <jani.nikula@linux.intel.com>
> Cc: Sean Paul <seanpaul@chromium.org>
> Cc: David Airlie <airlied@linux.ie>
> Cc: Rob Clark <robdclark@gmail.com>
> Cc: Xinliang Liu <xinliang.liu@linaro.org>
> Cc: Xinliang Liu <z.liuxinliang@hisilicon.com>
> Cc: Rongrong Zou <zourongrong@gmail.com>
> Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com>
> Cc: Chen Feng <puck.chen@hisilicon.com>
> Cc: Jose Abreu <Jose.Abreu@synopsys.com>
> Cc: Archit Taneja <architt@codeaurora.org>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: John Stultz <john.stultz@linaro.org>
> ---
> v2: Reworked to calculate if modeclock matches the phy's byteclock,
>     rather then using a whitelist of known modes.

Something like Daniel suggested would be simpler maybe:

encoder_mode_valid_aux()
{
    ...
}

dsi_encoder_mode_valid(...)
{
    drm_for_each_crtc(crtc, dev) {
        crtc->mode_fixup(crtc, mode, adjusted_mode);
        ret = encoder_mode_valid_aux(adjusted_mode);
        if (ret != MODE_OK)
            return ret;
    }
}

BTW, I think at commit stage you have encoder->crtc populated,
not sure though. But at probbing stage it will not be bound. And
also if you have more than one crtc this may be wrong. (How will
you know which crtc will be bound to the encoder so that you can
get the right clock?).

Best regards,
Jose Miguel Abreu

  reply	other threads:[~2017-07-18 11:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-18  4:22 John Stultz
2017-07-18 11:10 ` Jose Abreu [this message]
2017-07-18 16:56   ` John Stultz
2017-07-19 10:10     ` Jose Abreu

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=35948cc2-201d-77c4-f3b8-c63f1ca9f11f@synopsys.com \
    --to=jose.abreu@synopsys.com \
    --cc=airlied@linux.ie \
    --cc=architt@codeaurora.org \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=john.stultz@linaro.org \
    --cc=kong.kongxinwei@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=puck.chen@hisilicon.com \
    --cc=robdclark@gmail.com \
    --cc=seanpaul@chromium.org \
    --cc=xinliang.liu@linaro.org \
    --cc=z.liuxinliang@hisilicon.com \
    --cc=zourongrong@gmail.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

all inboxes | Powered by JetHome®