linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] DDC2/I2C Support
@ 2004-01-05 14:31 adaplas
       [not found] ` <20040105171639.GA7048@dreamland.darkstar.lan>
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: adaplas @ 2004-01-05 14:31 UTC (permalink / raw)
  To: linux-fbdev-devel

[-- Attachment #1: Type: text/plain, Size: 4543 bytes --]

Hi all,

I had the Christmas to work a little bit more on EDID/DDC/I2C for fb
drivers. I know they can be implemented in userspace, however, we do need
some sane way of setting video modes since the framebuffer system is
initialized quite early in the boot process.  Still, setting modes using
stty is still a bit problematic.  We need a way to tell fbdev whether to
accept or ignore the timings in fb_var_screeninfo.  These cases are
manifested when changing resolution using stty or using fbset.

Anyway, attached is a patch (gzipped) against linux-2.6.1-rc1. Sorry for
lumping everything into one big patch since I don't have time to separate
them into different patches.

1. [fbi2c.c]:  Added preliminary generic DDC2/i2c support (derived from
xf86DDC.c and xf86i2.c)

	This is a configurable option (CONFIG_FB_I2C). 	For now, I only used
"default" timeout values which may not work for all devices.

	Most drivers need to implement only two functions --

		void xxxfb_i2c_getbits(struct fb_info *info, signed long *clock, signed
long *data)
		void xxxfb_i2c_putbits(struct fb_info *info, signed long clock, signed
long data)

	The functionality is exposed in the following:

		unsigned char *fb_get_edid_from_ddc2(struct fb_info *info)

2. [fbmon.c]: Consolidated different ways of getting EDID with the
following function:

	unsigned char *fb_get_edid(struct fb_info *info, struct pci_dev *pdev,
int what)

		the parameter "what" can be:
			EDID_DDC2 - get EDID via DDC2/I2C fb_get_edid_from_ddc2()
			EDID_ARCH - get	EDID via BIOS or OF get_EDID_from_{OF|BIOS}()

	2.a getting EDID from the BIOS is now configurable (CONFIG_EDID_BIOS)
since some people reported problems during booting or it takes a long
time for the process to finish.

3. [modedb.c]: Added additional field (edid_src) to struct fb_videomode.

	The idea came from Ben H. He suggested that the mode database built by
fb_create_modedb() does not specify where each came from.  So
fb_videomode.edid_src can be:

	MODE_IS_UNKNOWN - defined as (0) -- all entries of modedb[] in fbmon.c
	MODE_IS_DETAILED -  mode came from detailed timings block of EDID.  They
are the most preferred mode since all timings are specified in the block.
	MODE_IS_STANDARD - mode came from standard timings block usually in the
form of [xres]x[yres]@refresh
	MODE_IS_VESA - mode is VESA standard
	MODE_IS_CALCULATED - mode is calculated using GTF (xres, yres, refresh).
	MODE_IS_FIRST - if set, mode is the first entry in the detailed timing
block and is the preferred mode of the display.

	Flags can be combined in different ways such as:

	MODE_IS_STANDARD | MODE_IS_CALCULATED - ie, mode came from standard
timing block, but mode was not found in VESA database, and instead
calculated using GTF.

4. [fbmon.c]: Extended struct fb_monspecs to include display information
specified in EDID.

	Use function
		void fb_get_monspecs(unsigned char *edid, struct fb_monspecs *specs)

------------------------------------------
struct fb_chroma {
	__u32 redx;         /* divide value by 1024 */
	__u32 greenx;
	__u32 bluex;
	__u32 whitex;
	__u32 redy;
	__u32 greeny;
	__u32 bluey;
	__u32 whitey;
};

struct fb_monspecs {
        struct fb_chroma chroma;
	__u32 hfmin;			/* hfreq lower limit (Hz) */
	__u32 hfmax; 			/* hfreq upper limit (Hz) */
	__u16 vfmin;			/* vfreq lower limit (Hz) */
	__u16 vfmax;			/* vfreq upper limit (Hz) */
	__u32 dclkmin;                  /* pixelclock lower limit (Hz) */
	__u32 dclkmax;                  /* pixelclock upper limit (Hz) */
	unsigned input;                 /* display type - see FB_DISP_* */
	unsigned dpms;  		/* DPMS support - see FB_DPMS_ */
	unsigned signal;                /* Signal Type - see FB_SIGNAL_* */
	unsigned char max_x;            /* Maximum horizontal size (cm) */
	unsigned char max_y;            /* Maximum vertical size (cm) */
	unsigned gamma;                 /* Gamma - divide value by 100 */
	unsigned gtf  : 1;              /* supports GTF */
	unsigned misc;                  /* Misc flags - see FB_MISC_* */
};

--------------------------------------------------------

5. [fbcon.c]: Minor fixes on the cursor and scrolling.

6. [RIVAFB]:

	a. Implemented I2C/DDC2 support.  Changing video modes should be more
robust even when using stty.
	b. fixed various hardware cursor corruption
	c. fixed maximum yres_virtual.  Hardware accel engine will crash if blit
rectangle dimensions/origin exceeds 0x7fff.
	d. added new boot parameter, "strictmode", to force driver to use only
modes specified in the EDID block.


Comments?

Tony


[-- Attachment #2: patch-fblinux-2.6.0-rc1.diff.gz --]
[-- Type: application/x-gzip, Size: 16946 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-01-06  0:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-05 14:31 [PATCH] DDC2/I2C Support adaplas
     [not found] ` <20040105171639.GA7048@dreamland.darkstar.lan>
2004-01-06  0:31   ` Antonino A. Daplas
     [not found] ` <1073339963.780.93.camel@gaston>
2004-01-06  0:31   ` Antonino A. Daplas
2004-01-06  0:42     ` Benjamin Herrenschmidt
2004-01-06  0:37 ` Benjamin Herrenschmidt

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).