From: Sam Ravnborg <sam@ravnborg.org>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org,
Rob Clark <robdclark@chromium.org>,
Jernej Skrabec <jernej.skrabec@siol.net>,
Jonas Karlman <jonas@kwiboo.se>,
Neil Armstrong <narmstrong@baylibre.com>,
linux-renesas-soc@vger.kernel.org,
Andrzej Hajda <a.hajda@samsung.com>, Sean Paul <sean@poorly.run>
Subject: Re: [PATCH 1/4] drm: bridge: adv7511: Split EDID read to a separate function
Date: Mon, 13 Apr 2020 07:54:09 +0200 [thread overview]
Message-ID: <20200413055409.GC6324@ravnborg.org> (raw)
In-Reply-To: <20200409004610.12346-2-laurent.pinchart+renesas@ideasonboard.com>
Hi Laurent.
On Thu, Apr 09, 2020 at 03:46:07AM +0300, Laurent Pinchart wrote:
> To prepare for the implementation of the DRM bridge connector
> operations, move EDID read out of adv7511_get_modes() to a separate
> function.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
The code do not check if drm_do_get_edid() return NULL.
But all functions called with the edid seems to handle a NULL edid well.
So thats OK.
Acked-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 23 ++++++++++++++------
> 1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index 87b58c1acff4..58d02e92b6b9 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -589,11 +589,10 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block,
> * ADV75xx helpers
> */
>
> -static int adv7511_get_modes(struct adv7511 *adv7511,
> - struct drm_connector *connector)
> +static struct edid *adv7511_get_edid(struct adv7511 *adv7511,
> + struct drm_connector *connector)
> {
> struct edid *edid;
> - unsigned int count;
>
> /* Reading the EDID only works if the device is powered */
> if (!adv7511->powered) {
> @@ -612,15 +611,25 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
> if (!adv7511->powered)
> __adv7511_power_off(adv7511);
>
> -
> - drm_connector_update_edid_property(connector, edid);
> - count = drm_add_edid_modes(connector, edid);
> -
> adv7511_set_config_csc(adv7511, connector, adv7511->rgb,
> drm_detect_hdmi_monitor(edid));
>
> cec_s_phys_addr_from_edid(adv7511->cec_adap, edid);
>
> + return edid;
> +}
> +
> +static int adv7511_get_modes(struct adv7511 *adv7511,
> + struct drm_connector *connector)
> +{
> + struct edid *edid;
> + unsigned int count;
> +
> + edid = adv7511_get_edid(adv7511, connector);
> +
> + drm_connector_update_edid_property(connector, edid);
> + count = drm_add_edid_modes(connector, edid);
> +
> kfree(edid);
>
> return count;
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: Sam Ravnborg <sam@ravnborg.org>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: Rob Clark <robdclark@chromium.org>,
Jernej Skrabec <jernej.skrabec@siol.net>,
Neil Armstrong <narmstrong@baylibre.com>,
Jonas Karlman <jonas@kwiboo.se>,
dri-devel@lists.freedesktop.org,
linux-renesas-soc@vger.kernel.org,
Andrzej Hajda <a.hajda@samsung.com>, Sean Paul <sean@poorly.run>
Subject: Re: [PATCH 1/4] drm: bridge: adv7511: Split EDID read to a separate function
Date: Mon, 13 Apr 2020 07:54:09 +0200 [thread overview]
Message-ID: <20200413055409.GC6324@ravnborg.org> (raw)
In-Reply-To: <20200409004610.12346-2-laurent.pinchart+renesas@ideasonboard.com>
Hi Laurent.
On Thu, Apr 09, 2020 at 03:46:07AM +0300, Laurent Pinchart wrote:
> To prepare for the implementation of the DRM bridge connector
> operations, move EDID read out of adv7511_get_modes() to a separate
> function.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
The code do not check if drm_do_get_edid() return NULL.
But all functions called with the edid seems to handle a NULL edid well.
So thats OK.
Acked-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 23 ++++++++++++++------
> 1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index 87b58c1acff4..58d02e92b6b9 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -589,11 +589,10 @@ static int adv7511_get_edid_block(void *data, u8 *buf, unsigned int block,
> * ADV75xx helpers
> */
>
> -static int adv7511_get_modes(struct adv7511 *adv7511,
> - struct drm_connector *connector)
> +static struct edid *adv7511_get_edid(struct adv7511 *adv7511,
> + struct drm_connector *connector)
> {
> struct edid *edid;
> - unsigned int count;
>
> /* Reading the EDID only works if the device is powered */
> if (!adv7511->powered) {
> @@ -612,15 +611,25 @@ static int adv7511_get_modes(struct adv7511 *adv7511,
> if (!adv7511->powered)
> __adv7511_power_off(adv7511);
>
> -
> - drm_connector_update_edid_property(connector, edid);
> - count = drm_add_edid_modes(connector, edid);
> -
> adv7511_set_config_csc(adv7511, connector, adv7511->rgb,
> drm_detect_hdmi_monitor(edid));
>
> cec_s_phys_addr_from_edid(adv7511->cec_adap, edid);
>
> + return edid;
> +}
> +
> +static int adv7511_get_modes(struct adv7511 *adv7511,
> + struct drm_connector *connector)
> +{
> + struct edid *edid;
> + unsigned int count;
> +
> + edid = adv7511_get_edid(adv7511, connector);
> +
> + drm_connector_update_edid_property(connector, edid);
> + count = drm_add_edid_modes(connector, edid);
> +
> kfree(edid);
>
> return count;
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-04-13 5:54 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-09 0:46 [PATCH 0/4] drm: bridge: adv7511: Enable usage with DRM bridge connector helper Laurent Pinchart
2020-04-09 0:46 ` Laurent Pinchart
2020-04-09 0:46 ` [PATCH 1/4] drm: bridge: adv7511: Split EDID read to a separate function Laurent Pinchart
2020-04-09 0:46 ` Laurent Pinchart
2020-04-13 5:54 ` Sam Ravnborg [this message]
2020-04-13 5:54 ` Sam Ravnborg
2020-04-09 0:46 ` [PATCH 2/4] drm: bridge: adv7511: Split connector creation " Laurent Pinchart
2020-04-09 0:46 ` Laurent Pinchart
2020-04-13 5:58 ` Sam Ravnborg
2020-04-13 5:58 ` Sam Ravnborg
2020-04-09 0:46 ` [PATCH 3/4] drm: bridge: adv7511: Implement bridge connector operations Laurent Pinchart
2020-04-09 0:46 ` Laurent Pinchart
2020-04-09 0:46 ` [PATCH 4/4] drm: bridge: adv7511: Make connector creation optional Laurent Pinchart
2020-04-09 0:46 ` Laurent Pinchart
2020-04-13 6:03 ` Sam Ravnborg
2020-04-13 6:03 ` Sam Ravnborg
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=20200413055409.GC6324@ravnborg.org \
--to=sam@ravnborg.org \
--cc=a.hajda@samsung.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=jernej.skrabec@siol.net \
--cc=jonas@kwiboo.se \
--cc=laurent.pinchart+renesas@ideasonboard.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=narmstrong@baylibre.com \
--cc=robdclark@chromium.org \
--cc=sean@poorly.run \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.