From: Egbert Eich <eich@freedesktop.org>
To: "Y.C. Chen" <yc_chen@aspeedtech.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] Fixed 1600x900 Display Issue
Date: Thu, 21 Aug 2014 11:06:25 +0200 [thread overview]
Message-ID: <20140821090625.GA28930@debian> (raw)
In-Reply-To: <1408439451-21060-1-git-send-email-yc_chen@aspeedtech.com>
On Tue, Aug 19, 2014 at 05:10:51PM +0800, Y.C. Chen wrote:
> From: "Y.C. Chen" <yc_chen@aspeedtech.com>
>
> ---
> drivers/gpu/drm/ast/ast_mode.c | 27 +++++++++++++++++---------
> drivers/gpu/drm/ast/ast_tables.h | 42 ++++++++++++++++++++++------------------
> 2 files changed, 41 insertions(+), 28 deletions(-)
>
> diff --git a/drivers/gpu/drm/ast/ast_mode.c b/drivers/gpu/drm/ast/ast_mode.c
> index 5389350..e7fed29 100644
> --- a/drivers/gpu/drm/ast/ast_mode.c
> +++ b/drivers/gpu/drm/ast/ast_mode.c
> @@ -140,15 +140,24 @@ static bool ast_get_vbios_mode_info(struct drm_crtc *crtc, struct drm_display_mo
> return false;
> }
>
> - refresh_rate = drm_mode_vrefresh(mode);
> - while (vbios_mode->enh_table->refresh_rate < refresh_rate) {
> - vbios_mode->enh_table++;
> - if ((vbios_mode->enh_table->refresh_rate > refresh_rate) ||
> - (vbios_mode->enh_table->refresh_rate == 0xff)) {
> - vbios_mode->enh_table--;
> - break;
> - }
> - }
> + if (vbios_mode->enh_table->flags & WideScreenMode)
> + {
> + /* parsing for wide screen reduced blank mode */
> + if ((mode->flags & DRM_MODE_FLAG_NVSYNC) && (mode->flags & DRM_MODE_FLAG_PHSYNC)) /* CVT RB */
> + vbios_mode->enh_table++;
I'm not really happy with assuming fixed list positions. Wouldn't it be better to walk the
list until you reach an entry with:
(vbios_mode->enh_table->flags & SyncNP) && (vbios_mode->enh_table->refresh_rate != 0xff)?
This way it would be independent of the position of the modes in the list. Assuming fixed list
postition seems to somewhat defy the sophisticated flag concept used here.
> + }
> + else
> + {
> + refresh_rate = drm_mode_vrefresh(mode);
> + while (vbios_mode->enh_table->refresh_rate < refresh_rate) {
> + vbios_mode->enh_table++;
> + if ((vbios_mode->enh_table->refresh_rate > refresh_rate) ||
> + (vbios_mode->enh_table->refresh_rate == 0xff)) {
> + vbios_mode->enh_table--;
> + break;
> + }
> + }
> + }
[..]
> static struct ast_vbios_enhtable res_1600x900[] = {
> + {2112, 1600, 88,168, 934, 900, 3, 5, VCLK118_25, /* 60Hz CVT */
> + (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 1, 0x3A },
> {1760, 1600, 48, 32, 926, 900, 3, 5, VCLK97_75, /* 60Hz CVT RB */
> (SyncNP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 1, 0x3A },
> {1760, 1600, 48, 32, 926, 900, 3, 5, VCLK97_75, /* end */
> @@ -259,31 +264,30 @@ static struct ast_vbios_enhtable res_1920x1080[] = {
>
> /* 16:10 */
> static struct ast_vbios_enhtable res_1280x800[] = {
> - {1440, 1280, 48, 32, 823, 800, 3, 6, VCLK71, /* 60Hz RB */
> - (SyncNP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 1, 35 },
> - {1680, 1280, 72,128, 831, 800, 3, 6, VCLK83_5, /* 60Hz */
> - (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 1, 0x35 },
> - {1680, 1280, 72,128, 831, 800, 3, 6, VCLK83_5, /* 60Hz */
> - (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 0xFF, 1, 0x35 },
> -
> + {1680, 1280, 72,128, 831, 800, 3, 6, VCLK83_5, /* 60Hz CVT */
> + (SyncPN | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 1, 0x35 },
> + {1440, 1280, 48, 32, 823, 800, 3, 6, VCLK71, /* 60Hz CVT RB */
> + (SyncNP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 60, 2, 35 },
> + {1440, 1280, 48, 32, 823, 800, 3, 6, VCLK71, /* 60Hz CVT RB */
> + (SyncNP | Charx8Dot | LineCompareOff | WideScreenMode | NewModeInfo), 0xFF, 2, 35 },
> };
The last entry marks the end of the list by setting refresh rate to 0xff.
Would be nice if all other entries in this list element were obviously invalid
as well to enhance readability and clearly mark that there is no magic involved
here.
But you didn't introduce this, it was done this way before already.
Cheers,
Egbert.
next prev parent reply other threads:[~2014-08-21 9:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-19 9:10 [PATCH] Fixed 1600x900 Display Issue Y.C. Chen
2014-08-21 9:06 ` Egbert Eich [this message]
2014-08-21 9:27 ` YC Chen
2014-08-21 10:12 ` Egbert Eich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140821090625.GA28930@debian \
--to=eich@freedesktop.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=yc_chen@aspeedtech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).