> -----Original Message----- > From: Aaron Ma <[email protected]> > Sent: Friday, September 26, 2025 3:23 PM > To: Kandpal, Suraj <[email protected]> > Cc: [email protected]; [email protected]; linux- > [email protected]; [email protected]; > [email protected]; [email protected]; [email protected]; > [email protected]; [email protected]; Vivi, Rodrigo > <[email protected]>; Deak, Imre <[email protected]>; > [email protected] > Subject: Re: [PATCH 2/2] drm/i915/backlight: Add get brightness support of > DPCD via AUX > > On Fri, Sep 26, 2025 at 5:26 PM Kandpal, Suraj <[email protected]> > wrote: > > > > > Subject: [PATCH 2/2] drm/i915/backlight: Add get brightness support > > > of DPCD via AUX > > > > > > Use drm common helper to read brightness from both luminance and AUX > > > mode to support get_brightness from DPCD via AUX. > > > > > > Signed-off-by: Aaron Ma <[email protected]> > > > --- > > > .../drm/i915/display/intel_dp_aux_backlight.c | 20 > > > ++++++------------- > > > 1 file changed, 6 insertions(+), 14 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c > > > b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c > > > index 0a3a3f6a5f9d8..0ee6fd0f41ef0 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c > > > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c > > > @@ -454,24 +454,16 @@ static u32 > > > intel_dp_aux_vesa_get_backlight(struct > > > intel_connector *connector, en { > > > struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder); > > > struct intel_panel *panel = &connector->panel; > > > - u8 buf[3]; > > > - u32 val = 0; > > > - int ret; > > > > > > - if (panel->backlight.edp.vesa.luminance_control_support) { > > > - ret = drm_dp_dpcd_read(&intel_dp->aux, > > > DP_EDP_PANEL_TARGET_LUMINANCE_VALUE, buf, > > > - sizeof(buf)); > > > - if (ret < 0) { > > > - drm_err(intel_dp->aux.drm_dev, > > > - "[CONNECTOR:%d:%s] Failed to read > > > Luminance from DPCD\n", > > > - connector->base.base.id, connector- > > > >base.name); > > > - return 0; > > > - } > > > + if (!panel->backlight.edp.vesa.info.aux_set) { > > > + u32 pwm_level = > > > + panel->backlight.pwm_funcs->get(connector, > > > unused); > > > > > > - val |= buf[0] | buf[1] << 8 | buf[2] << 16; > > > - return val / 1000; > > > + return intel_backlight_level_from_pwm(connector, > > > pwm_level); > > > } > > > > > > + connector->panel.backlight.level = > > > + drm_edp_backlight_get_level(&intel_dp->aux, > > > +&panel->backlight.edp.vesa.info); > > > + > > > > Just call the intel_dp_aux_vesa_get_backlight here and call the > > drm_edp_backlight get level in there > > > > Do you mean no call of pwm get? > > I thought it should be aligned with set_level when aux_set == 0.
I misunderstood the code here its as it should be the diff just made it seem weird Regards, Suraj Kandpal > > Thanks, > Aaron > > > Regards, > > Suraj Kandpal > > > > > > > return connector->panel.backlight.level; } > > > > > > -- > > > 2.43.0 > >
