diff mbox

[21/21] drm/omap: Don't call HDMI mode and infoframe operations recursively

Message ID 20180606093650.26034-22-laurent.pinchart@ideasonboard.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurent Pinchart June 6, 2018, 9:36 a.m. UTC
The HDMI mode (.set_hdmi_mode()) and infoframe (.set_infoframe())
operations are called recursively from the display device back to the
HDMI encoder. This isn't required, as all components other than the HDMI
encoder just forward the operation to the previous component in the
chain. Call the operations directly on the HDMI encoder.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/omapdrm/displays/connector-hdmi.c   | 20 --------------------
 .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c    | 21 ---------------------
 drivers/gpu/drm/omapdrm/omap_encoder.c              |  2 +-
 3 files changed, 1 insertion(+), 42 deletions(-)

Comments

Sebastian Reichel June 11, 2018, 11:55 p.m. UTC | #1
Hi,

On Wed, Jun 06, 2018 at 12:36:50PM +0300, Laurent Pinchart wrote:
> The HDMI mode (.set_hdmi_mode()) and infoframe (.set_infoframe())
> operations are called recursively from the display device back to the
> HDMI encoder. This isn't required, as all components other than the HDMI
> encoder just forward the operation to the previous component in the
> chain. Call the operations directly on the HDMI encoder.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

-- Sebastian

>  drivers/gpu/drm/omapdrm/displays/connector-hdmi.c   | 20 --------------------
>  .../gpu/drm/omapdrm/displays/encoder-tpd12s015.c    | 21 ---------------------
>  drivers/gpu/drm/omapdrm/omap_encoder.c              |  2 +-
>  3 files changed, 1 insertion(+), 42 deletions(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> index 16dc22edcb8e..fe6d2923ed81 100644
> --- a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> +++ b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
> @@ -154,21 +154,6 @@ static void hdmic_unregister_hpd_cb(struct omap_dss_device *dssdev)
>  	mutex_unlock(&ddata->hpd_lock);
>  }
>  
> -static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode)
> -{
> -	struct omap_dss_device *src = dssdev->src;
> -
> -	return src->ops->hdmi.set_hdmi_mode(src, hdmi_mode);
> -}
> -
> -static int hdmic_set_infoframe(struct omap_dss_device *dssdev,
> -		const struct hdmi_avi_infoframe *avi)
> -{
> -	struct omap_dss_device *src = dssdev->src;
> -
> -	return src->ops->hdmi.set_infoframe(src, avi);
> -}
> -
>  static const struct omap_dss_device_ops hdmic_ops = {
>  	.connect		= hdmic_connect,
>  	.disconnect		= hdmic_disconnect,
> @@ -183,11 +168,6 @@ static const struct omap_dss_device_ops hdmic_ops = {
>  	.detect			= hdmic_detect,
>  	.register_hpd_cb	= hdmic_register_hpd_cb,
>  	.unregister_hpd_cb	= hdmic_unregister_hpd_cb,
> -
> -	.hdmi = {
> -		.set_hdmi_mode	= hdmic_set_hdmi_mode,
> -		.set_infoframe	= hdmic_set_infoframe,
> -	},
>  };
>  
>  static irqreturn_t hdmic_hpd_isr(int irq, void *data)
> diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
> index dbbf9683bd51..3ad60f4b331e 100644
> --- a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
> +++ b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
> @@ -145,22 +145,6 @@ static void tpd_unregister_hpd_cb(struct omap_dss_device *dssdev)
>  	mutex_unlock(&ddata->hpd_lock);
>  }
>  
> -static int tpd_set_infoframe(struct omap_dss_device *dssdev,
> -		const struct hdmi_avi_infoframe *avi)
> -{
> -	struct omap_dss_device *src = dssdev->src;
> -
> -	return src->ops->hdmi.set_infoframe(src, avi);
> -}
> -
> -static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev,
> -		bool hdmi_mode)
> -{
> -	struct omap_dss_device *src = dssdev->src;
> -
> -	return src->ops->hdmi.set_hdmi_mode(src, hdmi_mode);
> -}
> -
>  static const struct omap_dss_device_ops tpd_ops = {
>  	.connect		= tpd_connect,
>  	.disconnect		= tpd_disconnect,
> @@ -171,11 +155,6 @@ static const struct omap_dss_device_ops tpd_ops = {
>  	.detect			= tpd_detect,
>  	.register_hpd_cb	= tpd_register_hpd_cb,
>  	.unregister_hpd_cb	= tpd_unregister_hpd_cb,
> -
> -	.hdmi = {
> -		.set_infoframe		= tpd_set_infoframe,
> -		.set_hdmi_mode		= tpd_set_hdmi_mode,
> -	},
>  };
>  
>  static irqreturn_t tpd_hpd_isr(int irq, void *data)
> diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c
> index 2689ae74ea60..94b75d018e71 100644
> --- a/drivers/gpu/drm/omapdrm/omap_encoder.c
> +++ b/drivers/gpu/drm/omapdrm/omap_encoder.c
> @@ -58,7 +58,7 @@ static void omap_encoder_mode_set(struct drm_encoder *encoder,
>  {
>  	struct drm_device *dev = encoder->dev;
>  	struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
> -	struct omap_dss_device *dssdev = omap_encoder->display;
> +	struct omap_dss_device *dssdev = omap_encoder->output;
>  	struct drm_connector *connector;
>  	bool hdmi_mode;
>  	int r;
> -- 
> Regards,
> 
> Laurent Pinchart
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
Tomi Valkeinen Aug. 13, 2018, 10:12 a.m. UTC | #2
On 06/06/18 12:36, Laurent Pinchart wrote:
> The HDMI mode (.set_hdmi_mode()) and infoframe (.set_infoframe())
> operations are called recursively from the display device back to the
> HDMI encoder. This isn't required, as all components other than the HDMI
> encoder just forward the operation to the previous component in the
> chain. Call the operations directly on the HDMI encoder.

TI's kernel has omapdrm specific sii9022 DPI-to-HDMI encoder driver,
which uses these. There's also a sii902x DRM bridge driver, which I
think handles infoframe internally.

The aim is, of course, to move to the DRM bridge drivers asap, so this
may not be an issue. So just fyi.

 Tomi
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
index 16dc22edcb8e..fe6d2923ed81 100644
--- a/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
+++ b/drivers/gpu/drm/omapdrm/displays/connector-hdmi.c
@@ -154,21 +154,6 @@  static void hdmic_unregister_hpd_cb(struct omap_dss_device *dssdev)
 	mutex_unlock(&ddata->hpd_lock);
 }
 
-static int hdmic_set_hdmi_mode(struct omap_dss_device *dssdev, bool hdmi_mode)
-{
-	struct omap_dss_device *src = dssdev->src;
-
-	return src->ops->hdmi.set_hdmi_mode(src, hdmi_mode);
-}
-
-static int hdmic_set_infoframe(struct omap_dss_device *dssdev,
-		const struct hdmi_avi_infoframe *avi)
-{
-	struct omap_dss_device *src = dssdev->src;
-
-	return src->ops->hdmi.set_infoframe(src, avi);
-}
-
 static const struct omap_dss_device_ops hdmic_ops = {
 	.connect		= hdmic_connect,
 	.disconnect		= hdmic_disconnect,
@@ -183,11 +168,6 @@  static const struct omap_dss_device_ops hdmic_ops = {
 	.detect			= hdmic_detect,
 	.register_hpd_cb	= hdmic_register_hpd_cb,
 	.unregister_hpd_cb	= hdmic_unregister_hpd_cb,
-
-	.hdmi = {
-		.set_hdmi_mode	= hdmic_set_hdmi_mode,
-		.set_infoframe	= hdmic_set_infoframe,
-	},
 };
 
 static irqreturn_t hdmic_hpd_isr(int irq, void *data)
diff --git a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
index dbbf9683bd51..3ad60f4b331e 100644
--- a/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
+++ b/drivers/gpu/drm/omapdrm/displays/encoder-tpd12s015.c
@@ -145,22 +145,6 @@  static void tpd_unregister_hpd_cb(struct omap_dss_device *dssdev)
 	mutex_unlock(&ddata->hpd_lock);
 }
 
-static int tpd_set_infoframe(struct omap_dss_device *dssdev,
-		const struct hdmi_avi_infoframe *avi)
-{
-	struct omap_dss_device *src = dssdev->src;
-
-	return src->ops->hdmi.set_infoframe(src, avi);
-}
-
-static int tpd_set_hdmi_mode(struct omap_dss_device *dssdev,
-		bool hdmi_mode)
-{
-	struct omap_dss_device *src = dssdev->src;
-
-	return src->ops->hdmi.set_hdmi_mode(src, hdmi_mode);
-}
-
 static const struct omap_dss_device_ops tpd_ops = {
 	.connect		= tpd_connect,
 	.disconnect		= tpd_disconnect,
@@ -171,11 +155,6 @@  static const struct omap_dss_device_ops tpd_ops = {
 	.detect			= tpd_detect,
 	.register_hpd_cb	= tpd_register_hpd_cb,
 	.unregister_hpd_cb	= tpd_unregister_hpd_cb,
-
-	.hdmi = {
-		.set_infoframe		= tpd_set_infoframe,
-		.set_hdmi_mode		= tpd_set_hdmi_mode,
-	},
 };
 
 static irqreturn_t tpd_hpd_isr(int irq, void *data)
diff --git a/drivers/gpu/drm/omapdrm/omap_encoder.c b/drivers/gpu/drm/omapdrm/omap_encoder.c
index 2689ae74ea60..94b75d018e71 100644
--- a/drivers/gpu/drm/omapdrm/omap_encoder.c
+++ b/drivers/gpu/drm/omapdrm/omap_encoder.c
@@ -58,7 +58,7 @@  static void omap_encoder_mode_set(struct drm_encoder *encoder,
 {
 	struct drm_device *dev = encoder->dev;
 	struct omap_encoder *omap_encoder = to_omap_encoder(encoder);
-	struct omap_dss_device *dssdev = omap_encoder->display;
+	struct omap_dss_device *dssdev = omap_encoder->output;
 	struct drm_connector *connector;
 	bool hdmi_mode;
 	int r;