diff mbox

s3fb: maximize virtual vertical size for fast scrolling

Message ID 201102201937.19112.linux@rainbow-software.org (mailing list archive)
State Accepted
Commit 99d054d8253b1dbc6ab2d4ebcb25ad4a4e6ba1c8
Headers show

Commit Message

Ondrej Zary Feb. 20, 2011, 6:37 p.m. UTC
None
diff mbox

Patch

--- linux-2.6.38-rc4-/drivers/video/s3fb.c	2011-02-20 19:11:28.000000000 +0100
+++ linux-2.6.38-rc4/drivers/video/s3fb.c	2011-02-20 19:17:04.000000000 +0100
@@ -1060,6 +1060,14 @@  static int __devinit s3_pci_probe(struct
 		goto err_find_mode;
 	}
 
+	/* maximize virtual vertical size for fast scrolling */
+	info->var.yres_virtual = info->fix.smem_len * 8 /
+			(info->var.bits_per_pixel * info->var.xres_virtual);
+	if (info->var.yres_virtual < info->var.yres) {
+		dev_err(info->device, "virtual vertical size smaller than real\n");
+		goto err_find_mode;
+	}
+
 	rc = fb_alloc_cmap(&info->cmap, 256, 0);
 	if (rc < 0) {
 		dev_err(info->device, "cannot allocate colormap\n");