drivers/gpu/drm/ast/ast_dp.c | 9 ++++++++- drivers/gpu/drm/ast/ast_drv.h | 3 +++ drivers/gpu/drm/ast/ast_mode.c | 6 ++++++ drivers/gpu/drm/ast/ast_tables.h | 18 ++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-)
In this patch, 3 new timings are added into support list.
If you want to have new timings, 1280x720 and 1280x960 on DisplayPort,
your dp-fw should be newer than version, 20240502.
Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
---
drivers/gpu/drm/ast/ast_dp.c | 9 ++++++++-
drivers/gpu/drm/ast/ast_drv.h | 3 +++
drivers/gpu/drm/ast/ast_mode.c | 6 ++++++
drivers/gpu/drm/ast/ast_tables.h | 18 ++++++++++++++++++
4 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/ast/ast_dp.c b/drivers/gpu/drm/ast/ast_dp.c
index 0e282b7b167c..0b56f0335871 100644
--- a/drivers/gpu/drm/ast/ast_dp.c
+++ b/drivers/gpu/drm/ast/ast_dp.c
@@ -255,6 +255,10 @@ static void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *v
case 1280:
if (crtc->mode.crtc_vdisplay == 800)
ModeIdx = (ASTDP_1280x800_60_RB - (u8) ulRefreshRateIndex);
+ else if (crtc->mode.crtc_vdisplay == 720)
+ ModeIdx = ASTDP_1280x720_60;
+ else if (crtc->mode.crtc_vdisplay == 960)
+ ModeIdx = ASTDP_1280x960_60;
else // 1024
ModeIdx = (ASTDP_1280x1024_60 + (u8) ulRefreshRateIndex);
break;
@@ -267,7 +271,10 @@ static void ast_dp_set_mode(struct drm_crtc *crtc, struct ast_vbios_mode_info *v
break;
case 1600:
if (crtc->mode.crtc_vdisplay == 900)
- ModeIdx = (ASTDP_1600x900_60_RB - (u8) ulRefreshRateIndex);
+ if (ulRefreshRateIndex == 2)
+ ModeIdx = ASTDP_1600x900_60_DMT;
+ else
+ ModeIdx = (ASTDP_1600x900_60_RB - (u8) ulRefreshRateIndex);
else //1200
ModeIdx = ASTDP_1600x1200_60;
break;
diff --git a/drivers/gpu/drm/ast/ast_drv.h b/drivers/gpu/drm/ast/ast_drv.h
index 21ce3769bf0d..e7cef334b3ec 100644
--- a/drivers/gpu/drm/ast/ast_drv.h
+++ b/drivers/gpu/drm/ast/ast_drv.h
@@ -442,6 +442,9 @@ int ast_mode_config_init(struct ast_device *ast);
#define ASTDP_1600x900_60_RB 0x1D
#define ASTDP_1366x768_60 0x1E
#define ASTDP_1152x864_75 0x1F
+#define ASTDP_1600x900_60_DMT 0x51
+#define ASTDP_1280x720_60 0x52
+#define ASTDP_1280x960_60 0x53
int ast_mm_init(struct ast_device *ast);
diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
index 9d5321c81e68..5d02f27e79b7 100644
--- a/drivers/gpu/drm/ast/ast_mode.c
+++ b/drivers/gpu/drm/ast/ast_mode.c
@@ -475,6 +475,12 @@ static void ast_set_dclk_reg(struct ast_device *ast,
ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xbb, 0x0f,
(clk_info->param3 & 0xc0) |
((clk_info->param3 & 0x3) << 4));
+
+ /* Set SEQ; Half dclk for this timing */
+ if (vbios_mode->enh_table->flags & HalfDCLK)
+ ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xff, 0x08);
+ else
+ ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xf7, 0x00);
}
static void ast_set_color_reg(struct ast_device *ast,
diff --git a/drivers/gpu/drm/ast/ast_tables.h b/drivers/gpu/drm/ast/ast_tables.h
index 0378c9bc079b..329d6bac867b 100644
--- a/drivers/gpu/drm/ast/ast_tables.h
+++ b/drivers/gpu/drm/ast/ast_tables.h
@@ -254,6 +254,13 @@ static const struct ast_vbios_enhtable res_1024x768[] = {
(SyncPP | Charx8Dot), 0xFF, 4, 0x31 },
};
+static const struct ast_vbios_enhtable res_1280x960[] = {
+ {1800, 1280, 96, 112, 1000, 960, 1, 3, VCLK108, /* 60Hz */
+ (SyncPP | Charx8Dot), 60, 1, 0x3E },
+ {1800, 1280, 96, 112, 1000, 960, 1, 3, VCLK108, /* end */
+ (SyncPP | Charx8Dot), 0xFF, 1, 0x3E },
+};
+
static const struct ast_vbios_enhtable res_1280x1024[] = {
{1688, 1280, 48, 112, 1066, 1024, 1, 3, VCLK108, /* 60Hz */
(SyncPP | Charx8Dot), 60, 1, 0x32 },
@@ -280,6 +287,15 @@ static const struct ast_vbios_enhtable res_1152x864[] = {
};
/* 16:9 */
+static const struct ast_vbios_enhtable res_1280x720[] = {
+ {1650, 1280, 110, 40, 750, 720, 5, 5, VCLK148_5, /* 60Hz */
+ (SyncPP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo |
+ HalfDCLK), 60, 1, 0x3D },
+ {1650, 1280, 110, 40, 750, 720, 5, 5, VCLK148_5, /* end */
+ (SyncPP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo |
+ HalfDCLK), 0xFF, 1, 0x3D },
+};
+
static const struct ast_vbios_enhtable res_1360x768[] = {
{1792, 1360, 64, 112, 795, 768, 3, 6, VCLK85_5, /* 60Hz */
(SyncPP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 1, 0x39 },
@@ -294,6 +310,8 @@ static const struct ast_vbios_enhtable res_1600x900[] = {
AST2500PreCatchCRT), 60, 1, 0x3A },
{2112, 1600, 88, 168, 934, 900, 3, 5, VCLK118_25, /* 60Hz CVT */
(SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 2, 0x3A },
+ {1800, 1600, 24, 80, 1000, 900, 1, 3, VCLK108, /* 60Hz DMT */
+ (SyncPP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 3, 0x3A },
{2112, 1600, 88, 168, 934, 900, 3, 5, VCLK118_25, /* 60Hz CVT */
(SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 0xFF, 2, 0x3A },
};
base-commit: 4bbf9020becbfd8fc2c3da790855b7042fad455b
--
2.25.1
Hi Jammy,
kernel test robot noticed the following build errors:
[auto build test ERROR on 4bbf9020becbfd8fc2c3da790855b7042fad455b]
url: https://github.com/intel-lab-lkp/linux/commits/Jammy-Huang/drm-ast-Support-timings-1280x720-1280x960-1600x900/20241223-161735
base: 4bbf9020becbfd8fc2c3da790855b7042fad455b
patch link: https://lore.kernel.org/r/20241223081044.4139167-1-jammy_huang%40aspeedtech.com
patch subject: [PATCH] drm/ast: Support timings, 1280x720/1280x960/1600x900
config: i386-buildonly-randconfig-002-20241223 (https://download.01.org/0day-ci/archive/20241223/202412232014.2tGzY28v-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241223/202412232014.2tGzY28v-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412232014.2tGzY28v-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/gpu/drm/ast/ast_mode.c:481:31: error: use of undeclared identifier 'AST_IO_SEQ_PORT'
481 | ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xff, 0x08);
| ^
drivers/gpu/drm/ast/ast_mode.c:483:31: error: use of undeclared identifier 'AST_IO_SEQ_PORT'
483 | ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xf7, 0x00);
| ^
2 errors generated.
vim +/AST_IO_SEQ_PORT +481 drivers/gpu/drm/ast/ast_mode.c
461
462 static void ast_set_dclk_reg(struct ast_device *ast,
463 struct drm_display_mode *mode,
464 struct ast_vbios_mode_info *vbios_mode)
465 {
466 const struct ast_vbios_dclk_info *clk_info;
467
468 if (IS_AST_GEN6(ast) || IS_AST_GEN7(ast))
469 clk_info = &dclk_table_ast2500[vbios_mode->enh_table->dclk_index];
470 else
471 clk_info = &dclk_table[vbios_mode->enh_table->dclk_index];
472
473 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xc0, 0x00, clk_info->param1);
474 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xc1, 0x00, clk_info->param2);
475 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xbb, 0x0f,
476 (clk_info->param3 & 0xc0) |
477 ((clk_info->param3 & 0x3) << 4));
478
479 /* Set SEQ; Half dclk for this timing */
480 if (vbios_mode->enh_table->flags & HalfDCLK)
> 481 ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xff, 0x08);
482 else
483 ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xf7, 0x00);
484 }
485
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Hi Jammy,
kernel test robot noticed the following build errors:
[auto build test ERROR on 4bbf9020becbfd8fc2c3da790855b7042fad455b]
url: https://github.com/intel-lab-lkp/linux/commits/Jammy-Huang/drm-ast-Support-timings-1280x720-1280x960-1600x900/20241223-161735
base: 4bbf9020becbfd8fc2c3da790855b7042fad455b
patch link: https://lore.kernel.org/r/20241223081044.4139167-1-jammy_huang%40aspeedtech.com
patch subject: [PATCH] drm/ast: Support timings, 1280x720/1280x960/1600x900
config: arm-randconfig-001-20241223 (https://download.01.org/0day-ci/archive/20241223/202412231944.9FPgx42u-lkp@intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241223/202412231944.9FPgx42u-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202412231944.9FPgx42u-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
drivers/gpu/drm/ast/ast_mode.c: In function 'ast_set_dclk_reg':
>> drivers/gpu/drm/ast/ast_mode.c:481:45: error: 'AST_IO_SEQ_PORT' undeclared (first use in this function)
481 | ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xff, 0x08);
| ^~~~~~~~~~~~~~~
drivers/gpu/drm/ast/ast_mode.c:481:45: note: each undeclared identifier is reported only once for each function it appears in
In file included from drivers/gpu/drm/ast/ast_mode.c:49:
drivers/gpu/drm/ast/ast_tables.h: At top level:
>> drivers/gpu/drm/ast/ast_tables.h:290:40: warning: 'res_1280x720' defined but not used [-Wunused-const-variable=]
290 | static const struct ast_vbios_enhtable res_1280x720[] = {
| ^~~~~~~~~~~~
drivers/gpu/drm/ast/ast_tables.h:257:40: warning: 'res_1280x960' defined but not used [-Wunused-const-variable=]
257 | static const struct ast_vbios_enhtable res_1280x960[] = {
| ^~~~~~~~~~~~
vim +/AST_IO_SEQ_PORT +481 drivers/gpu/drm/ast/ast_mode.c
461
462 static void ast_set_dclk_reg(struct ast_device *ast,
463 struct drm_display_mode *mode,
464 struct ast_vbios_mode_info *vbios_mode)
465 {
466 const struct ast_vbios_dclk_info *clk_info;
467
468 if (IS_AST_GEN6(ast) || IS_AST_GEN7(ast))
469 clk_info = &dclk_table_ast2500[vbios_mode->enh_table->dclk_index];
470 else
471 clk_info = &dclk_table[vbios_mode->enh_table->dclk_index];
472
473 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xc0, 0x00, clk_info->param1);
474 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xc1, 0x00, clk_info->param2);
475 ast_set_index_reg_mask(ast, AST_IO_VGACRI, 0xbb, 0x0f,
476 (clk_info->param3 & 0xc0) |
477 ((clk_info->param3 & 0x3) << 4));
478
479 /* Set SEQ; Half dclk for this timing */
480 if (vbios_mode->enh_table->flags & HalfDCLK)
> 481 ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xff, 0x08);
482 else
483 ast_set_index_reg_mask(ast, AST_IO_SEQ_PORT, 0x01, 0xf7, 0x00);
484 }
485
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
© 2016 - 2026 Red Hat, Inc.