[Intel-gfx] [PATCH 4/4] drm/i915/display: add i915 parameter to I915_STATE_WARN()

Jani Nikula jani.nikula at intel.com
Fri May 12 18:19:45 UTC 2023


On Fri, 12 May 2023, Rodrigo Vivi <rodrigo.vivi at kernel.org> wrote:
> On Fri, May 12, 2023 at 02:04:44PM +0300, Jani Nikula wrote:
>> Add i915 parameter to I915_STATE_WARN() and use device based logging.
>> 
>> Done using cocci + hand edited where there was no i915 local variable
>> ready.
>> 
>> Signed-off-by: Jani Nikula <jani.nikula at intel.com>
>
> with a bit of trust in coccinelle + compiler (for dev_priv vs i915 checks):

That was too much trust, as verify_connector_state() had crtc->base.dev
but it's possible the crtc is NULL. Caught by CI, hooray.

>> @@ -64,6 +65,7 @@ static void
>>  verify_connector_state(struct intel_atomic_state *state,
>>  		       struct intel_crtc *crtc)
>>  {
>> +	struct drm_i915_private *i915 = to_i915(crtc->base.dev);

crtc can be NULL here.

v2 in-reply to v1.

BR,
Jani.

>>  	struct drm_connector *connector;
>>  	struct drm_connector_state *new_conn_state;
>>  	int i;
>> @@ -80,7 +82,7 @@ verify_connector_state(struct intel_atomic_state *state,
>>  
>>  		intel_connector_verify_state(crtc_state, new_conn_state);
>>  
>> -		I915_STATE_WARN(new_conn_state->best_encoder != encoder,
>> +		I915_STATE_WARN(i915, new_conn_state->best_encoder != encoder,
>>  				"connector's atomic encoder doesn't match legacy encoder\n");
>>  	}
>>  }

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list