[Intel-gfx] [PATCH v2 06/41] drm/connector: Rename legacy TV property

Noralf Trønnes noralf at tronnes.org
Tue Aug 30 19:27:22 UTC 2022



Den 29.08.2022 15.11, skrev Maxime Ripard:
> The current tv_mode has driver-specific values that don't allow to
> 
> easily share code using it, either at the userspace or kernel level.
> 
> 
> 
> Since we're going to introduce a new, generic, property that fit the
> 
> same purpose, let's rename this one to legacy_tv_mode to make it
> 
> obvious we should move away from it.
> 
> 
> 
> Signed-off-by: Maxime Ripard <maxime at cerno.tech>
> 

> diff --git a/include/drm/drm_connector.h b/include/drm/drm_connector.h
> 
> index 1d5e3cccb9e3..5cfad8b6ad83 100644
> 
> --- a/include/drm/drm_connector.h
> 
> +++ b/include/drm/drm_connector.h
> 
> @@ -695,7 +695,7 @@ struct drm_connector_tv_margins {
> 
>   * @select_subconnector: selected subconnector
> 
>   * @subconnector: detected subconnector
> 
>   * @margins: TV margins
> 
> - * @mode: TV mode
> 
> + * @legacy_mode: Legacy TV mode, driver specific value
> 
>   * @brightness: brightness in percent
> 
>   * @contrast: contrast in percent
> 
>   * @flicker_reduction: flicker reduction in percent
> 
> @@ -707,7 +707,7 @@ struct drm_tv_connector_state {
> 
>  	enum drm_mode_subconnector select_subconnector;
> 
>  	enum drm_mode_subconnector subconnector;
> 
>  	struct drm_connector_tv_margins margins;
> 
> -	unsigned int mode;
> 
> +	unsigned int legacy_mode;

I suggest you do a build of the affected drivers after adding this patch
to make sure you have changed all mode -> legacy_mode occurrences
_before_ adding back mode in a later patch.

A simple grep gave me these:

drivers/gpu/drm/vc4/vc4_vec.c:
vc4_vec_tv_modes[state->tv.mode].mode);
drivers/gpu/drm/vc4/vc4_vec.c:  vec->tv_mode =
&vc4_vec_tv_modes[conn_state->tv.mode];
drivers/gpu/drm/vc4/vc4_vec.c:  vec_mode =
&vc4_vec_tv_modes[conn_state->tv.mode];
drivers/gpu/drm/i915/display/intel_tv.c:        int format =
conn_state->tv.mode;
drivers/gpu/drm/i915/display/intel_tv.c:
connector->state->tv.mode = i;
drivers/gpu/drm/i915/display/intel_tv.c:        if (old_state->tv.mode
!= new_state->tv.mode ||
drivers/gpu/drm/i915/display/intel_tv.c:        state->tv.mode =
initial_mode;
drivers/gpu/drm/i915/display/intel_tv.c:
   state->tv.mode);
drivers/gpu/drm/i915/display/intel_sdvo.c:      format_map = 1 <<
conn_state->tv.mode;
drivers/gpu/drm/i915/display/intel_sdvo.c:      format_map = 1 <<
conn_state->tv.mode;
drivers/gpu/drm/i915/display/intel_sdvo.c:                      if
(state->tv.mode == intel_sdvo_connector->tv_format_supported[i]) {
drivers/gpu/drm/i915/display/intel_sdvo.c:              state->tv.mode =
intel_sdvo_connector->tv_format_supported[val];
drivers/gpu/drm/i915/display/intel_sdvo.c:
intel_sdvo_connector->base.base.state->tv.mode =
intel_sdvo_connector->tv_format_supported[0];

Not so easy to grep for is this in gud:

static unsigned int *gud_connector_tv_state_val(u16 prop, struct
drm_tv_connector_state *state)
{
	switch (prop) {
...
	case GUD_PROPERTY_TV_MODE:
		return &state->mode;

Noralf.

> 
>  	unsigned int brightness;
> 
>  	unsigned int contrast;
> 
>  	unsigned int flicker_reduction;
> 
> diff --git a/include/drm/drm_mode_config.h b/include/drm/drm_mode_config.h
> 
> index 6b5e01295348..35a827175c24 100644
> 
> --- a/include/drm/drm_mode_config.h
> 
> +++ b/include/drm/drm_mode_config.h
> 
> @@ -714,11 +714,13 @@ struct drm_mode_config {
> 
>  	 * between different TV connector types.
> 
>  	 */
> 
>  	struct drm_property *tv_select_subconnector_property;
> 
> +
> 
>  	/**
> 
> -	 * @tv_mode_property: Optional TV property to select
> 
> +	 * @legacy_tv_mode_property: Optional TV property to select
> 
>  	 * the output TV mode.
> 
>  	 */
> 
> -	struct drm_property *tv_mode_property;
> 
> +	struct drm_property *legacy_tv_mode_property;
> 
> +
> 
>  	/**
> 
>  	 * @tv_left_margin_property: Optional TV property to set the left
> 
>  	 * margin (expressed in pixels).
> 
> 
> 


More information about the Intel-gfx mailing list