lkml.org 
[lkml]   [2021]   [Feb]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [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.
From
Date
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?


\
 
 \ /
  Last update: 2021-02-07 11:48    [W:0.043 / U:3.180 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site