mirror of
https://github.com/torvalds/linux.git
synced 2026-04-30 04:22:32 -04:00
drm/amd/display: Added support for individual control for multiple back-light instances.
[Why & How] Added support for individual control for multiple back-light instances. Signed-off-by: Jake Wang <haonan.wang2@amd.com> Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -216,6 +216,23 @@ static inline void get_edp_links(const struct dc *dc,
|
||||
}
|
||||
}
|
||||
|
||||
static inline bool dc_get_edp_link_panel_inst(const struct dc *dc,
|
||||
const struct dc_link *link,
|
||||
unsigned int *inst_out)
|
||||
{
|
||||
struct dc_link *edp_links[MAX_NUM_EDP];
|
||||
int edp_num;
|
||||
|
||||
if (link->connector_signal != SIGNAL_TYPE_EDP)
|
||||
return false;
|
||||
get_edp_links(dc, edp_links, &edp_num);
|
||||
if ((edp_num > 1) && (link->link_index > edp_links[0]->link_index))
|
||||
*inst_out = 1;
|
||||
else
|
||||
*inst_out = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Set backlight level of an embedded panel (eDP, LVDS).
|
||||
* backlight_pwm_u16_16 is unsigned 32 bit with 16 bit integer
|
||||
* and 16 bit fractional, where 1.0 is max backlight value.
|
||||
|
||||
@@ -172,16 +172,12 @@ static bool dmub_abm_set_level(struct abm *abm, uint32_t level)
|
||||
|
||||
static bool dmub_abm_init_config(struct abm *abm,
|
||||
const char *src,
|
||||
unsigned int bytes)
|
||||
unsigned int bytes,
|
||||
unsigned int inst)
|
||||
{
|
||||
union dmub_rb_cmd cmd;
|
||||
struct dc_context *dc = abm->ctx;
|
||||
uint32_t edp_id_count = dc->dc_edp_id_count;
|
||||
int i;
|
||||
uint8_t panel_mask = 0;
|
||||
|
||||
for (i = 0; i < edp_id_count; i++)
|
||||
panel_mask |= 0x01 << i;
|
||||
uint8_t panel_mask = 0x01 << inst;
|
||||
|
||||
// TODO: Optimize by only reading back final 4 bytes
|
||||
dmub_flush_buffer_mem(&dc->dmub_srv->dmub->scratch_mem_fb);
|
||||
|
||||
@@ -52,7 +52,8 @@ struct abm_funcs {
|
||||
unsigned int (*get_target_backlight)(struct abm *abm);
|
||||
bool (*init_abm_config)(struct abm *abm,
|
||||
const char *src,
|
||||
unsigned int bytes);
|
||||
unsigned int bytes,
|
||||
unsigned int inst);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user