Message ID | 20250117103450.28692-9-tzimmermann@suse.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | drm/ast: Reorganize TX-chip detection and init | expand |
On 17/01/2025 11:29, Thomas Zimmermann wrote: > Only Gen4 and later read the installed TX chip from the SoC. So only > warn on those generations about unsupported chips. Thanks, it looks good to me. Reviewed-by: Jocelyn Falempe <jfalempe@redhat.com> > > Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> > --- > drivers/gpu/drm/ast/ast_main.c | 40 +++++++++++++++++++--------------- > 1 file changed, 22 insertions(+), 18 deletions(-) > > diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c > index b0d1b99ed532b..ba69280b33e78 100644 > --- a/drivers/gpu/drm/ast/ast_main.c > +++ b/drivers/gpu/drm/ast/ast_main.c > @@ -78,21 +78,6 @@ static void ast_detect_tx_chip(struct ast_device *ast, bool need_post) > struct drm_device *dev = &ast->base; > u8 vgacra3, vgacrd1; > > - /* > - * Several of the listed TX chips are not explicitly supported > - * by the ast driver. If these exist in real-world devices, they > - * are most likely reported as VGA or SIL164 outputs. We warn here > - * to get bug reports for these devices. If none come in for some > - * time, we can begin to fail device probing on these values. > - */ > - vgacrd1 = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd1, AST_IO_VGACRD1_TX_TYPE_MASK); > - drm_WARN(dev, vgacrd1 == AST_IO_VGACRD1_TX_ITE66121_VBIOS, > - "ITE IT66121 detected, 0x%x, Gen%lu\n", vgacrd1, AST_GEN(ast)); > - drm_WARN(dev, vgacrd1 == AST_IO_VGACRD1_TX_CH7003_VBIOS, > - "Chrontel CH7003 detected, 0x%x, Gen%lu\n", vgacrd1, AST_GEN(ast)); > - drm_WARN(dev, vgacrd1 == AST_IO_VGACRD1_TX_ANX9807_VBIOS, > - "Analogix ANX9807 detected, 0x%x, Gen%lu\n", vgacrd1, AST_GEN(ast)); > - > /* Check 3rd Tx option (digital output afaik) */ > ast->tx_chip = AST_TX_NONE; > > @@ -116,9 +101,9 @@ static void ast_detect_tx_chip(struct ast_device *ast, bool need_post) > * the SOC scratch register #1 bits 11:8 (interestingly marked > * as "reserved" in the spec) > */ > - jreg = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd1, > - AST_IO_VGACRD1_TX_TYPE_MASK); > - switch (jreg) { > + vgacrd1 = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd1, > + AST_IO_VGACRD1_TX_TYPE_MASK); > + switch (vgacrd1) { > /* > * GEN4 to GEN6 > */ > @@ -144,6 +129,25 @@ static void ast_detect_tx_chip(struct ast_device *ast, bool need_post) > case AST_IO_VGACRD1_TX_ASTDP: > ast->tx_chip = AST_TX_ASTDP; > break; > + /* > + * Several of the listed TX chips are not explicitly supported > + * by the ast driver. If these exist in real-world devices, they > + * are most likely reported as VGA or SIL164 outputs. We warn here > + * to get bug reports for these devices. If none come in for some > + * time, we can begin to fail device probing on these values. > + */ > + case AST_IO_VGACRD1_TX_ITE66121_VBIOS: > + drm_warn(dev, "ITE IT66121 detected, 0x%x, Gen%lu\n", > + vgacrd1, AST_GEN(ast)); > + break; > + case AST_IO_VGACRD1_TX_CH7003_VBIOS: > + drm_warn(dev, "Chrontel CH7003 detected, 0x%x, Gen%lu\n", > + vgacrd1, AST_GEN(ast)); > + break; > + case AST_IO_VGACRD1_TX_ANX9807_VBIOS: > + drm_warn(dev, "Analogix ANX9807 detected, 0x%x, Gen%lu\n", > + vgacrd1, AST_GEN(ast)); > + break; > } > } >
diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index b0d1b99ed532b..ba69280b33e78 100644 --- a/drivers/gpu/drm/ast/ast_main.c +++ b/drivers/gpu/drm/ast/ast_main.c @@ -78,21 +78,6 @@ static void ast_detect_tx_chip(struct ast_device *ast, bool need_post) struct drm_device *dev = &ast->base; u8 vgacra3, vgacrd1; - /* - * Several of the listed TX chips are not explicitly supported - * by the ast driver. If these exist in real-world devices, they - * are most likely reported as VGA or SIL164 outputs. We warn here - * to get bug reports for these devices. If none come in for some - * time, we can begin to fail device probing on these values. - */ - vgacrd1 = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd1, AST_IO_VGACRD1_TX_TYPE_MASK); - drm_WARN(dev, vgacrd1 == AST_IO_VGACRD1_TX_ITE66121_VBIOS, - "ITE IT66121 detected, 0x%x, Gen%lu\n", vgacrd1, AST_GEN(ast)); - drm_WARN(dev, vgacrd1 == AST_IO_VGACRD1_TX_CH7003_VBIOS, - "Chrontel CH7003 detected, 0x%x, Gen%lu\n", vgacrd1, AST_GEN(ast)); - drm_WARN(dev, vgacrd1 == AST_IO_VGACRD1_TX_ANX9807_VBIOS, - "Analogix ANX9807 detected, 0x%x, Gen%lu\n", vgacrd1, AST_GEN(ast)); - /* Check 3rd Tx option (digital output afaik) */ ast->tx_chip = AST_TX_NONE; @@ -116,9 +101,9 @@ static void ast_detect_tx_chip(struct ast_device *ast, bool need_post) * the SOC scratch register #1 bits 11:8 (interestingly marked * as "reserved" in the spec) */ - jreg = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd1, - AST_IO_VGACRD1_TX_TYPE_MASK); - switch (jreg) { + vgacrd1 = ast_get_index_reg_mask(ast, AST_IO_VGACRI, 0xd1, + AST_IO_VGACRD1_TX_TYPE_MASK); + switch (vgacrd1) { /* * GEN4 to GEN6 */ @@ -144,6 +129,25 @@ static void ast_detect_tx_chip(struct ast_device *ast, bool need_post) case AST_IO_VGACRD1_TX_ASTDP: ast->tx_chip = AST_TX_ASTDP; break; + /* + * Several of the listed TX chips are not explicitly supported + * by the ast driver. If these exist in real-world devices, they + * are most likely reported as VGA or SIL164 outputs. We warn here + * to get bug reports for these devices. If none come in for some + * time, we can begin to fail device probing on these values. + */ + case AST_IO_VGACRD1_TX_ITE66121_VBIOS: + drm_warn(dev, "ITE IT66121 detected, 0x%x, Gen%lu\n", + vgacrd1, AST_GEN(ast)); + break; + case AST_IO_VGACRD1_TX_CH7003_VBIOS: + drm_warn(dev, "Chrontel CH7003 detected, 0x%x, Gen%lu\n", + vgacrd1, AST_GEN(ast)); + break; + case AST_IO_VGACRD1_TX_ANX9807_VBIOS: + drm_warn(dev, "Analogix ANX9807 detected, 0x%x, Gen%lu\n", + vgacrd1, AST_GEN(ast)); + break; } }
Only Gen4 and later read the installed TX chip from the SoC. So only warn on those generations about unsupported chips. Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de> --- drivers/gpu/drm/ast/ast_main.c | 40 +++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 18 deletions(-)