diff mbox

[17/42] drm/omap: Add dispc_mgr_get_supported_outputs()

Message ID 1456161048-21240-18-git-send-email-tomi.valkeinen@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Tomi Valkeinen Feb. 22, 2016, 5:10 p.m. UTC
We are removing the use of the 'struct omap_overlay_manager' from
omapdrm, and one part of that is removing the use of
mgr->supported_outputs field.

This patch adds dispc_mgr_get_supported_outputs() function which can be
used instead of mgr->supported_outputs. omap_crtc.c is changed to use
the new function.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/dss/dispc.c   | 6 ++++++
 drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 ++
 drivers/gpu/drm/omapdrm/omap_crtc.c   | 2 +-
 3 files changed, 9 insertions(+), 1 deletion(-)

Comments

Laurent Pinchart March 7, 2016, 8:47 a.m. UTC | #1
Hi Tomi,

Thank you for the patch.

On Monday 22 February 2016 19:10:23 Tomi Valkeinen wrote:
> We are removing the use of the 'struct omap_overlay_manager' from
> omapdrm, and one part of that is removing the use of
> mgr->supported_outputs field.
> 
> This patch adds dispc_mgr_get_supported_outputs() function which can be
> used instead of mgr->supported_outputs. omap_crtc.c is changed to use
> the new function.
> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/gpu/drm/omapdrm/dss/dispc.c   | 6 ++++++
>  drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 ++
>  drivers/gpu/drm/omapdrm/omap_crtc.c   | 2 +-
>  3 files changed, 9 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c
> b/drivers/gpu/drm/omapdrm/dss/dispc.c index a4274dca384a..a5940892a788
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
> @@ -2910,6 +2910,12 @@ bool dispc_ovl_enabled(enum omap_plane plane)
>  }
>  EXPORT_SYMBOL(dispc_ovl_enabled);
> 
> +enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel
> channel)
> +{
> +	return dss_feat_get_supported_outputs(channel);
> +}

Wouldn't it make sense to turn this into a static inline function, as it's a 
one-liner ?

> +EXPORT_SYMBOL(dispc_mgr_get_supported_outputs);
> +
>  void dispc_mgr_enable(enum omap_channel channel, bool enable)
>  {
>  	mgr_fld_write(channel, DISPC_MGR_FLD_ENABLE, enable);
> diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> b/drivers/gpu/drm/omapdrm/dss/omapdss.h index 7712ffef2836..0a213489f133
> 100644
> --- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
> +++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
> @@ -58,6 +58,8 @@ int dispc_ovl_setup(enum omap_plane plane, const struct
> omap_overlay_info *oi, bool replication, const struct omap_video_timings
> *mgr_timings, bool mem_to_mem);
> 
> +enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel
> channel); +
>  struct dss_mgr_ops {
>  	int (*connect)(struct omap_overlay_manager *mgr,
>  		struct omap_dss_device *dst);
> diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c
> b/drivers/gpu/drm/omapdrm/omap_crtc.c index 280d80781635..b1ed18bf1b1b
> 100644
> --- a/drivers/gpu/drm/omapdrm/omap_crtc.c
> +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
> @@ -108,7 +108,7 @@ static int omap_crtc_dss_connect(struct
> omap_overlay_manager *mgr, if (mgr->output)
>  		return -EINVAL;
> 
> -	if ((mgr->supported_outputs & dst->id) == 0)
> +	if ((dispc_mgr_get_supported_outputs(mgr->id) & dst->id) == 0)
>  		return -EINVAL;
> 
>  	dst->manager = mgr;
Tomi Valkeinen March 7, 2016, 9:08 a.m. UTC | #2
On 07/03/16 10:47, Laurent Pinchart wrote:
> Hi Tomi,
> 
> Thank you for the patch.
> 
> On Monday 22 February 2016 19:10:23 Tomi Valkeinen wrote:
>> We are removing the use of the 'struct omap_overlay_manager' from
>> omapdrm, and one part of that is removing the use of
>> mgr->supported_outputs field.
>>
>> This patch adds dispc_mgr_get_supported_outputs() function which can be
>> used instead of mgr->supported_outputs. omap_crtc.c is changed to use
>> the new function.
>>
>> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
>> ---
>>  drivers/gpu/drm/omapdrm/dss/dispc.c   | 6 ++++++
>>  drivers/gpu/drm/omapdrm/dss/omapdss.h | 2 ++
>>  drivers/gpu/drm/omapdrm/omap_crtc.c   | 2 +-
>>  3 files changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c
>> b/drivers/gpu/drm/omapdrm/dss/dispc.c index a4274dca384a..a5940892a788
>> 100644
>> --- a/drivers/gpu/drm/omapdrm/dss/dispc.c
>> +++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
>> @@ -2910,6 +2910,12 @@ bool dispc_ovl_enabled(enum omap_plane plane)
>>  }
>>  EXPORT_SYMBOL(dispc_ovl_enabled);
>>
>> +enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel
>> channel)
>> +{
>> +	return dss_feat_get_supported_outputs(channel);
>> +}
> 
> Wouldn't it make sense to turn this into a static inline function, as it's a 
> one-liner ?

I plan to get rid of the dss_features.c and move the code into
respective driver files. So this function will probably get a bit larger
with that.

And hmm... Would it even work, as dss_feat_get_supported_outputs() is
not visible to the callers?

 Tomi
diff mbox

Patch

diff --git a/drivers/gpu/drm/omapdrm/dss/dispc.c b/drivers/gpu/drm/omapdrm/dss/dispc.c
index a4274dca384a..a5940892a788 100644
--- a/drivers/gpu/drm/omapdrm/dss/dispc.c
+++ b/drivers/gpu/drm/omapdrm/dss/dispc.c
@@ -2910,6 +2910,12 @@  bool dispc_ovl_enabled(enum omap_plane plane)
 }
 EXPORT_SYMBOL(dispc_ovl_enabled);
 
+enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel)
+{
+	return dss_feat_get_supported_outputs(channel);
+}
+EXPORT_SYMBOL(dispc_mgr_get_supported_outputs);
+
 void dispc_mgr_enable(enum omap_channel channel, bool enable)
 {
 	mgr_fld_write(channel, DISPC_MGR_FLD_ENABLE, enable);
diff --git a/drivers/gpu/drm/omapdrm/dss/omapdss.h b/drivers/gpu/drm/omapdrm/dss/omapdss.h
index 7712ffef2836..0a213489f133 100644
--- a/drivers/gpu/drm/omapdrm/dss/omapdss.h
+++ b/drivers/gpu/drm/omapdrm/dss/omapdss.h
@@ -58,6 +58,8 @@  int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
 		bool replication, const struct omap_video_timings *mgr_timings,
 		bool mem_to_mem);
 
+enum omap_dss_output_id dispc_mgr_get_supported_outputs(enum omap_channel channel);
+
 struct dss_mgr_ops {
 	int (*connect)(struct omap_overlay_manager *mgr,
 		struct omap_dss_device *dst);
diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
index 280d80781635..b1ed18bf1b1b 100644
--- a/drivers/gpu/drm/omapdrm/omap_crtc.c
+++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
@@ -108,7 +108,7 @@  static int omap_crtc_dss_connect(struct omap_overlay_manager *mgr,
 	if (mgr->output)
 		return -EINVAL;
 
-	if ((mgr->supported_outputs & dst->id) == 0)
+	if ((dispc_mgr_get_supported_outputs(mgr->id) & dst->id) == 0)
 		return -EINVAL;
 
 	dst->manager = mgr;