Commit c802a6b8 authored by Suraj Kandpal's avatar Suraj Kandpal
Browse files

drm/dp: Add argument in drm_edp_backlight_init



Add bool argument in drm_edp_backlight init to provide the drivers
option to choose if they want to use luminance values to
manipulate brightness.

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-3-suraj.kandpal@intel.com
parent 2af612ad
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -4239,6 +4239,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
 * @edp_dpcd: A cached copy of the eDP DPCD
 * @current_level: Where to store the probed brightness level, if any
 * @current_mode: Where to store the currently set backlight control mode
 * @need_luminance: Tells us if a we want to manipulate backlight using luminance values
 *
 * Initializes a &drm_edp_backlight_info struct by probing @aux for it's backlight capabilities,
 * along with also probing the current and maximum supported brightness levels.
@@ -4251,7 +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,
		       u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
		       u16 *current_level, u8 *current_mode)
		       u16 *current_level, u8 *current_mode, bool need_luminance)
{
	int ret;

@@ -4262,7 +4263,7 @@ drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl
	if (edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT)
		bl->lsb_reg_used = true;
	if ((edp_dpcd[0] & DP_EDP_15) && edp_dpcd[3] &
	    (DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE))
	    (DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE) && need_luminance)
		bl->luminance_set = true;

	/* Sanity check caps */
@@ -4380,7 +4381,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,
				     &current_level, &current_mode);
				     &current_level, &current_mode, false);
	if (ret < 0)
		return ret;

+1 −1
Original line number Diff line number Diff line
@@ -600,7 +600,7 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
	} 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);
					     &current_level, &current_mode, false);
		if (ret < 0)
			return ret;

+1 −1
Original line number Diff line number Diff line
@@ -262,7 +262,7 @@ nv50_backlight_init(struct nouveau_backlight *bl,
				 nv_conn->base.name);

			ret = drm_edp_backlight_init(&nv_conn->aux, &bl->edp_info, 0, edp_dpcd,
						     &current_level, &current_mode);
						     &current_level, &current_mode, false);
			if (ret < 0)
				return ret;

+1 −1
Original line number Diff line number Diff line
@@ -855,7 +855,7 @@ struct drm_edp_backlight_info {
int
drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
		       u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
		       u16 *current_level, u8 *current_mode);
		       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,
				u16 level);
int drm_edp_backlight_enable(struct drm_dp_aux *aux, const struct drm_edp_backlight_info *bl,