disp: msm: dsi: add support to update brightness through drm prop
Add support to update display brightness through drm property. Change-Id: I1954e040060a00014aae2486700dbf270147c6b0 Signed-off-by: Anand Tarakh <quic_atarakh@quicinc.com>
This commit is contained in:
@@ -237,6 +237,7 @@ enum msm_mdp_conn_property {
|
|||||||
CONNECTOR_PROP_DIMMING_MIN_BL,
|
CONNECTOR_PROP_DIMMING_MIN_BL,
|
||||||
CONNECTOR_PROP_EARLY_FENCE_LINE,
|
CONNECTOR_PROP_EARLY_FENCE_LINE,
|
||||||
CONNECTOR_PROP_DYN_TRANSFER_TIME,
|
CONNECTOR_PROP_DYN_TRANSFER_TIME,
|
||||||
|
CONNECTOR_PROP_BRIGHTNESS,
|
||||||
|
|
||||||
/* enum/bitmask properties */
|
/* enum/bitmask properties */
|
||||||
CONNECTOR_PROP_TOPOLOGY_NAME,
|
CONNECTOR_PROP_TOPOLOGY_NAME,
|
||||||
|
@@ -956,6 +956,7 @@ static int _sde_connector_update_dirty_properties(
|
|||||||
struct sde_connector *c_conn;
|
struct sde_connector *c_conn;
|
||||||
struct sde_connector_state *c_state;
|
struct sde_connector_state *c_state;
|
||||||
int idx;
|
int idx;
|
||||||
|
u32 b_lvl;
|
||||||
|
|
||||||
if (!connector) {
|
if (!connector) {
|
||||||
SDE_ERROR("invalid argument\n");
|
SDE_ERROR("invalid argument\n");
|
||||||
@@ -979,6 +980,11 @@ static int _sde_connector_update_dirty_properties(
|
|||||||
case CONNECTOR_PROP_HDR_METADATA:
|
case CONNECTOR_PROP_HDR_METADATA:
|
||||||
_sde_connector_update_hdr_metadata(c_conn, c_state);
|
_sde_connector_update_hdr_metadata(c_conn, c_state);
|
||||||
break;
|
break;
|
||||||
|
case CONNECTOR_PROP_BRIGHTNESS:
|
||||||
|
b_lvl = sde_connector_get_property(connector->state,
|
||||||
|
CONNECTOR_PROP_BRIGHTNESS);
|
||||||
|
backlight_device_set_brightness(c_conn->bl_device, b_lvl);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
/* nothing to do for most properties */
|
/* nothing to do for most properties */
|
||||||
break;
|
break;
|
||||||
@@ -3323,6 +3329,15 @@ static int _sde_connector_install_properties(struct drm_device *dev,
|
|||||||
ARRAY_SIZE(e_power_mode), 0,
|
ARRAY_SIZE(e_power_mode), 0,
|
||||||
CONNECTOR_PROP_LP);
|
CONNECTOR_PROP_LP);
|
||||||
|
|
||||||
|
if (connector_type == DRM_MODE_CONNECTOR_DSI) {
|
||||||
|
dsi_display = (struct dsi_display *)(display);
|
||||||
|
if (dsi_display && dsi_display->panel) {
|
||||||
|
msm_property_install_range(&c_conn->property_info, "brightness",
|
||||||
|
0x0, 0, dsi_display->panel->bl_config.brightness_max_level, 0,
|
||||||
|
CONNECTOR_PROP_BRIGHTNESS);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user