diff mbox series

drm/connector: Allow max possible encoders to attach to a connector

Message ID 20190625234045.31321-1-dhinakaran.pandiyan@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/connector: Allow max possible encoders to attach to a connector | expand

Commit Message

Dhinakaran Pandiyan June 25, 2019, 11:40 p.m. UTC
Currently we restrict the number of encoders that can be linked to
a connector to 3, increase it to match the maximum number of encoders
that can be initialized - 32. The current limitation looks artificial.
Increasing the limit to 32 does however increases the size of the static
u32 array keeping track of the encoder IDs.

Cc: José Roberto de Souza <jose.souza@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
---
 include/drm/drm_connector.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ville Syrjälä June 26, 2019, 1:43 p.m. UTC | #1
On Tue, Jun 25, 2019 at 04:40:45PM -0700, Dhinakaran Pandiyan wrote:
> Currently we restrict the number of encoders that can be linked to
> a connector to 3, increase it to match the maximum number of encoders
> that can be initialized - 32. The current limitation looks artificial.
> Increasing the limit to 32 does however increases the size of the static
> u32 array keeping track of the encoder IDs.
> 
> Cc: José Roberto de Souza <jose.souza@intel.com>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: dri-devel@lists.freedesktop.org
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> ---
>  include/drm/drm_connector.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> index ca745d9feaf5..91455b4a9360 100644
> --- a/include/drm/drm_connector.h
> +++ b/include/drm/drm_connector.h
> @@ -1278,7 +1278,7 @@ struct drm_connector {
>  	/** @override_edid: has the EDID been overwritten through debugfs for testing? */
>  	bool override_edid;
>  
> -#define DRM_CONNECTOR_MAX_ENCODER 3
> +#define DRM_CONNECTOR_MAX_ENCODER 32
>  	/**
>  	 * @encoder_ids: Valid encoders for this connector. Please only use
>  	 * drm_connector_for_each_possible_encoder() to enumerate these.

I wonder if we couldn't just replace this array with a bitmask?
I think the for_each_possible_encoder() thing I did a while back
should make this easier potentially because most driver code just
uses that.
Daniel Vetter June 26, 2019, 2:31 p.m. UTC | #2
On Wed, Jun 26, 2019 at 04:43:28PM +0300, Ville Syrjälä wrote:
> On Tue, Jun 25, 2019 at 04:40:45PM -0700, Dhinakaran Pandiyan wrote:
> > Currently we restrict the number of encoders that can be linked to
> > a connector to 3, increase it to match the maximum number of encoders
> > that can be initialized - 32. The current limitation looks artificial.
> > Increasing the limit to 32 does however increases the size of the static
> > u32 array keeping track of the encoder IDs.
> > 
> > Cc: José Roberto de Souza <jose.souza@intel.com>
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > ---
> >  include/drm/drm_connector.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> > index ca745d9feaf5..91455b4a9360 100644
> > --- a/include/drm/drm_connector.h
> > +++ b/include/drm/drm_connector.h
> > @@ -1278,7 +1278,7 @@ struct drm_connector {
> >  	/** @override_edid: has the EDID been overwritten through debugfs for testing? */
> >  	bool override_edid;
> >  
> > -#define DRM_CONNECTOR_MAX_ENCODER 3
> > +#define DRM_CONNECTOR_MAX_ENCODER 32
> >  	/**
> >  	 * @encoder_ids: Valid encoders for this connector. Please only use
> >  	 * drm_connector_for_each_possible_encoder() to enumerate these.
> 
> I wonder if we couldn't just replace this array with a bitmask?
> I think the for_each_possible_encoder() thing I did a while back
> should make this easier potentially because most driver code just
> uses that.

+1 on possible encoders bitmask. More consistent at least.
-Daniel
Dhinakaran Pandiyan June 26, 2019, 7:48 p.m. UTC | #3
On Wed, 2019-06-26 at 16:31 +0200, Daniel Vetter wrote:
> On Wed, Jun 26, 2019 at 04:43:28PM +0300, Ville Syrjälä wrote:
> > On Tue, Jun 25, 2019 at 04:40:45PM -0700, Dhinakaran Pandiyan wrote:
> > > Currently we restrict the number of encoders that can be linked to
> > > a connector to 3, increase it to match the maximum number of encoders
> > > that can be initialized - 32. The current limitation looks artificial.
> > > Increasing the limit to 32 does however increases the size of the static
> > > u32 array keeping track of the encoder IDs.
> > > 
> > > Cc: José Roberto de Souza <jose.souza@intel.com>
> > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > Cc: dri-devel@lists.freedesktop.org
> > > Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
> > > ---
> > >  include/drm/drm_connector.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> > > index ca745d9feaf5..91455b4a9360 100644
> > > --- a/include/drm/drm_connector.h
> > > +++ b/include/drm/drm_connector.h
> > > @@ -1278,7 +1278,7 @@ struct drm_connector {
> > >  	/** @override_edid: has the EDID been overwritten through debugfs for
> > > testing? */
> > >  	bool override_edid;
> > >  
> > > -#define DRM_CONNECTOR_MAX_ENCODER 3
> > > +#define DRM_CONNECTOR_MAX_ENCODER 32
> > >  	/**
> > >  	 * @encoder_ids: Valid encoders for this connector. Please only use
> > >  	 * drm_connector_for_each_possible_encoder() to enumerate these.
> > 
> > I wonder if we couldn't just replace this array with a bitmask?
> > I think the for_each_possible_encoder() thing I did a while back
> > should make this easier potentially because most driver code just
> > uses that.
> 
> +1 on possible encoders bitmask. More consistent at least.

Agreed, I'll make this change.

-DK

> -Daniel
diff mbox series

Patch

diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
index ca745d9feaf5..91455b4a9360 100644
--- a/include/drm/drm_connector.h
+++ b/include/drm/drm_connector.h
@@ -1278,7 +1278,7 @@  struct drm_connector {
 	/** @override_edid: has the EDID been overwritten through debugfs for testing? */
 	bool override_edid;
 
-#define DRM_CONNECTOR_MAX_ENCODER 3
+#define DRM_CONNECTOR_MAX_ENCODER 32
 	/**
 	 * @encoder_ids: Valid encoders for this connector. Please only use
 	 * drm_connector_for_each_possible_encoder() to enumerate these.