From: "Jordan Crouse" <jordan.crouse@amd.com>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: Linux Kernel Development <linux-kernel@vger.kernel.org>,
devel@laptop.org
Subject: Re: video: Get the default mode from the right database
Date: Tue, 3 Oct 2006 09:07:23 -0600 [thread overview]
Message-ID: <20061003150723.GG7716@cosmic.amd.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0610030901070.28197@pademelon.sonytel.be>
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
On 03/10/06 09:04 +0200, Geert Uytterhoeven wrote:
> > if (!default_mode)
> > - default_mode = &modedb[DEFAULT_MODEDB_INDEX];
> > + default_mode = &db[DEFAULT_MODEDB_INDEX];
> > if (!default_bpp)
> > default_bpp = 8;
>
> Although currently DEFAULT_MODEDB_INDEX is defined to be 0, perhaps we need a
> more rigorous check now it may apply to the custom video mode database?
> Probably you always want the first mode of your custom video mode database to
> be the default?
Indeed. I'm not sure how many people out there actually change
DEFAULT_MODEDB_INDEX to be non zero, but can't think of a reason why the
default shouldn't just always use the first index in the database.
At least, thats the way I thought fb_find_mode() worked before I looked into
the internals. Still, there might be some people attached to
DEFAULT_MODEDB_INDEX, so I've attached a new patch that should make everybody
happy.
Jordan
--
Jordan Crouse
Senior Linux Engineer
Advanced Micro Devices, Inc.
<www.amd.com/embeddedprocessors>
[-- Attachment #2: modedb-fix.patch --]
[-- Type: text/plain, Size: 815 bytes --]
[PATCH] video: Get the default mode from the right database
From: Jordan Crouse <jordan.crouse@amd.com>
If no default mode is specified, it should be grabbed from the supplied
database, not the default one.
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
---
drivers/video/modedb.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index d126790..4c04413 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -505,8 +505,11 @@ int fb_find_mode(struct fb_var_screeninf
db = modedb;
dbsize = ARRAY_SIZE(modedb);
}
- if (!default_mode)
+ if (!default_mode && db != modedb)
+ default_mode = &db[0];
+ else
default_mode = &modedb[DEFAULT_MODEDB_INDEX];
+
if (!default_bpp)
default_bpp = 8;
[-- Attachment #3: Type: text/plain, Size: 133 bytes --]
_______________________________________________
Devel mailing list
Devel@laptop.org
http://mailman.laptop.org/mailman/listinfo/devel
WARNING: multiple messages have this Message-ID (diff)
From: "Jordan Crouse" <jordan.crouse@amd.com>
To: linux-fbdev-devel@lists.sourceforge.net
Cc: "Linux Kernel Development" <linux-kernel@vger.kernel.org>,
devel@laptop.org
Subject: Re: video: Get the default mode from the right database
Date: Tue, 3 Oct 2006 09:07:23 -0600 [thread overview]
Message-ID: <20061003150723.GG7716@cosmic.amd.com> (raw)
In-Reply-To: <Pine.LNX.4.62.0610030901070.28197@pademelon.sonytel.be>
[-- Attachment #1: Type: text/plain, Size: 1029 bytes --]
On 03/10/06 09:04 +0200, Geert Uytterhoeven wrote:
> > if (!default_mode)
> > - default_mode = &modedb[DEFAULT_MODEDB_INDEX];
> > + default_mode = &db[DEFAULT_MODEDB_INDEX];
> > if (!default_bpp)
> > default_bpp = 8;
>
> Although currently DEFAULT_MODEDB_INDEX is defined to be 0, perhaps we need a
> more rigorous check now it may apply to the custom video mode database?
> Probably you always want the first mode of your custom video mode database to
> be the default?
Indeed. I'm not sure how many people out there actually change
DEFAULT_MODEDB_INDEX to be non zero, but can't think of a reason why the
default shouldn't just always use the first index in the database.
At least, thats the way I thought fb_find_mode() worked before I looked into
the internals. Still, there might be some people attached to
DEFAULT_MODEDB_INDEX, so I've attached a new patch that should make everybody
happy.
Jordan
--
Jordan Crouse
Senior Linux Engineer
Advanced Micro Devices, Inc.
<www.amd.com/embeddedprocessors>
[-- Attachment #2: modedb-fix.patch --]
[-- Type: text/plain, Size: 815 bytes --]
[PATCH] video: Get the default mode from the right database
From: Jordan Crouse <jordan.crouse@amd.com>
If no default mode is specified, it should be grabbed from the supplied
database, not the default one.
Signed-off-by: Jordan Crouse <jordan.crouse@amd.com>
---
drivers/video/modedb.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c
index d126790..4c04413 100644
--- a/drivers/video/modedb.c
+++ b/drivers/video/modedb.c
@@ -505,8 +505,11 @@ int fb_find_mode(struct fb_var_screeninf
db = modedb;
dbsize = ARRAY_SIZE(modedb);
}
- if (!default_mode)
+ if (!default_mode && db != modedb)
+ default_mode = &db[0];
+ else
default_mode = &modedb[DEFAULT_MODEDB_INDEX];
+
if (!default_bpp)
default_bpp = 8;
next prev parent reply other threads:[~2006-10-03 15:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-02 22:57 [PATCH] video: Get the default mode from the right database Jordan Crouse
2006-10-02 22:57 ` Jordan Crouse
2006-10-03 7:04 ` Geert Uytterhoeven
2006-10-03 7:04 ` [Linux-fbdev-devel] " Geert Uytterhoeven
2006-10-03 15:07 ` Jordan Crouse [this message]
2006-10-03 15:07 ` Jordan Crouse
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=20061003150723.GG7716@cosmic.amd.com \
--to=jordan.crouse@amd.com \
--cc=devel@laptop.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.