[Intel-gfx] [PATCH 2/2] drm/i915: Make intel_get_crtc_new_encoder() less oopsy

Jani Nikula jani.nikula at linux.intel.com
Fri Apr 14 09:39:59 UTC 2023


On Fri, 14 Apr 2023, Jani Nikula <jani.nikula at linux.intel.com> wrote:
> On Thu, 13 Apr 2023, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
>> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>>
>> The point of the WARN was to print something, not oops
>> straight up. Currently that is precisely what happens
>> if we can't find the connector for the crtc in the atomic
>> state. Get the dev pointer from the atomic state instead
>> of the potentially NULL encoder to avoid that.
>
> Fixes: ?

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

>
>>
>> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_display.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
>> index 0334565cec82..5208b07505b2 100644
>> --- a/drivers/gpu/drm/i915/display/intel_display.c
>> +++ b/drivers/gpu/drm/i915/display/intel_display.c
>> @@ -959,7 +959,7 @@ intel_get_crtc_new_encoder(const struct intel_atomic_state *state,
>>  		num_encoders++;
>>  	}
>>  
>> -	drm_WARN(encoder->base.dev, num_encoders != 1,
>> +	drm_WARN(state->base.dev, num_encoders != 1,
>>  		 "%d encoders for pipe %c\n",
>>  		 num_encoders, pipe_name(master_crtc->pipe));

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list