[Intel-gfx] [PATCH 06/10] drm/i915: Introduce intel_crtc_is_bigjoiner_{slave, master}()

Ville Syrjälä ville.syrjala at linux.intel.com
Mon Feb 7 07:31:58 UTC 2022


On Fri, Feb 04, 2022 at 01:27:54PM -0800, Navare, Manasi wrote:
> On Thu, Feb 03, 2022 at 08:38:19PM +0200, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> > 
> > Introduce helpers to query whether the crtc is the slave/master
> > for bigjoiner. This decouples most places from the exact
> > state layout we use to track this relationship, allowing us
> > to change and extend it more easily.
> 
> So even with the bitmask approach, we still plan to have bools for bigjoiner_slave?

Nope. No longer necessary.

> 
> > 
> > Performed with cocci:
> > @@
> > expression S, E;
> > @@
> > (
> >   S->bigjoiner_slave = E;
> > |
> > - S->bigjoiner_slave
> > + intel_crtc_is_bigjoiner_slave(S)
> > )
> > 
> > @@
> > expression S, E;
> > @@
> > (
> > - E && S->bigjoiner && !intel_crtc_is_bigjoiner_slave(S)
> > + E && intel_crtc_is_bigjoiner_master(S)
> > |
> > - S->bigjoiner && !intel_crtc_is_bigjoiner_slave(S)
> > + intel_crtc_is_bigjoiner_master(S)
> > )
> > 
> > @@
> > expression S;
> > @@
> > - (intel_crtc_is_bigjoiner_master(S))
> > + intel_crtc_is_bigjoiner_master(S)
> > 
> > @@
> > expression S, E1, E2, E3;
> > @@
> > - intel_crtc_is_bigjoiner_slave(S) ? E1 : S->bigjoiner ? E2 : E3
> > + intel_crtc_is_bigjoiner_slave(S) ? E1 : intel_crtc_is_bigjoiner_master(S) ? E2 : E3
> > 
> > @@
> > typedef bool;
> > @@
> > + bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state)
> > + {
> > + 	return crtc_state->bigjoiner_slave;
> > + }
> > +
> >   intel_master_crtc(...) {...}
> > 
> > @@
> > typedef bool;
> > @@
> > + bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state *crtc_state)
> > + {
> > + 	return crtc_state->bigjoiner && !crtc_state->bigjoiner_slave;
> > + }
> > +
> >   intel_master_crtc(...) {...}
> > 
> > @@
> > typedef bool;
> > identifier S;
> > @@
> > - bool is_trans_port_sync_mode(const struct intel_crtc_state *S);
> > + bool is_trans_port_sync_mode(const struct intel_crtc_state *state);
> > + bool intel_crtc_is_bigjoiner_slave(const struct intel_crtc_state *crtc_state);
> > + bool intel_crtc_is_bigjoiner_master(const struct intel_crtc_state *crtc_state);
> 
> Is all of the above part of the commit message? Dont understand why its changing is_trans_port_sync_mode() ?

I had to touch that line to get coccinelle to actually do the
transformation. For some reason it refused to do anything if
I just tried to add the two new lines.

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list