From: Carlos Manuel Duclos Vergara <carlos@embedded.cl>
To: torvalds@transmeta.com
Cc: linux-kernel@vger.kernel.org
Subject: PATCH: FrameBuffer Monitor Functions [now with patch attached :-)]
Date: Mon, 25 Feb 2002 15:02:11 -0300 [thread overview]
Message-ID: <20020225150211.3e1729a5.carlos@embedded.cl> (raw)
[-- Attachment #1: Type: text/plain, Size: 508 bytes --]
Hi,
this patch is to avoid the cooking of monitors from inside the
framebuffer subsystem. Normally this would be made by
fbmon_valid_timings function, but actually this function does nothing.
So i start writing a new implementation that will make some checks, note
that is not the full answer because it requires to user use another data
structures normally don't used, but for now it checks the basic stuff.
bye
--
"Solo me arrepiento de unos * de menos y unos ++ de sobra"
Carlos Manuel Duclos Vergara
[-- Attachment #2: fbmon_c.patch --]
[-- Type: application/octet-stream, Size: 2504 bytes --]
--- uclinux-2.4.x/drivers/video/fbmon.c Wed Mar 8 15:18:25 2000
+++ ecl-uclinux-2.4.x/drivers/video/fbmon.c Mon Feb 25 14:20:25 2002
@@ -46,31 +46,54 @@
int fbmon_valid_timings(u_int pixclock, u_int htotal, u_int vtotal,
const struct fb_info *fb_info)
{
-#if 0
/*
- * long long divisions .... $#%%#$
+ * Ohhh, i discover the Secret of Ramses II tomb!
+ * _PLEASE_ note that this is only worth if you _FILL_ _UP_
+ * a fb_monspecs with your monitor specs!
+ * If you don't do that, this will only check for vesa compatible
+ * modes at some "generic" multifrequency monitors! (not done yet)
+ * I will think in how to auto detect monitors, or maybe how you can tell in
+ * runtime what kind of monitor do you have.
+ * If you want to know the progress of that, email me at: carlos@embedded.cl
+ * Note 1: I don't assume nothing, so in htotal & vtotal use your values...
+ * if you want a sugestion use: htotal = hres * 1.2 and vtotal = vres * 1.1
+ * Note 2: We only need to calculate one thing to see if your monitor will cook
+ * (please don't blame me if it cooks anyway, you must be aware that this function
+ * do its best to check but is not _the_ final answer!
*/
- unsigned long long hpicos, vpicos;
- const unsigned long long _1e12 = 1000000000000ULL;
- const struct fb_monspecs *monspecs = &fb_info->monspecs;
- hpicos = (unsigned long long)htotal*(unsigned long long)pixclock;
- vpicos = (unsigned long long)vtotal*(unsigned long long)hpicos;
- if (!vpicos)
- return 0;
-
- if (monspecs->hfmin == 0)
+ if( !fb_info->monspecs )
+ {
+ /*
+ * Dear God...
+ */
+ printk( KERN_INFO "fb: We could not check your monitor, due lack of monspecs!\n" );
return 1;
-
- if (hpicos*monspecs->hfmin > _1e12 || hpicos*monspecs->hfmax < _1e12 ||
- vpicos*monspecs->vfmin > _1e12 || vpicos*monspecs->vfmax < _1e12)
+ }
+
+ if( pixelclock > (fb_info->monspecs.hfmax * htotal) )
+ {
+ /*
+ * We will cook this monitor!
+ */
+ printk( KERN_INFO "fb: To avoid cooking your monitor we won't use this resolution!\n" );
return 0;
-#endif
- return 1;
+ }
+
+ /*
+ * If we get here, we're safe (almost)
+ */
+
+ return 1;
}
int fbmon_dpms(const struct fb_info *fb_info)
{
+ if( !fb_info->monspecs )
+ {
+ printk( KERN_INFO "fb: No monspecs!\n" );
+ return -EINVAL;
+ }
return fb_info->monspecs.dpms;
}
reply other threads:[~2002-02-25 17:57 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20020225150211.3e1729a5.carlos@embedded.cl \
--to=carlos@embedded.cl \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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
all inboxes | Powered by JetHome®