drm/i915: Make intel_get_crtc_new_encoder() less oopsy
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 13 Apr 2023 20:06:02 +0000 (23:06 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:16 +0000 (23:03 +0900)
commit0fe6ef82e4f4764e8f556632e4cd93d78d448e99
treef86c7f9c886386df34e359ef92cc2ea53c6af3bf
parentfc2b20c0921f33906d6c54ecaca7b46f2721c493
drm/i915: Make intel_get_crtc_new_encoder() less oopsy

[ Upstream commit 631420b06597a33c72b6dcef78d1c2dea17f452d ]

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.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230413200602.6037-2-ville.syrjala@linux.intel.com
Fixes: 3a47ae201e07 ("drm/i915/display: Make WARN* drm specific where encoder ptr is available")
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
(cherry picked from commit 3b6692357f70498f617ea1b31a0378070a0acf1c)
Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/i915/display/intel_display.c