Skip to content

Commit b4fe27d

Browse files
hongaooopsiff
authored andcommitted
drm: radeon&amdgpu block resolution
block resolution 1600x1200 for oland in radeon&amdgpu Reported-by: Yujing Ming <mingyujing@uniontech.com> Signed-off-by: hongao <hongao@uniontech.com> Signed-off-by: luozhijia <luozhijia@uniontech.com> Signed-off-by: WangYuli <wangyuli@uniontech.com>
1 parent 83e6dd9 commit b4fe27d

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -864,12 +864,25 @@ static enum drm_mode_status amdgpu_connector_vga_mode_valid(struct drm_connector
864864
{
865865
struct drm_device *dev = connector->dev;
866866
struct amdgpu_device *adev = drm_to_adev(dev);
867+
struct edid *edid = amdgpu_connector_edid(connector);
867868

868869
/* XXX check mode bandwidth */
869870

870871
if ((mode->clock / 10) > adev->clock.max_pixel_clock)
871872
return MODE_CLOCK_HIGH;
872873

874+
/* Monitor ViewSonic include resolution 1600x1200 which is buggly,
875+
* GPU scaling with "Full" and "Full aspect" will cause screen flicker,
876+
* GPU scaling with "Center" will cause screen black,
877+
* FIXME: block it directly is ugly, is there a new way to fix it?
878+
*/
879+
if(edid != NULL && edid->mfg_id[0] == 0x5a && edid->mfg_id[1] == 0x63)
880+
{
881+
if (adev->asic_type == CHIP_OLAND && mode->hdisplay == 1600 && mode->vdisplay == 1200){
882+
return MODE_BAD_WIDTH;
883+
}
884+
}
885+
873886
return MODE_OK;
874887
}
875888

@@ -1211,6 +1224,7 @@ static enum drm_mode_status amdgpu_connector_dvi_mode_valid(struct drm_connector
12111224
struct drm_device *dev = connector->dev;
12121225
struct amdgpu_device *adev = drm_to_adev(dev);
12131226
struct amdgpu_connector *amdgpu_connector = to_amdgpu_connector(connector);
1227+
struct edid *edid = amdgpu_connector_edid(connector);
12141228

12151229
/* XXX check mode bandwidth */
12161230

@@ -1230,6 +1244,18 @@ static enum drm_mode_status amdgpu_connector_dvi_mode_valid(struct drm_connector
12301244
}
12311245
}
12321246

1247+
/* Monitor ViewSonic include resolution 1600x1200 which is buggly,
1248+
* GPU scaling with "Full" and "Full aspect" will cause screen flicker,
1249+
* GPU scaling with "Center" will cause screen black,
1250+
* FIXME: block it directly is ugly, is there a new way to fix it?
1251+
*/
1252+
if(edid != NULL && edid->mfg_id[0] == 0x5a && edid->mfg_id[1] == 0x63)
1253+
{
1254+
if (adev->asic_type == CHIP_OLAND && mode->hdisplay == 1600 && mode->vdisplay == 1200){
1255+
return MODE_BAD_WIDTH;
1256+
}
1257+
}
1258+
12331259
/* check against the max pixel clock */
12341260
if ((mode->clock / 10) > adev->clock.max_pixel_clock)
12351261
return MODE_CLOCK_HIGH;

drivers/gpu/drm/radeon/radeon_connectors.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -984,12 +984,25 @@ static enum drm_mode_status radeon_vga_mode_valid(struct drm_connector *connecto
984984
{
985985
struct drm_device *dev = connector->dev;
986986
struct radeon_device *rdev = dev->dev_private;
987+
struct edid *edid = radeon_connector_edid(connector);
987988

988989
/* XXX check mode bandwidth */
989990

990991
if ((mode->clock / 10) > rdev->clock.max_pixel_clock)
991992
return MODE_CLOCK_HIGH;
992993

994+
/* Monitor ViewSonic include resolution 1600x1200 which is buggly,
995+
* GPU scaling with "Full" and "Full aspect" will cause screen flicker,
996+
* GPU scaling with "Center" will cause screen black,
997+
* FIXME: block it directly is ugly, is there a new way to fix it?
998+
*/
999+
if(edid != NULL && edid->mfg_id[0] == 0x5a && edid->mfg_id[1] == 0x63)
1000+
{
1001+
if (ASIC_IS_DCE64(rdev) && mode->hdisplay == 1600 && mode->vdisplay == 1200){
1002+
return MODE_BAD_WIDTH;
1003+
}
1004+
}
1005+
9931006
return MODE_OK;
9941007
}
9951008

@@ -1464,6 +1477,7 @@ static enum drm_mode_status radeon_dvi_mode_valid(struct drm_connector *connecto
14641477
struct drm_device *dev = connector->dev;
14651478
struct radeon_device *rdev = dev->dev_private;
14661479
struct radeon_connector *radeon_connector = to_radeon_connector(connector);
1480+
struct edid *edid = radeon_connector_edid(connector);
14671481

14681482
/* XXX check mode bandwidth */
14691483

@@ -1493,6 +1507,18 @@ static enum drm_mode_status radeon_dvi_mode_valid(struct drm_connector *connecto
14931507
if ((mode->clock / 10) > rdev->clock.max_pixel_clock)
14941508
return MODE_CLOCK_HIGH;
14951509

1510+
/* Monitor ViewSonic include resolution 1600x1200 which is buggly,
1511+
* GPU scaling with "Full" and "Full aspect" will cause screen flicker,
1512+
* GPU scaling with "Center" will cause screen black,
1513+
* FIXME: block it directly is ugly, is there a new way to fix it?
1514+
*/
1515+
if(edid != NULL && edid->mfg_id[0] == 0x5a && edid->mfg_id[1] == 0x63)
1516+
{
1517+
if (ASIC_IS_DCE64(rdev) && mode->hdisplay == 1600 && mode->vdisplay == 1200){
1518+
return MODE_BAD_WIDTH;
1519+
}
1520+
}
1521+
14961522
return MODE_OK;
14971523
}
14981524

0 commit comments

Comments
 (0)