From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Swapnil Jakhade <sjakhade@cadence.com>,
<dri-devel@lists.freedesktop.org>, <airlied@linux.ie>,
<daniel@ffwll.ch>, <robh+dt@kernel.org>, <a.hajda@samsung.com>,
<narmstrong@baylibre.com>, <jonas@kwiboo.se>,
<jernej.skrabec@siol.net>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <mparab@cadence.com>,
<yamonkar@cadence.com>, <jsarha@ti.com>, <nsekhar@ti.com>,
<praneeth@ti.com>, <nikhil.nd@ti.com>
Subject: Re: [PATCH v9 2/3] drm: bridge: Add support for Cadence MHDP8546 DPI/DP bridge
Date: Fri, 4 Sep 2020 08:53:40 +0300 [thread overview]
Message-ID: <ae3b4dfb-72a7-2734-e104-7fa5b24d81f5@ti.com> (raw)
In-Reply-To: <20200904022948.GE9369@pendragon.ideasonboard.com>
Hi,
On 04/09/2020 05:29, Laurent Pinchart wrote:
>> Laurent mentioned that atomic_check should not change state. Note that
>> cdns_mhdp_validate_mode_params also changes state, as it calculates tu_size, vs and line_thresh.
>
> .atomic_check() isn't allowed to change any global state, which means
> both hardware state and data in cdns_mhdp_device. The drm_bridge_state
> (and thus the cdns_mhdp_bridge_state) can be modified as it stores the
> state for the atomic commit being checked.
>
>> There seems to be issues with mode changes, but I think the first step would be to clarify the
>> related code a bit. cdns_mhdp_validate_mode_params() is misnamed, I think it should be renamed to
>> calculate_tu or something like that.
>>
>> cdns_mhdp_bandwidth_ok() should take display_fmt or bpp as a parameter, as currently it digs that up
>> from the current state.
>>
>> Probably cdns_mhdp_validate_mode_params() would be better if it doesn't write the result to the
>> state, but returns the values. That way it could also be used to verify if suitable settings can be
>> found, without changing the state.
>
> This use case is actually a very good example of proper usage of the
> atomic state :-) .atomic_check() has to perform computations to verify
> the atomic commit, and storing the results in the commit's state
> prevents duplicating the same calculation at .atomic_commit() time.
Yes, you're right.
But it's still not good, as cdns_mhdp_validate_mode_params uses link details to do the calculations,
but we do link training only later and thus the calculations are invalid.
cdns_mhdp_validate_mode_params is also called from the HPD interrupt, and there it changes the
current bridge state. link_mutex is being held in every place where cdns_mhdp_validate_mode_params
is called, so I guess it's fine.
Tomi
--
Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
next prev parent reply other threads:[~2020-09-04 5:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-31 8:23 [PATCH v9 0/3] drm: Add support for Cadence MHDP8546 DPI/DP bridge and J721E wrapper Swapnil Jakhade
2020-08-31 8:23 ` [PATCH v9 1/3] dt-bindings: drm/bridge: Document Cadence MHDP8546 bridge bindings Swapnil Jakhade
2020-08-31 8:23 ` [PATCH v9 2/3] drm: bridge: Add support for Cadence MHDP8546 DPI/DP bridge Swapnil Jakhade
2020-08-31 20:17 ` Laurent Pinchart
2020-09-01 7:46 ` Tomi Valkeinen
2020-09-01 8:03 ` Tomi Valkeinen
2020-09-04 2:29 ` Laurent Pinchart
2020-09-04 5:53 ` Tomi Valkeinen [this message]
2020-09-01 8:34 ` Tomi Valkeinen
2020-09-03 6:22 ` Milind Parab
2020-09-03 7:23 ` Tomi Valkeinen
2020-09-03 7:32 ` Milind Parab
2020-08-31 8:23 ` [PATCH v9 3/3] drm: bridge: cdns-mhdp8546: Add TI J721E wrapper Swapnil Jakhade
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=ae3b4dfb-72a7-2734-e104-7fa5b24d81f5@ti.com \
--to=tomi.valkeinen@ti.com \
--cc=a.hajda@samsung.com \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=jsarha@ti.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mparab@cadence.com \
--cc=narmstrong@baylibre.com \
--cc=nikhil.nd@ti.com \
--cc=nsekhar@ti.com \
--cc=praneeth@ti.com \
--cc=robh+dt@kernel.org \
--cc=sjakhade@cadence.com \
--cc=yamonkar@cadence.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®