Re: video: Get the default mode from the right database

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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>
[PATCH] video: Get the default mode from the right database

From: Jordan Crouse <[email protected]>

If no default mode is specified, it should be grabbed from the supplied
database, not the default one.  

Signed-off-by: Jordan Crouse <[email protected]>
---

 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;
 

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux