+ viafb-support-color-depth-15-and-30.patch added to -mm tree

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

 



The patch titled
     viafb: support color depth 15 and 30
has been added to the -mm tree.  Its filename is
     viafb-support-color-depth-15-and-30.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: viafb: support color depth 15 and 30
From: Florian Tobias Schandinat <FlorianSchandinat@xxxxxx>

Add support for the color depth 15 on IGA1 and 30 on IGA1 and IGA2.  To
allow the usage of those the driver now refuses color depth that are
totally off and otherwise the selection in viafb_check_var is used. 
Therefore the first call to this for the first framebuffer was delayed a
bit.  It only enables the new formats if they are requested exactly
(viafb_bpp=15|30).

As this is a new feature, no regressions are expected.  The color depth 15
was successfully tested.  Didn't get anything usable for 30 but that might
be the programs fault.  I would like to get some feedback whether it works
as expected or not if somebody knows a program/configuration where it
should.

Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@xxxxxx>
Cc: Joseph Chan <JosephChan@xxxxxxxxxx>
Cc: Scott Fang <ScottFang@xxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/video/via/hw.c       |    9 ++++++
 drivers/video/via/viafbdev.c |   43 +++++++++++++++++++--------------
 2 files changed, 34 insertions(+), 18 deletions(-)

diff -puN drivers/video/via/hw.c~viafb-support-color-depth-15-and-30 drivers/video/via/hw.c
--- a/drivers/video/via/hw.c~viafb-support-color-depth-15-and-30
+++ a/drivers/video/via/hw.c
@@ -694,12 +694,18 @@ void viafb_set_primary_color_depth(u8 de
 	case 8:
 		value = 0x00;
 		break;
+	case 15:
+		value = 0x04;
+		break;
 	case 16:
 		value = 0x14;
 		break;
 	case 24:
 		value = 0x0C;
 		break;
+	case 30:
+		value = 0x08;
+		break;
 	default:
 		printk(KERN_WARNING "viafb_set_primary_color_depth: "
 			"Unsupported depth: %d\n", depth);
@@ -724,6 +730,9 @@ void viafb_set_secondary_color_depth(u8 
 	case 24:
 		value = 0xC0;
 		break;
+	case 30:
+		value = 0x80;
+		break;
 	default:
 		printk(KERN_WARNING "viafb_set_secondary_color_depth: "
 			"Unsupported depth: %d\n", depth);
diff -puN drivers/video/via/viafbdev.c~viafb-support-color-depth-15-and-30 drivers/video/via/viafbdev.c
--- a/drivers/video/via/viafbdev.c~viafb-support-color-depth-15-and-30
+++ a/drivers/video/via/viafbdev.c
@@ -80,6 +80,15 @@ static void viafb_fill_var_color_info(st
 		var->green.length = 8;
 		var->blue.length = 8;
 		break;
+	case 15:
+		var->bits_per_pixel = 16;
+		var->red.offset = 10;
+		var->green.offset = 5;
+		var->blue.offset = 0;
+		var->red.length = 5;
+		var->green.length = 5;
+		var->blue.length = 5;
+		break;
 	case 16:
 		var->bits_per_pixel = 16;
 		var->red.offset = 11;
@@ -98,6 +107,15 @@ static void viafb_fill_var_color_info(st
 		var->green.length = 8;
 		var->blue.length = 8;
 		break;
+	case 30:
+		var->bits_per_pixel = 32;
+		var->red.offset = 20;
+		var->green.offset = 10;
+		var->blue.offset = 0;
+		var->red.length = 10;
+		var->green.length = 10;
+		var->blue.length = 10;
+		break;
 	}
 }
 
@@ -171,6 +189,10 @@ static int viafb_check_var(struct fb_var
 		return -EINVAL;
 	else if (!depth)
 		depth = 24;
+	else if (depth == 15 && viafb_dual_fb && ppar->iga_path == IGA1)
+		depth = 15;
+	else if (depth == 30)
+		depth = 30;
 	else if (depth <= 8)
 		depth = 8;
 	else if (depth <= 16)
@@ -1811,19 +1833,6 @@ static int __devinit via_pci_probe(struc
 			viafb_second_virtual_yres = viafb_second_yres;
 	}
 
-	switch (viafb_bpp) {
-	case 0 ... 8:
-		viafb_bpp = 8;
-		break;
-	case 9 ... 16:
-		viafb_bpp = 16;
-		break;
-	case 17 ... 32:
-		viafb_bpp = 32;
-		break;
-	default:
-		viafb_bpp = 8;
-	}
 	default_var.xres = default_xres;
 	default_var.yres = default_yres;
 	switch (default_xres) {
@@ -1836,8 +1845,6 @@ static int __devinit via_pci_probe(struc
 	}
 	default_var.yres_virtual = default_yres;
 	default_var.bits_per_pixel = viafb_bpp;
-	if (default_var.bits_per_pixel == 15)
-		default_var.bits_per_pixel = 16;
 	default_var.pixclock =
 	    viafb_get_pixclock(default_xres, default_yres, viafb_refresh);
 	default_var.left_margin = (default_xres >> 3) & 0xf8;
@@ -1847,7 +1854,6 @@ static int __devinit via_pci_probe(struc
 	default_var.hsync_len = default_var.left_margin;
 	default_var.vsync_len = 4;
 	viafb_setup_fixinfo(&viafbinfo->fix, viaparinfo);
-	viafb_check_var(&default_var, viafbinfo);
 	viafbinfo->var = default_var;
 
 	if (viafb_dual_fb) {
@@ -1883,8 +1889,6 @@ static int __devinit via_pci_probe(struc
 		default_var.yres = viafb_second_yres;
 		default_var.xres_virtual = viafb_second_virtual_xres;
 		default_var.yres_virtual = viafb_second_virtual_yres;
-		if (viafb_bpp1 != viafb_bpp)
-			viafb_bpp1 = viafb_bpp;
 		default_var.bits_per_pixel = viafb_bpp1;
 		default_var.pixclock =
 		    viafb_get_pixclock(viafb_second_xres, viafb_second_yres,
@@ -1904,6 +1908,7 @@ static int __devinit via_pci_probe(struc
 			&viafbinfo1->fix);
 	}
 
+	viafb_check_var(&viafbinfo->var, viafbinfo);
 	viafb_update_fix(viafbinfo);
 	viaparinfo->depth = fb_get_color_depth(&viafbinfo->var,
 		&viafbinfo->fix);
@@ -2070,6 +2075,8 @@ static int __init viafb_init(void)
 #endif
 	if (parse_mode(viafb_mode, &dummy, &dummy)
 		|| parse_mode(viafb_mode1, &dummy, &dummy)
+		|| viafb_bpp < 0 || viafb_bpp > 32
+		|| viafb_bpp1 < 0 || viafb_bpp1 > 32
 		|| parse_active_dev())
 		return -EINVAL;
 
_

Patches currently in -mm which might be from FlorianSchandinat@xxxxxx are

viafb-deprecate-private-ioctls.patch
viafb-remove-dead-code.patch
viafb-split-global-index-up.patch
viafb-split-global-index-up-fix.patch
viafb-remove-the-remaining-via_res_-uses.patch
viafb-some-dvi-cleanup.patch
viafb-yet-another-dead-code-removal.patch
viafb-reorder-initialization-for-dual-framebuffer-mode.patch
viafb-video-address-setting-revisited.patch
viafb-make-viafb_set_par-more-dual-framebuffer-compatible.patch
viafb-introduce-strict-parameter-checking.patch
viafb-split-color-mode-setting-up.patch
viafb-remove-dead-code-due-to-iga1_iga2.patch
viafb-make-some-variables-a-bit-less-global.patch
viafb-rework-color-checking.patch
viafb-some-virtual_xres-handling-fixes.patch
viafb-rework-color-setting.patch
viafb-support-color-depth-15-and-30.patch
drivers-video-via-fix-continuation-line-formats.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux