[Intel-gfx] [PATCH 13/14] drm/i915: Give encoders useful names

Jani Nikula jani.nikula at linux.intel.com
Wed Dec 9 05:50:08 PST 2015


On Wed, 09 Dec 2015, Ville Syrjälä <ville.syrjala at linux.intel.com> wrote:
> On Wed, Dec 09, 2015 at 10:35:24AM +0200, Jani Nikula wrote:
>> On Tue, 08 Dec 2015, ville.syrjala at linux.intel.com wrote:
>> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>> >
>> > Rather than let the core generate usless encoder names, let's pass in
>> > something that actually identifies the piece of hardware we're dealing
>> > with.
>> >
>> > Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
>> 
>> > diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
>> > index fff9a66c32a1..9b064a15a8e2 100644
>> > --- a/drivers/gpu/drm/i915/intel_dsi.c
>> > +++ b/drivers/gpu/drm/i915/intel_dsi.c
>> > @@ -1111,6 +1111,19 @@ static const struct drm_connector_funcs intel_dsi_connector_funcs = {
>> >  	.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
>> >  };
>> >  
>> > +static char intel_dsi_port_name(const struct drm_i915_private *dev_priv)
>> > +{
>> > +	switch (dev_priv->vbt.dsi.port) {
>> > +	case DVO_PORT_MIPIA:
>> > +		return 'A';
>> > +	case DVO_PORT_MIPIC:
>> > +		return 'C';
>> > +	default:
>> > +		MISSING_CASE(dev_priv->vbt.dsi.port);
>> > +		return '?';
>> > +	}
>> > +}
>> > +
>> >  void intel_dsi_init(struct drm_device *dev)
>> >  {
>> >  	struct intel_dsi *intel_dsi;
>> > @@ -1153,7 +1166,7 @@ void intel_dsi_init(struct drm_device *dev)
>> >  	connector = &intel_connector->base;
>> >  
>> >  	drm_encoder_init(dev, encoder, &intel_dsi_funcs, DRM_MODE_ENCODER_DSI,
>> > -			 NULL);
>> > +			 "MIPI %c", intel_dsi_port_name(dev_priv));
>> 
>> Did you plant that on purpose to tick me off? From here on out I'll
>> insist we refer to VESA, embedded VESA, and VESA MST. Only half
>> kidding. :/
>
> I was thinking it should match what the spec calls it in most cases
> (which is why I almost left out the space too, but then I figured it's
> easier to read with the space). I could make it "MIPI [sic] %c" :P

Yeah, also rename our register macros (that are straight from the spec)
as MIPI_SIC_FOO. ;)

>
> But, if you prefer to call it "DSI %c" instead, I can change it.

Yes, DSI or MIPI DSI please.

BR,
Jani.

>
>> 
>> BR,
>> Jani.
>> 
>> 
>> >  
>> >  	intel_encoder->compute_config = intel_dsi_compute_config;
>> >  	intel_encoder->pre_enable = intel_dsi_pre_enable;
>> 
>> -- 
>> Jani Nikula, Intel Open Source Technology Center

-- 
Jani Nikula, Intel Open Source Technology Center


More information about the dri-devel mailing list