drm/i915: Pass port to intel_panel_bl_funcs.get()
authorLyude Paul <lyude@redhat.com>
Thu, 14 Jan 2021 22:17:05 +0000 (17:17 -0500)
committerJani Nikula <jani.nikula@intel.com>
Fri, 15 Jan 2021 14:19:12 +0000 (16:19 +0200)
commit31b10c1a947d5c4b023591367cd4b08d158df531
treec2d5890b78790b954f0f06cf8b2dc1a270f6be0f
parenta1f6bfe1793141f817e5a49c3563bb222ea03e24
drm/i915: Pass port to intel_panel_bl_funcs.get()

In the next commit where we split PWM related backlight functions from
higher-level backlight functions, we'll want to be able to retrieve the
backlight level for the current display panel from the
intel_panel_bl_funcs->setup() function using pwm_funcs->get(). Since
intel_panel_bl_funcs->setup() is called before we've fully read in the
current hardware state into our atomic state, we can't grab atomic
modesetting locks safely anyway in intel_panel_bl_funcs->setup(), and some
PWM backlight functions (vlv_get_backlight() in particular) require knowing
the currently used pipe we need to be able to discern the current display
pipe through other means. Luckily, we're already passing the current
display pipe to intel_panel_bl_funcs->setup() so all we have to do in order
to achieve this is pass down that parameter to intel_panel_bl_funcs->get().

So, fix this by accepting an additional pipe parameter in
intel_panel_bl_funcs->get(), and leave figuring out the current display
pipe up to the caller.

Signed-off-by: Lyude Paul <lyude@redhat.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210114221709.2261452-2-lyude@redhat.com
drivers/gpu/drm/i915/display/intel_display_types.h
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
drivers/gpu/drm/i915/display/intel_dsi_dcs_backlight.c
drivers/gpu/drm/i915/display/intel_panel.c