diff mbox series

[v4,4/7] drm/bridge: mhdp8546: Set input_bus_flags from atomic_check

Message ID 20201201121830.29704-5-nikhil.nd@ti.com (mailing list archive)
State New, archived
Headers show
Series drm/tidss: Use new connector model for tidss | expand

Commit Message

Nikhil Devshatwar Dec. 1, 2020, 12:18 p.m. UTC
input_bus_flags are specified in drm_bridge_timings (legacy) as well
as drm_bridge_state->input_bus_cfg.flags

The flags from the timings will be deprecated. Bridges are supposed
to validate and set the bridge state flags from atomic_check.

Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
---
 drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++++
 drivers/gpu/drm/bridge/ti-tfp410.c                  | 1 +
 2 files changed, 7 insertions(+)

Comments

Boris Brezillon Dec. 4, 2020, 10:32 a.m. UTC | #1
On Tue, 1 Dec 2020 17:48:27 +0530
Nikhil Devshatwar <nikhil.nd@ti.com> wrote:

> input_bus_flags are specified in drm_bridge_timings (legacy) as well
> as drm_bridge_state->input_bus_cfg.flags
> 
> The flags from the timings will be deprecated. Bridges are supposed
> to validate and set the bridge state flags from atomic_check.
> 
> Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
> ---
>  drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++++
>  drivers/gpu/drm/bridge/ti-tfp410.c                  | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> index 2cd809eed827..9c17e4bb517e 100644
> --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> @@ -2121,6 +2121,12 @@ static int cdns_mhdp_atomic_check(struct drm_bridge *bridge,
>  		return -EINVAL;
>  	}
>  
> +	/*
> +	 * There might be flags negotiation supported in future
> +	 * Set the bus flags in atomic_check statically for now
> +	 */
> +	bridge_state->input_bus_cfg.flags = bridge->timings->input_bus_flags;
> +
>  	mutex_unlock(&mhdp->link_mutex);
>  	return 0;
>  }
> diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
> index 4c536df003c8..9035d2145a28 100644
> --- a/drivers/gpu/drm/bridge/ti-tfp410.c
> +++ b/drivers/gpu/drm/bridge/ti-tfp410.c
> @@ -245,6 +245,7 @@ int tfp410_atomic_check(struct drm_bridge *bridge,
>  	 * Set the bus flags in atomic_check statically for now
>  	 */
>  	bridge_state->input_bus_cfg.flags = dvi->timings.input_bus_flags;
> +	return 0;

And here is the return statement that was missing in patch 2 :-).

>  }
>  
>  static const struct drm_bridge_funcs tfp410_bridge_funcs = {
Boris Brezillon Dec. 4, 2020, 10:42 a.m. UTC | #2
On Tue, 1 Dec 2020 17:48:27 +0530
Nikhil Devshatwar <nikhil.nd@ti.com> wrote:

> input_bus_flags are specified in drm_bridge_timings (legacy) as well
> as drm_bridge_state->input_bus_cfg.flags
> 
> The flags from the timings will be deprecated. Bridges are supposed
> to validate and set the bridge state flags from atomic_check.
> 
> Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
> ---
>  drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++++
>  drivers/gpu/drm/bridge/ti-tfp410.c                  | 1 +
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> index 2cd809eed827..9c17e4bb517e 100644
> --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> @@ -2121,6 +2121,12 @@ static int cdns_mhdp_atomic_check(struct drm_bridge *bridge,
>  		return -EINVAL;
>  	}
>  
> +	/*
> +	 * There might be flags negotiation supported in future
> +	 * Set the bus flags in atomic_check statically for now
> +	 */
> +	bridge_state->input_bus_cfg.flags = bridge->timings->input_bus_flags;

I'd go even further and replace the timings field in
cdns_mhdp_platform_info by an input_bus_flags field, you'll then
have the following assignment here.

	if (mhdp->info)
		bridge_state->input_bus_cfg.flags = mhdp->info->input_bus_flags;

This way you no rely on the bridge->timings presence and can
get rid of the mhdp->bridge.timings assignment in the probe path.


> +
>  	mutex_unlock(&mhdp->link_mutex);
>  	return 0;
>  }
Nikhil Devshatwar Dec. 7, 2020, 1:23 p.m. UTC | #3
On 11:32-20201204, Boris Brezillon wrote:
> On Tue, 1 Dec 2020 17:48:27 +0530
> Nikhil Devshatwar <nikhil.nd@ti.com> wrote:
> 
> > input_bus_flags are specified in drm_bridge_timings (legacy) as well
> > as drm_bridge_state->input_bus_cfg.flags
> > 
> > The flags from the timings will be deprecated. Bridges are supposed
> > to validate and set the bridge state flags from atomic_check.
> > 
> > Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
> > ---
> >  drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++++
> >  drivers/gpu/drm/bridge/ti-tfp410.c                  | 1 +
> >  2 files changed, 7 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> > index 2cd809eed827..9c17e4bb517e 100644
> > --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> > +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> > @@ -2121,6 +2121,12 @@ static int cdns_mhdp_atomic_check(struct drm_bridge *bridge,
> >  		return -EINVAL;
> >  	}
> >  
> > +	/*
> > +	 * There might be flags negotiation supported in future
> > +	 * Set the bus flags in atomic_check statically for now
> > +	 */
> > +	bridge_state->input_bus_cfg.flags = bridge->timings->input_bus_flags;
> > +
> >  	mutex_unlock(&mhdp->link_mutex);
> >  	return 0;
> >  }
> > diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
> > index 4c536df003c8..9035d2145a28 100644
> > --- a/drivers/gpu/drm/bridge/ti-tfp410.c
> > +++ b/drivers/gpu/drm/bridge/ti-tfp410.c
> > @@ -245,6 +245,7 @@ int tfp410_atomic_check(struct drm_bridge *bridge,
> >  	 * Set the bus flags in atomic_check statically for now
> >  	 */
> >  	bridge_state->input_bus_cfg.flags = dvi->timings.input_bus_flags;
> > +	return 0;
> 
> And here is the return statement that was missing in patch 2 :-).

Sorry. I guess I messed up while rebasing. Will fix this

Nikhil D

> 
> >  }
> >  
> >  static const struct drm_bridge_funcs tfp410_bridge_funcs = {
>
Nikhil Devshatwar Dec. 7, 2020, 1:25 p.m. UTC | #4
On 11:42-20201204, Boris Brezillon wrote:
> On Tue, 1 Dec 2020 17:48:27 +0530
> Nikhil Devshatwar <nikhil.nd@ti.com> wrote:
> 
> > input_bus_flags are specified in drm_bridge_timings (legacy) as well
> > as drm_bridge_state->input_bus_cfg.flags
> > 
> > The flags from the timings will be deprecated. Bridges are supposed
> > to validate and set the bridge state flags from atomic_check.
> > 
> > Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com>
> > ---
> >  drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 6 ++++++
> >  drivers/gpu/drm/bridge/ti-tfp410.c                  | 1 +
> >  2 files changed, 7 insertions(+)
> > 
> > diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> > index 2cd809eed827..9c17e4bb517e 100644
> > --- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> > +++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
> > @@ -2121,6 +2121,12 @@ static int cdns_mhdp_atomic_check(struct drm_bridge *bridge,
> >  		return -EINVAL;
> >  	}
> >  
> > +	/*
> > +	 * There might be flags negotiation supported in future
> > +	 * Set the bus flags in atomic_check statically for now
> > +	 */
> > +	bridge_state->input_bus_cfg.flags = bridge->timings->input_bus_flags;
> 
> I'd go even further and replace the timings field in
> cdns_mhdp_platform_info by an input_bus_flags field, you'll then
> have the following assignment here.
> 
> 	if (mhdp->info)
> 		bridge_state->input_bus_cfg.flags = mhdp->info->input_bus_flags;
> 
> This way you no rely on the bridge->timings presence and can
> get rid of the mhdp->bridge.timings assignment in the probe path.
> 

Okay, I'll update this patch

> 
> > +
> >  	mutex_unlock(&mhdp->link_mutex);
> >  	return 0;
> >  }
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
index 2cd809eed827..9c17e4bb517e 100644
--- a/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
+++ b/drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c
@@ -2121,6 +2121,12 @@  static int cdns_mhdp_atomic_check(struct drm_bridge *bridge,
 		return -EINVAL;
 	}
 
+	/*
+	 * There might be flags negotiation supported in future
+	 * Set the bus flags in atomic_check statically for now
+	 */
+	bridge_state->input_bus_cfg.flags = bridge->timings->input_bus_flags;
+
 	mutex_unlock(&mhdp->link_mutex);
 	return 0;
 }
diff --git a/drivers/gpu/drm/bridge/ti-tfp410.c b/drivers/gpu/drm/bridge/ti-tfp410.c
index 4c536df003c8..9035d2145a28 100644
--- a/drivers/gpu/drm/bridge/ti-tfp410.c
+++ b/drivers/gpu/drm/bridge/ti-tfp410.c
@@ -245,6 +245,7 @@  int tfp410_atomic_check(struct drm_bridge *bridge,
 	 * Set the bus flags in atomic_check statically for now
 	 */
 	bridge_state->input_bus_cfg.flags = dvi->timings.input_bus_flags;
+	return 0;
 }
 
 static const struct drm_bridge_funcs tfp410_bridge_funcs = {