summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
diff options
context:
space:
mode:
authorAnthony Koo <Anthony.Koo@amd.com>2020-03-28 01:44:14 -0400
committerAlex Deucher <alexander.deucher@amd.com>2020-04-22 18:11:48 -0400
commit904fb6e0f4e8158e6db1e21c3c97bdc238e537f5 (patch)
tree68d9e2d22032d3dc9f03a970bc5172e6c447e64c /drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
parentfefe92fe747ca74c6f127833188d4ff02d6f4e11 (diff)
downloadlinux-904fb6e0f4e8158e6db1e21c3c97bdc238e537f5.tar.gz
linux-904fb6e0f4e8158e6db1e21c3c97bdc238e537f5.tar.bz2
linux-904fb6e0f4e8158e6db1e21c3c97bdc238e537f5.zip
drm/amd/display: move panel power seq to new panel struct
[Why] panel power sequencer is currently just sitting in hwseq but it really it tied to internal panels [How] make a new panel struct to contain power sequencer code Signed-off-by: Anthony Koo <Anthony.Koo@amd.com> Reviewed-by: Tony Cheng <Tony.Cheng@amd.com> Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c')
-rw-r--r--drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
index 53ab88ef71f5..71f8431d5ae6 100644
--- a/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dce120/dce120_resource.c
@@ -44,6 +44,7 @@
#include "dce/dce_clock_source.h"
#include "dce/dce_ipp.h"
#include "dce/dce_mem_input.h"
+#include "dce/dce_panel.h"
#include "dce110/dce110_hw_sequencer.h"
#include "dce120/dce120_hw_sequencer.h"
@@ -293,6 +294,18 @@ static const struct dce_stream_encoder_mask se_mask = {
SE_COMMON_MASK_SH_LIST_DCE120(_MASK)
};
+static const struct dce_panel_registers panel_regs[] = {
+ { DCE_PANEL_REG_LIST() }
+};
+
+static const struct dce_panel_shift panel_shift = {
+ DCE_PANEL_MASK_SH_LIST(__SHIFT)
+};
+
+static const struct dce_panel_mask panel_mask = {
+ DCE_PANEL_MASK_SH_LIST(_MASK)
+};
+
static const struct dce110_aux_registers_shift aux_shift = {
DCE12_AUX_MASK_SH_LIST(__SHIFT)
};
@@ -715,6 +728,23 @@ static struct link_encoder *dce120_link_encoder_create(
return &enc110->base;
}
+static struct panel *dce120_panel_create(const struct panel_init_data *init_data)
+{
+ struct dce_panel *panel =
+ kzalloc(sizeof(struct dce_panel), GFP_KERNEL);
+
+ if (!panel)
+ return NULL;
+
+ dce_panel_construct(panel,
+ init_data,
+ &panel_regs[init_data->inst],
+ &panel_shift,
+ &panel_mask);
+
+ return &panel->base;
+}
+
static struct input_pixel_processor *dce120_ipp_create(
struct dc_context *ctx, uint32_t inst)
{
@@ -880,6 +910,7 @@ static void dce120_destroy_resource_pool(struct resource_pool **pool)
static const struct resource_funcs dce120_res_pool_funcs = {
.destroy = dce120_destroy_resource_pool,
.link_enc_create = dce120_link_encoder_create,
+ .panel_create = dce120_panel_create,
.validate_bandwidth = dce112_validate_bandwidth,
.validate_plane = dce100_validate_plane,
.add_stream_to_ctx = dce112_add_stream_to_ctx,