mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
drm/amd/display: Implement DCE analog stream encoders
Add analog stream encoders for DCE which will be used when connecting an analog display through VGA or DVI-I. Considering that all stream encoder functions currently deal with digital streams, there is nothing for an analog stream encoder to do, making them basically a no-op. That being said, we still need some kind of stream encoder to represent an analog stream, and it is beneficial to split them from digital stream encoders in the code to make sure they don't accidentally write any DIG* registers. On supported chips there is currently up to 1 analog encoder, which is DACA. There are references to DACB in some code such as VBIOS commands and register files but it seems to be not present on DCE 6 and newer. Set num_analog_stream_encoder = 1 so that we can support the analog connectors on DCE 6-10, for now. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
5834c33fd3
commit
deb072d241
@@ -1567,3 +1567,17 @@ void dce110_stream_encoder_construct(
|
||||
enc110->se_shift = se_shift;
|
||||
enc110->se_mask = se_mask;
|
||||
}
|
||||
|
||||
static const struct stream_encoder_funcs dce110_an_str_enc_funcs = {0};
|
||||
|
||||
void dce110_analog_stream_encoder_construct(
|
||||
struct dce110_stream_encoder *enc110,
|
||||
struct dc_context *ctx,
|
||||
struct dc_bios *bp,
|
||||
enum engine_id eng_id)
|
||||
{
|
||||
enc110->base.funcs = &dce110_an_str_enc_funcs;
|
||||
enc110->base.ctx = ctx;
|
||||
enc110->base.id = eng_id;
|
||||
enc110->base.bp = bp;
|
||||
}
|
||||
|
||||
@@ -708,6 +708,11 @@ void dce110_stream_encoder_construct(
|
||||
const struct dce_stream_encoder_shift *se_shift,
|
||||
const struct dce_stream_encoder_mask *se_mask);
|
||||
|
||||
void dce110_analog_stream_encoder_construct(
|
||||
struct dce110_stream_encoder *enc110,
|
||||
struct dc_context *ctx,
|
||||
struct dc_bios *bp,
|
||||
enum engine_id eng_id);
|
||||
|
||||
void dce110_se_audio_mute_control(
|
||||
struct stream_encoder *enc, bool mute);
|
||||
|
||||
@@ -375,6 +375,7 @@ static const struct bios_registers bios_regs = {
|
||||
static const struct resource_caps res_cap = {
|
||||
.num_timing_generator = 6,
|
||||
.num_audio = 6,
|
||||
.num_analog_stream_encoder = 1,
|
||||
.num_stream_encoder = 6,
|
||||
.num_pll = 3,
|
||||
.num_ddc = 6,
|
||||
@@ -486,6 +487,11 @@ static struct stream_encoder *dce100_stream_encoder_create(
|
||||
if (!enc110)
|
||||
return NULL;
|
||||
|
||||
if (eng_id == ENGINE_ID_DACA || eng_id == ENGINE_ID_DACB) {
|
||||
dce110_analog_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id);
|
||||
return &enc110->base;
|
||||
}
|
||||
|
||||
dce110_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id,
|
||||
&stream_enc_regs[eng_id], &se_shift, &se_mask);
|
||||
return &enc110->base;
|
||||
|
||||
@@ -373,6 +373,7 @@ static const struct bios_registers bios_regs = {
|
||||
static const struct resource_caps res_cap = {
|
||||
.num_timing_generator = 6,
|
||||
.num_audio = 6,
|
||||
.num_analog_stream_encoder = 1,
|
||||
.num_stream_encoder = 6,
|
||||
.num_pll = 3,
|
||||
.num_ddc = 6,
|
||||
@@ -382,6 +383,7 @@ static const struct resource_caps res_cap_61 = {
|
||||
.num_timing_generator = 4,
|
||||
.num_audio = 6,
|
||||
.num_stream_encoder = 6,
|
||||
.num_analog_stream_encoder = 1,
|
||||
.num_pll = 3,
|
||||
.num_ddc = 6,
|
||||
};
|
||||
@@ -389,6 +391,7 @@ static const struct resource_caps res_cap_61 = {
|
||||
static const struct resource_caps res_cap_64 = {
|
||||
.num_timing_generator = 2,
|
||||
.num_audio = 2,
|
||||
.num_analog_stream_encoder = 1,
|
||||
.num_stream_encoder = 2,
|
||||
.num_pll = 3,
|
||||
.num_ddc = 2,
|
||||
@@ -599,6 +602,11 @@ static struct stream_encoder *dce60_stream_encoder_create(
|
||||
if (!enc110)
|
||||
return NULL;
|
||||
|
||||
if (eng_id == ENGINE_ID_DACA || eng_id == ENGINE_ID_DACB) {
|
||||
dce110_analog_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id);
|
||||
return &enc110->base;
|
||||
}
|
||||
|
||||
dce110_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id,
|
||||
&stream_enc_regs[eng_id],
|
||||
&se_shift, &se_mask);
|
||||
|
||||
@@ -375,6 +375,7 @@ static const struct bios_registers bios_regs = {
|
||||
static const struct resource_caps res_cap = {
|
||||
.num_timing_generator = 6,
|
||||
.num_audio = 6,
|
||||
.num_analog_stream_encoder = 1,
|
||||
.num_stream_encoder = 6,
|
||||
.num_pll = 3,
|
||||
.num_ddc = 6,
|
||||
@@ -383,6 +384,7 @@ static const struct resource_caps res_cap = {
|
||||
static const struct resource_caps res_cap_81 = {
|
||||
.num_timing_generator = 4,
|
||||
.num_audio = 7,
|
||||
.num_analog_stream_encoder = 1,
|
||||
.num_stream_encoder = 7,
|
||||
.num_pll = 3,
|
||||
.num_ddc = 6,
|
||||
@@ -391,6 +393,7 @@ static const struct resource_caps res_cap_81 = {
|
||||
static const struct resource_caps res_cap_83 = {
|
||||
.num_timing_generator = 2,
|
||||
.num_audio = 6,
|
||||
.num_analog_stream_encoder = 1,
|
||||
.num_stream_encoder = 6,
|
||||
.num_pll = 2,
|
||||
.num_ddc = 2,
|
||||
@@ -607,6 +610,11 @@ static struct stream_encoder *dce80_stream_encoder_create(
|
||||
if (!enc110)
|
||||
return NULL;
|
||||
|
||||
if (eng_id == ENGINE_ID_DACA || eng_id == ENGINE_ID_DACB) {
|
||||
dce110_analog_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id);
|
||||
return &enc110->base;
|
||||
}
|
||||
|
||||
dce110_stream_encoder_construct(enc110, ctx, ctx->dc_bios, eng_id,
|
||||
&stream_enc_regs[eng_id],
|
||||
&se_shift, &se_mask);
|
||||
|
||||
Reference in New Issue
Block a user