Re: [PATCH] I was wondering why I can't set the resolution to 2560x1080, while in windows 7 I can without a problem. I looked at the radeon driver code and found it doesn't support this resolution. So I made some changes. I added the hdmi_mhz parameter. In cmdline I set radeon.hdmi_mhz=190 Only tested on the Radeon HD 5830

From: Joe Perches
Date: Sun Feb 07 2021 - 05:46:58 EST


Your subject needs to be changed and a commit log added.

> diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c
[]
> @@ -37,6 +37,8 @@
>  #include <linux/pm_runtime.h>
>  #include <linux/vga_switcheroo.h>
>
> +extern int hdmimhz;
> +
>  static int radeon_dp_handle_hpd(struct drm_connector *connector)
>  {
>   struct radeon_connector *radeon_connector = to_radeon_connector(connector);
> @@ -503,7 +505,7 @@ static void radeon_add_common_modes(struct drm_encoder *encoder, struct drm_conn
>   struct mode_size {
>   int w;
>   int h;
> - } common_modes[17] = {
> + } common_modes[18] = {

probably better without a specific array size

>   { 640, 480},
>   { 720, 480},
>   { 800, 600},
> @@ -520,10 +522,11 @@ static void radeon_add_common_modes(struct drm_encoder *encoder, struct drm_conn
>   {1680, 1050},
>   {1600, 1200},
>   {1920, 1080},
> - {1920, 1200}
> + {1920, 1200},
> + {2560, 1080}
>   };
>  
>
> - for (i = 0; i < 17; i++) {
> + for (i = 0; i < 18; i++) {

for (i = 0; i < ARRAY_SIZE(common_modes); i++) {

> @@ -1491,25 +1494,32 @@ static enum drm_mode_status radeon_dvi_mode_valid(struct drm_connector *connecto
>   (mode->clock > 135000))
>   return MODE_CLOCK_HIGH;
>  
>
> - if (radeon_connector->use_digital && (mode->clock > 165000)) {
> + if (radeon_connector->use_digital && (mode->clock > (hdmimhz * 1000))) {
>   if ((radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_I) ||
>   (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_DUAL_LINK_DVI_D) ||
> - (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B))
> + (radeon_connector->connector_object_id == CONNECTOR_OBJECT_ID_HDMI_TYPE_B)){
> + printk("MODE_CLOCK_HIHG0 %d", hdmimhz);

unnecessary debugging printks?