Commit 81fd0141 authored by Suraj Kandpal's avatar Suraj Kandpal
Browse files

drm/dp: Add argument for max luminance in drm_edp_backlight_init



Add new argument to drm_edp_backlight_init which gives the
max_luminance which will be needed to set the max values for
backlight.

--v2
-Use pass only max luminance instead of luminance_range_info struct
[Arun]

Signed-off-by: default avatarSuraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: default avatarArun R Murthy <arun.r.murthy@intel.com>
Link: https://lore.kernel.org/r/20250620063445.3603086-4-suraj.kandpal@intel.com
parent c802a6b8
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4235,6 +4235,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
 * interface.
 * @aux: The DP aux device to use for probing
 * @bl: The &drm_edp_backlight_info struct to fill out with information on the backlight
 * @max_luminance: max luminance when need luminance is set as true
 * @driver_pwm_freq_hz: Optional PWM frequency from the driver in hz
 * @edp_dpcd: A cached copy of the eDP DPCD
 * @current_level: Where to store the probed brightness level, if any
@@ -4251,6 +4252,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
 */
int
drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
		       u32 max_luminance,
		       u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
		       u16 *current_level, u8 *current_mode, bool need_luminance)
{
@@ -4380,7 +4382,7 @@ int drm_panel_dp_aux_backlight(struct drm_panel *panel, struct drm_dp_aux *aux)

	bl->aux = aux;

	ret = drm_edp_backlight_init(aux, &bl->info, 0, edp_dpcd,
	ret = drm_edp_backlight_init(aux, &bl->info, 0, 0, edp_dpcd,
				     &current_level, &current_mode, false);
	if (ret < 0)
		return ret;
+4 −2
Original line number Diff line number Diff line
@@ -599,8 +599,10 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
			    connector->base.base.id, connector->base.name);
	} else {
		ret = drm_edp_backlight_init(&intel_dp->aux, &panel->backlight.edp.vesa.info,
					     panel->vbt.backlight.pwm_freq_hz, intel_dp->edp_dpcd,
					     &current_level, &current_mode, false);
					     luminance_range->max_luminance,
					     panel->vbt.backlight.pwm_freq_hz,
					     intel_dp->edp_dpcd, &current_level, &current_mode,
					     false);
		if (ret < 0)
			return ret;

+2 −1
Original line number Diff line number Diff line
@@ -261,7 +261,8 @@ nv50_backlight_init(struct nouveau_backlight *bl,
			NV_DEBUG(drm, "DPCD backlight controls supported on %s\n",
				 nv_conn->base.name);

			ret = drm_edp_backlight_init(&nv_conn->aux, &bl->edp_info, 0, edp_dpcd,
			ret = drm_edp_backlight_init(&nv_conn->aux, &bl->edp_info,
						     0, 0, edp_dpcd,
						     &current_level, &current_mode, false);
			if (ret < 0)
				return ret;
+1 −0
Original line number Diff line number Diff line
@@ -854,6 +854,7 @@ struct drm_edp_backlight_info {

int
drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
		       u32 max_luminance,
		       u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
		       u16 *current_level, u8 *current_mode, bool need_luminance);
int drm_edp_backlight_set_level(struct drm_dp_aux *aux, const struct drm_edp_backlight_info *bl,