Commit db7b0216 authored by Bhawanpreet Lakha's avatar Bhawanpreet Lakha Committed by Alex Deucher

drm/amd/display: Add DCN3 HUBP

Add support to program the DCN3 HUBP (Display to data fabric interface
pipe)

HW Blocks:

 +--------++------+
 | HUBBUB || HUBP |
 +--------++------+
        |
        v
    +--------+
    |  DPP   |
    +--------+
        |
        v
    +--------+
    |  MPC   |
    +--------+
        |
        v
    +-------+
    |  OPP  |
    +-------+
        |
        v
    +--------+
    |  OPTC  |
    +--------+
        |
        v
    +--------+       +--------+
    |  DIO   |       |  DCCG  |
    +--------+       +--------+
Signed-off-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 8f712e3e
......@@ -62,6 +62,9 @@ enum dc_plane_addr_type {
PLN_ADDR_TYPE_GRAPHICS = 0,
PLN_ADDR_TYPE_GRPH_STEREO,
PLN_ADDR_TYPE_VIDEO_PROGRESSIVE,
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
PLN_ADDR_TYPE_RGBEA
#endif
};
struct dc_plane_address {
......@@ -84,6 +87,16 @@ struct dc_plane_address {
PHYSICAL_ADDRESS_LOC right_meta_addr;
union large_integer right_dcc_const_color;
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
PHYSICAL_ADDRESS_LOC left_alpha_addr;
PHYSICAL_ADDRESS_LOC left_alpha_meta_addr;
union large_integer left_alpha_dcc_const_color;
PHYSICAL_ADDRESS_LOC right_alpha_addr;
PHYSICAL_ADDRESS_LOC right_alpha_meta_addr;
union large_integer right_alpha_dcc_const_color;
#endif
} grph_stereo;
/*video progressive*/
......@@ -96,6 +109,18 @@ struct dc_plane_address {
PHYSICAL_ADDRESS_LOC chroma_meta_addr;
union large_integer chroma_dcc_const_color;
} video_progressive;
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
struct {
PHYSICAL_ADDRESS_LOC addr;
PHYSICAL_ADDRESS_LOC meta_addr;
union large_integer dcc_const_color;
PHYSICAL_ADDRESS_LOC alpha_addr;
PHYSICAL_ADDRESS_LOC alpha_meta_addr;
union large_integer alpha_dcc_const_color;
} rgbea;
#endif
};
union large_integer page_table_base;
......@@ -131,9 +156,15 @@ struct dc_plane_dcc_param {
int meta_pitch;
bool independent_64b_blks;
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
uint8_t dcc_ind_blk;
#endif
int meta_pitch_c;
bool independent_64b_blks_c;
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
uint8_t dcc_ind_blk_c;
#endif
};
/*Displayable pixel format in fb*/
......@@ -169,6 +200,10 @@ enum surface_pixel_format {
SURFACE_PIXEL_FORMAT_GRPH_BGR101111_FIX,
SURFACE_PIXEL_FORMAT_GRPH_RGB111110_FLOAT,
SURFACE_PIXEL_FORMAT_GRPH_BGR101111_FLOAT,
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
SURFACE_PIXEL_FORMAT_GRPH_RGBE,
SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA,
#endif
SURFACE_PIXEL_FORMAT_VIDEO_BEGIN,
SURFACE_PIXEL_FORMAT_VIDEO_420_YCbCr =
SURFACE_PIXEL_FORMAT_VIDEO_BEGIN,
......
......@@ -326,6 +326,18 @@ void hubp1_program_pixel_format(
REG_UPDATE(DCSURF_SURFACE_CONFIG,
SURFACE_PIXEL_FORMAT, 119);
break;
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
case SURFACE_PIXEL_FORMAT_GRPH_RGBE:
REG_UPDATE_2(DCSURF_SURFACE_CONFIG,
SURFACE_PIXEL_FORMAT, 116,
ALPHA_PLANE_EN, 0);
break;
case SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA:
REG_UPDATE_2(DCSURF_SURFACE_CONFIG,
SURFACE_PIXEL_FORMAT, 116,
ALPHA_PLANE_EN, 1);
break;
#endif
default:
BREAK_TO_DEBUGGER();
break;
......
......@@ -336,6 +336,10 @@ void hubp2_program_size(
*/
use_pitch_c = format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN
&& format < SURFACE_PIXEL_FORMAT_SUBSAMPLE_END;
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
use_pitch_c = use_pitch_c
|| (format == SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA);
#endif
if (use_pitch_c) {
ASSERT(plane_size->chroma_pitch != 0);
/* Chroma pitch zero can cause system hang! */
......@@ -360,6 +364,10 @@ void hubp2_program_size(
PITCH, pitch, META_PITCH, meta_pitch);
use_pitch_c = format >= SURFACE_PIXEL_FORMAT_VIDEO_BEGIN;
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
use_pitch_c = use_pitch_c
|| (format == SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA);
#endif
if (use_pitch_c)
REG_UPDATE_2(DCSURF_SURFACE_PITCH_C,
PITCH_C, pitch_c, META_PITCH_C, meta_pitch_c);
......@@ -505,6 +513,18 @@ void hubp2_program_pixel_format(
REG_UPDATE(DCSURF_SURFACE_CONFIG,
SURFACE_PIXEL_FORMAT, 119);
break;
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
case SURFACE_PIXEL_FORMAT_GRPH_RGBE:
REG_UPDATE_2(DCSURF_SURFACE_CONFIG,
SURFACE_PIXEL_FORMAT, 116,
ALPHA_PLANE_EN, 0);
break;
case SURFACE_PIXEL_FORMAT_GRPH_RGBE_ALPHA:
REG_UPDATE_2(DCSURF_SURFACE_CONFIG,
SURFACE_PIXEL_FORMAT, 116,
ALPHA_PLANE_EN, 1);
break;
#endif
default:
BREAK_TO_DEBUGGER();
break;
......
......@@ -157,6 +157,12 @@
uint32_t VBLANK_PARAMETERS_5;\
uint32_t VBLANK_PARAMETERS_6
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
#define DCN30_HUBP_REG_COMMON_VARIABLE_LIST \
DCN21_HUBP_REG_COMMON_VARIABLE_LIST;\
uint32_t DCN_DMDATA_VM_CNTL
#endif
#define DCN2_HUBP_REG_FIELD_VARIABLE_LIST(type) \
DCN_HUBP_REG_FIELD_BASE_LIST(type); \
type DMDATA_ADDRESS_HIGH;\
......@@ -192,17 +198,52 @@
type REFCYC_PER_META_CHUNK_FLIP_C; \
type VM_GROUP_SIZE
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
#define DCN30_HUBP_REG_FIELD_VARIABLE_LIST(type) \
DCN21_HUBP_REG_FIELD_VARIABLE_LIST(type);\
type PRIMARY_SURFACE_DCC_IND_BLK;\
type SECONDARY_SURFACE_DCC_IND_BLK;\
type PRIMARY_SURFACE_DCC_IND_BLK_C;\
type SECONDARY_SURFACE_DCC_IND_BLK_C;\
type ALPHA_PLANE_EN;\
type REFCYC_PER_VM_DMDATA;\
type DMDATA_VM_FAULT_STATUS;\
type DMDATA_VM_FAULT_STATUS_CLEAR; \
type DMDATA_VM_UNDERFLOW_STATUS;\
type DMDATA_VM_LATE_STATUS;\
type DMDATA_VM_UNDERFLOW_STATUS_CLEAR; \
type DMDATA_VM_DONE; \
type CROSSBAR_SRC_Y_G; \
type CROSSBAR_SRC_ALPHA; \
type PACK_3TO2_ELEMENT_DISABLE; \
type ROW_TTU_MODE; \
type NUM_PKRS
#endif
struct dcn_hubp2_registers {
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
DCN30_HUBP_REG_COMMON_VARIABLE_LIST;
#else
DCN21_HUBP_REG_COMMON_VARIABLE_LIST;
#endif
};
struct dcn_hubp2_shift {
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
DCN30_HUBP_REG_FIELD_VARIABLE_LIST(uint8_t);
#else
DCN21_HUBP_REG_FIELD_VARIABLE_LIST(uint8_t);
#endif
};
struct dcn_hubp2_mask {
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
DCN30_HUBP_REG_FIELD_VARIABLE_LIST(uint32_t);
#else
DCN21_HUBP_REG_FIELD_VARIABLE_LIST(uint32_t);
#endif
};
struct dcn20_hubp {
......
This diff is collapsed.
This diff is collapsed.
......@@ -48,6 +48,10 @@ enum cursor_lines_per_chunk {
enum hubp_ind_block_size {
hubp_ind_block_unconstrained = 0,
hubp_ind_block_64b,
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
hubp_ind_block_128b,
hubp_ind_block_64b_no_128bcl,
#endif
};
struct hubp {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment