aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-01-09 23:54:04 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-10 11:01:56 -0500
commita0aa7d0639277f375989071fb52a7ce78beeef97 (patch)
tree5189b4cae286c754f5193f6ac465e3fff31732b6 /drivers/video
parent1d64ec153e914cbd60cfaaa47ececed55a9d14d7 (diff)
[PATCH] drivers/video/: possible cleanups
This patch contains the possible cleanups including the following: - every file should #include the headers containing the prototypes for it's global functions - make needlessly global functions static - kyro/STG4000Interface.h: #include video/kyro.h and linux/pci.h instead of a manual "struct pci_dev" - i810_main.{c,h}: prototypes for static functions belong to the C file Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: "Antonino A. Daplas" <adaplas@hotpop.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/arcfb.c8
-rw-r--r--drivers/video/console/softcursor.c2
-rw-r--r--drivers/video/i810/i810-i2c.c1
-rw-r--r--drivers/video/i810/i810_accel.c1
-rw-r--r--drivers/video/i810/i810_gtf.c1
-rw-r--r--drivers/video/i810/i810_main.c51
-rw-r--r--drivers/video/i810/i810_main.h56
-rw-r--r--drivers/video/kyro/STG4000InitDevice.c1
-rw-r--r--drivers/video/kyro/STG4000Interface.h3
-rw-r--r--drivers/video/kyro/STG4000OverlayDevice.c1
-rw-r--r--drivers/video/matrox/matroxfb_g450.c2
-rw-r--r--drivers/video/nvidia/nv_hw.c1
-rw-r--r--drivers/video/tdfxfb.c2
13 files changed, 68 insertions, 62 deletions
diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c
index 2784f0a9d693..89060b2db8e5 100644
--- a/drivers/video/arcfb.c
+++ b/drivers/video/arcfb.c
@@ -366,7 +366,8 @@ static void arcfb_lcd_update(struct arcfb_par *par, unsigned int dx,
366 } 366 }
367} 367}
368 368
369void arcfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect) 369static void arcfb_fillrect(struct fb_info *info,
370 const struct fb_fillrect *rect)
370{ 371{
371 struct arcfb_par *par = info->par; 372 struct arcfb_par *par = info->par;
372 373
@@ -376,7 +377,8 @@ void arcfb_fillrect(struct fb_info *info, const struct fb_fillrect *rect)
376 arcfb_lcd_update(par, rect->dx, rect->dy, rect->width, rect->height); 377 arcfb_lcd_update(par, rect->dx, rect->dy, rect->width, rect->height);
377} 378}
378 379
379void arcfb_copyarea(struct fb_info *info, const struct fb_copyarea *area) 380static void arcfb_copyarea(struct fb_info *info,
381 const struct fb_copyarea *area)
380{ 382{
381 struct arcfb_par *par = info->par; 383 struct arcfb_par *par = info->par;
382 384
@@ -386,7 +388,7 @@ void arcfb_copyarea(struct fb_info *info, const struct fb_copyarea *area)
386 arcfb_lcd_update(par, area->dx, area->dy, area->width, area->height); 388 arcfb_lcd_update(par, area->dx, area->dy, area->width, area->height);
387} 389}
388 390
389void arcfb_imageblit(struct fb_info *info, const struct fb_image *image) 391static void arcfb_imageblit(struct fb_info *info, const struct fb_image *image)
390{ 392{
391 struct arcfb_par *par = info->par; 393 struct arcfb_par *par = info->par;
392 394
diff --git a/drivers/video/console/softcursor.c b/drivers/video/console/softcursor.c
index 8529bf08db28..3957fc7523e2 100644
--- a/drivers/video/console/softcursor.c
+++ b/drivers/video/console/softcursor.c
@@ -17,6 +17,8 @@
17#include <asm/uaccess.h> 17#include <asm/uaccess.h>
18#include <asm/io.h> 18#include <asm/io.h>
19 19
20#include "fbcon.h"
21
20int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) 22int soft_cursor(struct fb_info *info, struct fb_cursor *cursor)
21{ 23{
22 unsigned int scan_align = info->pixmap.scan_align - 1; 24 unsigned int scan_align = info->pixmap.scan_align - 1;
diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c
index 13c17438fb8c..bd410e06db73 100644
--- a/drivers/video/i810/i810-i2c.c
+++ b/drivers/video/i810/i810-i2c.c
@@ -17,6 +17,7 @@
17#include <linux/fb.h> 17#include <linux/fb.h>
18#include "i810.h" 18#include "i810.h"
19#include "i810_regs.h" 19#include "i810_regs.h"
20#include "i810_main.h"
20#include "../edid.h" 21#include "../edid.h"
21 22
22#define I810_DDC 0x50 23#define I810_DDC 0x50
diff --git a/drivers/video/i810/i810_accel.c b/drivers/video/i810/i810_accel.c
index 84f9cc10636f..76764ea3486a 100644
--- a/drivers/video/i810/i810_accel.c
+++ b/drivers/video/i810/i810_accel.c
@@ -14,6 +14,7 @@
14 14
15#include "i810_regs.h" 15#include "i810_regs.h"
16#include "i810.h" 16#include "i810.h"
17#include "i810_main.h"
17 18
18static u32 i810fb_rop[] = { 19static u32 i810fb_rop[] = {
19 COLOR_COPY_ROP, /* ROP_COPY */ 20 COLOR_COPY_ROP, /* ROP_COPY */
diff --git a/drivers/video/i810/i810_gtf.c b/drivers/video/i810/i810_gtf.c
index 64f087a4466b..9743d51e7f8c 100644
--- a/drivers/video/i810/i810_gtf.c
+++ b/drivers/video/i810/i810_gtf.c
@@ -14,6 +14,7 @@
14 14
15#include "i810_regs.h" 15#include "i810_regs.h"
16#include "i810.h" 16#include "i810.h"
17#include "i810_main.h"
17 18
18/* 19/*
19 * FIFO and Watermark tables - based almost wholly on i810_wmark.c in 20 * FIFO and Watermark tables - based almost wholly on i810_wmark.c in
diff --git a/drivers/video/i810/i810_main.c b/drivers/video/i810/i810_main.c
index d27cd19b7f70..266d0ab92663 100644
--- a/drivers/video/i810/i810_main.c
+++ b/drivers/video/i810/i810_main.c
@@ -46,17 +46,58 @@
46 46
47#include <asm/io.h> 47#include <asm/io.h>
48#include <asm/div64.h> 48#include <asm/div64.h>
49
50#ifdef CONFIG_MTRR
51#include <asm/mtrr.h>
52#endif
53
54#include <asm/page.h> 49#include <asm/page.h>
55 50
56#include "i810_regs.h" 51#include "i810_regs.h"
57#include "i810.h" 52#include "i810.h"
58#include "i810_main.h" 53#include "i810_main.h"
59 54
55/*
56 * voffset - framebuffer offset in MiB from aperture start address. In order for
57 * the driver to work with X, we must try to use memory holes left untouched by X. The
58 * following table lists where X's different surfaces start at.
59 *
60 * ---------------------------------------------
61 * : : 64 MiB : 32 MiB :
62 * ----------------------------------------------
63 * : FrontBuffer : 0 : 0 :
64 * : DepthBuffer : 48 : 16 :
65 * : BackBuffer : 56 : 24 :
66 * ----------------------------------------------
67 *
68 * So for chipsets with 64 MiB Aperture sizes, 32 MiB for v_offset is okay, allowing up to
69 * 15 + 1 MiB of Framebuffer memory. For 32 MiB Aperture sizes, a v_offset of 8 MiB should
70 * work, allowing 7 + 1 MiB of Framebuffer memory.
71 * Note, the size of the hole may change depending on how much memory you allocate to X,
72 * and how the memory is split up between these surfaces.
73 *
74 * Note: Anytime the DepthBuffer or FrontBuffer is overlapped, X would still run but with
75 * DRI disabled. But if the Frontbuffer is overlapped, X will fail to load.
76 *
77 * Experiment with v_offset to find out which works best for you.
78 */
79static u32 v_offset_default __initdata; /* For 32 MiB Aper size, 8 should be the default */
80static u32 voffset __initdata = 0;
81
82static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
83static int __devinit i810fb_init_pci (struct pci_dev *dev,
84 const struct pci_device_id *entry);
85static void __exit i810fb_remove_pci(struct pci_dev *dev);
86static int i810fb_resume(struct pci_dev *dev);
87static int i810fb_suspend(struct pci_dev *dev, pm_message_t state);
88
89/* Chipset Specific Functions */
90static int i810fb_set_par (struct fb_info *info);
91static int i810fb_getcolreg (u8 regno, u8 *red, u8 *green, u8 *blue,
92 u8 *transp, struct fb_info *info);
93static int i810fb_setcolreg (unsigned regno, unsigned red, unsigned green, unsigned blue,
94 unsigned transp, struct fb_info *info);
95static int i810fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
96static int i810fb_blank (int blank_mode, struct fb_info *info);
97
98/* Initialization */
99static void i810fb_release_resource (struct fb_info *info, struct i810fb_par *par);
100
60/* PCI */ 101/* PCI */
61static const char *i810_pci_list[] __devinitdata = { 102static const char *i810_pci_list[] __devinitdata = {
62 "Intel(R) 810 Framebuffer Device" , 103 "Intel(R) 810 Framebuffer Device" ,
diff --git a/drivers/video/i810/i810_main.h b/drivers/video/i810/i810_main.h
index 06072a6466f2..51d4f3d4116d 100644
--- a/drivers/video/i810/i810_main.h
+++ b/drivers/video/i810/i810_main.h
@@ -14,55 +14,6 @@
14#ifndef __I810_MAIN_H__ 14#ifndef __I810_MAIN_H__
15#define __I810_MAIN_H__ 15#define __I810_MAIN_H__
16 16
17static int __devinit i810fb_init_pci (struct pci_dev *dev,
18 const struct pci_device_id *entry);
19static void __exit i810fb_remove_pci(struct pci_dev *dev);
20static int i810fb_resume(struct pci_dev *dev);
21static int i810fb_suspend(struct pci_dev *dev, pm_message_t state);
22
23/*
24 * voffset - framebuffer offset in MiB from aperture start address. In order for
25 * the driver to work with X, we must try to use memory holes left untouched by X. The
26 * following table lists where X's different surfaces start at.
27 *
28 * ---------------------------------------------
29 * : : 64 MiB : 32 MiB :
30 * ----------------------------------------------
31 * : FrontBuffer : 0 : 0 :
32 * : DepthBuffer : 48 : 16 :
33 * : BackBuffer : 56 : 24 :
34 * ----------------------------------------------
35 *
36 * So for chipsets with 64 MiB Aperture sizes, 32 MiB for v_offset is okay, allowing up to
37 * 15 + 1 MiB of Framebuffer memory. For 32 MiB Aperture sizes, a v_offset of 8 MiB should
38 * work, allowing 7 + 1 MiB of Framebuffer memory.
39 * Note, the size of the hole may change depending on how much memory you allocate to X,
40 * and how the memory is split up between these surfaces.
41 *
42 * Note: Anytime the DepthBuffer or FrontBuffer is overlapped, X would still run but with
43 * DRI disabled. But if the Frontbuffer is overlapped, X will fail to load.
44 *
45 * Experiment with v_offset to find out which works best for you.
46 */
47static u32 v_offset_default __initdata; /* For 32 MiB Aper size, 8 should be the default */
48static u32 voffset __initdata = 0;
49
50static int i810fb_cursor(struct fb_info *info, struct fb_cursor *cursor);
51
52/* Chipset Specific Functions */
53static int i810fb_set_par (struct fb_info *info);
54static int i810fb_getcolreg (u8 regno, u8 *red, u8 *green, u8 *blue,
55 u8 *transp, struct fb_info *info);
56static int i810fb_setcolreg (unsigned regno, unsigned red, unsigned green, unsigned blue,
57 unsigned transp, struct fb_info *info);
58static int i810fb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info);
59static int i810fb_blank (int blank_mode, struct fb_info *info);
60
61/* Initialization */
62static void i810fb_release_resource (struct fb_info *info, struct i810fb_par *par);
63extern int __init agp_intel_init(void);
64
65
66/* Video Timings */ 17/* Video Timings */
67extern void round_off_xres (u32 *xres); 18extern void round_off_xres (u32 *xres);
68extern void round_off_yres (u32 *xres, u32 *yres); 19extern void round_off_yres (u32 *xres, u32 *yres);
@@ -101,7 +52,7 @@ static inline void i810_delete_i2c_busses(struct i810fb_par *par) { }
101 52
102/* Conditionals */ 53/* Conditionals */
103#ifdef CONFIG_X86 54#ifdef CONFIG_X86
104inline void flush_cache(void) 55static inline void flush_cache(void)
105{ 56{
106 asm volatile ("wbinvd":::"memory"); 57 asm volatile ("wbinvd":::"memory");
107} 58}
@@ -110,7 +61,9 @@ inline void flush_cache(void)
110#endif 61#endif
111 62
112#ifdef CONFIG_MTRR 63#ifdef CONFIG_MTRR
113#define KERNEL_HAS_MTRR 1 64
65#include <asm/mtrr.h>
66
114static inline void __devinit set_mtrr(struct i810fb_par *par) 67static inline void __devinit set_mtrr(struct i810fb_par *par)
115{ 68{
116 par->mtrr_reg = mtrr_add((u32) par->aperture.physical, 69 par->mtrr_reg = mtrr_add((u32) par->aperture.physical,
@@ -128,7 +81,6 @@ static inline void unset_mtrr(struct i810fb_par *par)
128 par->aperture.size); 81 par->aperture.size);
129} 82}
130#else 83#else
131#define KERNEL_HAS_MTRR 0
132#define set_mtrr(x) printk("set_mtrr: MTRR is disabled in the kernel\n") 84#define set_mtrr(x) printk("set_mtrr: MTRR is disabled in the kernel\n")
133 85
134#define unset_mtrr(x) do { } while (0) 86#define unset_mtrr(x) do { } while (0)
diff --git a/drivers/video/kyro/STG4000InitDevice.c b/drivers/video/kyro/STG4000InitDevice.c
index 7e33cd307d47..ab5285a7f1d6 100644
--- a/drivers/video/kyro/STG4000InitDevice.c
+++ b/drivers/video/kyro/STG4000InitDevice.c
@@ -15,6 +15,7 @@
15#include <linux/pci.h> 15#include <linux/pci.h>
16 16
17#include "STG4000Reg.h" 17#include "STG4000Reg.h"
18#include "STG4000Interface.h"
18 19
19/* SDRAM fixed settings */ 20/* SDRAM fixed settings */
20#define SDRAM_CFG_0 0x49A1 21#define SDRAM_CFG_0 0x49A1
diff --git a/drivers/video/kyro/STG4000Interface.h b/drivers/video/kyro/STG4000Interface.h
index e75b3b4a4aa1..b7c83d5dfb13 100644
--- a/drivers/video/kyro/STG4000Interface.h
+++ b/drivers/video/kyro/STG4000Interface.h
@@ -11,7 +11,8 @@
11#ifndef _STG4000INTERFACE_H 11#ifndef _STG4000INTERFACE_H
12#define _STG4000INTERFACE_H 12#define _STG4000INTERFACE_H
13 13
14struct pci_dev; 14#include <linux/pci.h>
15#include <video/kyro.h>
15 16
16/* 17/*
17 * Ramdac Setup 18 * Ramdac Setup
diff --git a/drivers/video/kyro/STG4000OverlayDevice.c b/drivers/video/kyro/STG4000OverlayDevice.c
index 2ae9bafacdd0..a8c9713413e6 100644
--- a/drivers/video/kyro/STG4000OverlayDevice.c
+++ b/drivers/video/kyro/STG4000OverlayDevice.c
@@ -14,6 +14,7 @@
14#include <linux/types.h> 14#include <linux/types.h>
15 15
16#include "STG4000Reg.h" 16#include "STG4000Reg.h"
17#include "STG4000Interface.h"
17 18
18/* HW Defines */ 19/* HW Defines */
19 20
diff --git a/drivers/video/matrox/matroxfb_g450.c b/drivers/video/matrox/matroxfb_g450.c
index 35008af7db75..c122d8743dd2 100644
--- a/drivers/video/matrox/matroxfb_g450.c
+++ b/drivers/video/matrox/matroxfb_g450.c
@@ -20,6 +20,8 @@
20#include <asm/uaccess.h> 20#include <asm/uaccess.h>
21#include <asm/div64.h> 21#include <asm/div64.h>
22 22
23#include "matroxfb_g450.h"
24
23/* Definition of the various controls */ 25/* Definition of the various controls */
24struct mctl { 26struct mctl {
25 struct v4l2_queryctrl desc; 27 struct v4l2_queryctrl desc;
diff --git a/drivers/video/nvidia/nv_hw.c b/drivers/video/nvidia/nv_hw.c
index 454283f9bdac..99c3a8e6a237 100644
--- a/drivers/video/nvidia/nv_hw.c
+++ b/drivers/video/nvidia/nv_hw.c
@@ -52,6 +52,7 @@
52#include <linux/pci.h> 52#include <linux/pci.h>
53#include "nv_type.h" 53#include "nv_type.h"
54#include "nv_local.h" 54#include "nv_local.h"
55#include "nv_proto.h"
55 56
56void NVLockUnlock(struct nvidia_par *par, int Lock) 57void NVLockUnlock(struct nvidia_par *par, int Lock)
57{ 58{
diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c
index c88b5348c4ee..3e7baf4c9fa8 100644
--- a/drivers/video/tdfxfb.c
+++ b/drivers/video/tdfxfb.c
@@ -1312,7 +1312,7 @@ out_err:
1312} 1312}
1313 1313
1314#ifndef MODULE 1314#ifndef MODULE
1315void tdfxfb_setup(char *options) 1315static void tdfxfb_setup(char *options)
1316{ 1316{
1317 char* this_opt; 1317 char* this_opt;
1318 1318