RE: [PATCH] drm/ast: Treat AST2600 like AST2500 in most places

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Thomas

 

Thanks for your suggestions!

I answer each revision inline that followed by [KH]:.

 

Regards,

        Kuo-Hsiang Chou

 

-----Original Message-----

From: Thomas Zimmermann [mailto:tzimmermann@xxxxxxx]

Sent: Tuesday, June 07, 2022 8:03 PM

To: airlied@xxxxxxxxxx; airlied@xxxxxxxx; daniel@xxxxxxxx; jfalempe@xxxxxxxxxx; regressions@xxxxxxxxxxxxx; Kuo-Hsiang Chou <kuohsiang_chou@xxxxxxxxxxxxxx>

Subject: [PATCH] drm/ast: Treat AST2600 like AST2500 in most places

 

Include AST2600 in most of the branches for AST2500. Thereby revert most effects of commit f9bd00e0ea9d ("drm/ast: Create chip AST2600").

 

The AST2600 used to be treated like an AST2500, which at least gave usable display output. After introducing AST2600 in the driver without further updates, lots of functions take the wrong branches.

 

Handling AST2600 in the AST2500 branches reverts back to the original settings. The exception are cases where AST2600 meanwhile got its own branch.

 

[KH]: Based on CVE_2019_6260 item3, P2A is disallowed anymore.

P2A (PCIe to AMBA) is a bridge that is able to revise any BMC registers.

Yes, P2A is dangerous on security issue, because Host open a backdoor and someone malicious SW/APP will be easy to take control of BMC.

Therefore, P2A is disabled forever.

 

Now, return to this patch, there is no need to add AST2600 condition on the P2A flow.

 

Reported-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>

Signed-off-by: Thomas Zimmermann <tzimmermann@xxxxxxx>

Suggested-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>

Fixes: f9bd00e0ea9d ("drm/ast: Create chip AST2600")

Cc: KuoHsiang Chou <kuohsiang_chou@xxxxxxxxxxxxxx>

Cc: Dave Airlie <airlied@xxxxxxxxxx>

Cc: dri-devel@xxxxxxxxxxxxxxxxxxxxx

Cc: <stable@xxxxxxxxxxxxxxx> # v5.11+

---

drivers/gpu/drm/ast/ast_main.c | 4 ++--  drivers/gpu/drm/ast/ast_mode.c | 6 +++---  drivers/gpu/drm/ast/ast_post.c | 6 +++---

3 files changed, 8 insertions(+), 8 deletions(-)

 

diff --git a/drivers/gpu/drm/ast/ast_main.c b/drivers/gpu/drm/ast/ast_main.c index d770d5a23c1a..56b2ac138375 100644

--- a/drivers/gpu/drm/ast/ast_main.c

+++ b/drivers/gpu/drm/ast/ast_main.c

@@ -307,7 +307,7 @@ static int ast_get_dram_info(struct drm_device *dev)

      default:

              ast->dram_bus_width = 16;

              ast->dram_type = AST_DRAM_1Gx16;

-               if (ast->chip == AST2500)

+              if ((ast->chip == AST2500) || (ast->chip == AST2600))

                      ast->mclk = 800;

              else

                      ast->mclk = 396;

@@ -319,7 +319,7 @@ static int ast_get_dram_info(struct drm_device *dev)

      else

              ast->dram_bus_width = 32;

-       if (ast->chip == AST2500) {

+      if ((ast->chip == AST2600) || (ast->chip == AST2500)) {

              switch (mcr_cfg & 0x03) {

              case 0:

                      ast->dram_type = AST_DRAM_1Gx16;

[KH]: P2A is disabled, there is no need to take care of BMC DRAM setting.

 

diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c index 323af2746aa9..1dde30b98317 100644

--- a/drivers/gpu/drm/ast/ast_mode.c

+++ b/drivers/gpu/drm/ast/ast_mode.c

@@ -310,7 +310,7 @@ static void ast_set_crtc_reg(struct ast_private *ast,

      u8 jreg05 = 0, jreg07 = 0, jreg09 = 0, jregAC = 0, jregAD = 0, jregAE = 0;

      u16 temp, precache = 0;

-       if ((ast->chip == AST2500) &&

+      if (((ast->chip == AST2600) || (ast->chip == AST2500)) &&

          (vbios_mode->enh_table->flags & AST2500PreCatchCRT))

              precache = 40;

[KH]: after checking on register value, AST2600 doesn't run this.

 

@@ -428,7 +428,7 @@ static void ast_set_dclk_reg(struct ast_private *ast,  {

      const struct ast_vbios_dclk_info *clk_info;

-       if (ast->chip == AST2500)

+      if ((ast->chip == AST2600) || (ast->chip == AST2500))

              clk_info = &dclk_table_ast2500[vbios_mode->enh_table->dclk_index];

      else

              clk_info = &dclk_table[vbios_mode->enh_table->dclk_index];

[KH]: after checking on register value, AST2600 doesn't run this.

        The difference between 2 table of " dclk_table_ast2500" and " dclk_table" are the setting of Reduce Blanking.

 

@@ -476,7 +476,7 @@ static void ast_set_crtthd_reg(struct ast_private *ast)

              ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0xe0);

              ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0xa0);

      } else if (ast->chip == AST2300 || ast->chip == AST2400 ||

-           ast->chip == AST2500) {

+                 ast->chip == AST2500 || ast->chip == AST2600) {

              ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa7, 0x78);

              ast_set_index_reg(ast, AST_IO_CRTC_PORT, 0xa6, 0x60);

      } else if (ast->chip == AST2100 ||

[KH]: Yes, the patch is "drm/ast: Create threshold values for AST2600" that is the root cause of whites lines on AST2600

commit

bcc77411e8a65929655cef7b63a36000724cdc4b (patch)

 

 

diff --git a/drivers/gpu/drm/ast/ast_post.c b/drivers/gpu/drm/ast/ast_post.c index 0aa9cf0fb5c3..eb1ff9084034 100644

--- a/drivers/gpu/drm/ast/ast_post.c

+++ b/drivers/gpu/drm/ast/ast_post.c

@@ -80,7 +80,7 @@ ast_set_def_ext_reg(struct drm_device *dev)

              ast_set_index_reg(ast, AST_IO_CRTC_PORT, i, 0x00);

       if (ast->chip == AST2300 || ast->chip == AST2400 ||

-           ast->chip == AST2500) {

+          ast->chip == AST2500 || ast->chip == AST2600) {

              if (pdev->revision >= 0x20)

                      ext_reg_info = extreginfo_ast2300;

              else

[KH]: after checking on register value, AST2600 doesn't run this.

 

@@ -105,7 +105,7 @@ ast_set_def_ext_reg(struct drm_device *dev)

      /* Enable RAMDAC for A1 */

      reg = 0x04;

      if (ast->chip == AST2300 || ast->chip == AST2400 ||

-           ast->chip == AST2500)

+          ast->chip == AST2500 || ast->chip == AST2600)

              reg |= 0x20;

      ast_set_index_reg_mask(ast, AST_IO_CRTC_PORT, 0xb6, 0xff, reg);  }

[KH]: Yes, it should be a patch, because the value is set by GOP/VBIOS during booting.

ALTHOUGH, after checking on register value, AST2600 doesn't run this.

 

@@ -382,7 +382,7 @@ void ast_post_gpu(struct drm_device *dev)

      if (ast->chip == AST2600) {

              ast_dp_launch(dev, 1);

      } else if (ast->config_mode == ast_use_p2a) {

-               if (ast->chip == AST2500)

+              if (ast->chip == AST2500 || ast->chip == AST2600)

                      ast_post_chip_2500(dev);

              else if (ast->chip == AST2300 || ast->chip == AST2400)

                      ast_post_chip_2300(dev);

[KH]: NO, AST2600 has its flow that is ast_dp_lauch()

        And ast_use_p2a means using P2A bridge that is no longer allowed.

 

 

Again, Thanks all who works on drm/ast. Thank you!

Regards,

        Kuo-Hsiang Chou

 

--

2.36.1

 


[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux