From 52d1d9581402ebcd57905e229a15f7984f78d881 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Sat, 17 Dec 2016 19:29:52 +0000 Subject: [PATCH] finish radeon and USB card detect --- include/driver_vec.h | 123 +---------------- include/fb.h | 288 ++++++++++++++++++++-------------------- include/radeonfb.h | 66 ++++----- include/version.h | 2 +- radeon/radeon_accel.c | 87 ++++++------ radeon/radeon_base.c | 194 +++++++++++++-------------- radeon/radeon_cursor.c | 6 +- radeon/radeon_i2c.c | 2 +- radeon/radeon_monitor.c | 4 +- video/fbmem.c | 22 +-- video/fbmodedb.c | 28 ++-- video/fbmon.c | 78 +++++------ video/offscreen.c | 2 +- video/video.c | 2 +- 14 files changed, 394 insertions(+), 510 deletions(-) diff --git a/include/driver_vec.h b/include/driver_vec.h index 70f5cf9..6ac7ad9 100644 --- a/include/driver_vec.h +++ b/include/driver_vec.h @@ -81,128 +81,7 @@ struct xhdi_driver_interface uint32_t (*xhdivec)(); }; -/* - * Interpretation of offset for color fields: All offsets are from the right, - * inside a "pixel" value, which is exactly 'bits_per_pixel' wide (means: you - * can use the offset as right argument to <<). A pixel afterwards is a bit - * stream and is written to video memory as that unmodified. This implies - * big-endian byte order if bits_per_pixel is greater than 8. - */ -struct fb_bitfield -{ - unsigned long offset; /* beginning of bitfield */ - unsigned long length; /* length of bitfield */ - unsigned long msb_right; /* != 0 : Most significant bit is */ - /* right */ -}; - -/* - * the following structures define the interface to the BaS-builtin-framebuffer video driver - */ -struct fb_var_screeninfo -{ - unsigned long xres; /* visible resolution */ - unsigned long yres; - unsigned long xres_virtual; /* virtual resolution */ - unsigned long yres_virtual; - unsigned long xoffset; /* offset from virtual to visible */ - unsigned long yoffset; /* resolution */ - - unsigned long bits_per_pixel; /* guess what */ - unsigned long grayscale; /* != 0 Graylevels instead of colors */ - - struct fb_bitfield red; /* bitfield in fb mem if true color, */ - struct fb_bitfield green; /* else only length is significant */ - struct fb_bitfield blue; - struct fb_bitfield transp; /* transparency */ - - unsigned long nonstd; /* != 0 Non standard pixel format */ - - unsigned long activate; /* see FB_ACTIVATE_* */ - - unsigned long height; /* height of picture in mm */ - unsigned long width; /* width of picture in mm */ - - unsigned long accel_flags; /* (OBSOLETE) see fb_info.flags */ - - /* Timing: All values in pixclocks, except pixclock (of course) */ - unsigned long pixclock; /* pixel clock in ps (pico seconds) */ - unsigned long left_margin; /* time from sync to picture */ - unsigned long right_margin; /* time from picture to sync */ - unsigned long upper_margin; /* time from sync to picture */ - unsigned long lower_margin; - unsigned long hsync_len; /* length of horizontal sync */ - unsigned long vsync_len; /* length of vertical sync */ - unsigned long sync; /* see FB_SYNC_* */ - unsigned long vmode; /* see FB_VMODE_* */ - unsigned long rotate; /* angle we rotate counter clockwise */ - unsigned long refresh; - unsigned long reserved[4]; /* Reserved for future compatibility */ -}; - -struct fb_fix_screeninfo -{ - char id[16]; /* identification string eg "TT Builtin" */ - unsigned long smem_start; /* Start of frame buffer mem */ - /* (physical address) */ - unsigned long smem_len; /* Length of frame buffer mem */ - unsigned long type; /* see FB_TYPE_* */ - unsigned long type_aux; /* Interleave for interleaved Planes */ - unsigned long visual; /* see FB_VISUAL_* */ - unsigned short xpanstep; /* zero if no hardware panning */ - unsigned short ypanstep; /* zero if no hardware panning */ - unsigned short ywrapstep; /* zero if no hardware ywrap */ - unsigned long line_length; /* length of a line in bytes */ - unsigned long mmio_start; /* Start of Memory Mapped I/O */ - /* (physical address) */ - unsigned long mmio_len; /* Length of Memory Mapped I/O */ - unsigned long accel; /* Indicate to driver which */ - /* specific chip/card we have */ - unsigned short reserved[3]; /* Reserved for future compatibility */ -}; - -struct fb_chroma -{ - unsigned long redx; /* in fraction of 1024 */ - unsigned long greenx; - unsigned long bluex; - unsigned long whitex; - unsigned long redy; - unsigned long greeny; - unsigned long bluey; - unsigned long whitey; -}; - -struct fb_monspecs -{ - struct fb_chroma chroma; - struct fb_videomode *modedb; /* mode database */ - unsigned char manufacturer[4]; /* Manufacturer */ - unsigned char monitor[14]; /* Monitor String */ - unsigned char serial_no[14]; /* Serial Number */ - unsigned char ascii[14]; /* ? */ - unsigned long modedb_len; /* mode database length */ - unsigned long model; /* Monitor Model */ - unsigned long serial; /* Serial Number - Integer */ - unsigned long year; /* Year manufactured */ - unsigned long week; /* Week Manufactured */ - unsigned long hfmin; /* hfreq lower limit (Hz) */ - unsigned long hfmax; /* hfreq upper limit (Hz) */ - unsigned long dclkmin; /* pixelclock lower limit (Hz) */ - unsigned long dclkmax; /* pixelclock upper limit (Hz) */ - unsigned short input; /* display type - see FB_DISP_* */ - unsigned short dpms; /* DPMS support - see FB_DPMS_ */ - unsigned short signal; /* Signal Type - see FB_SIGNAL_* */ - unsigned short vfmin; /* vfreq lower limit (Hz) */ - unsigned short vfmax; /* vfreq upper limit (Hz) */ - unsigned short gamma; /* Gamma - in fractions of 100 */ - unsigned short gtf : 1; /* supports GTF */ - unsigned short misc; /* Misc flags - see FB_MISC_* */ - unsigned char version; /* EDID version... */ - unsigned char revision; /* ...and revision */ - unsigned char max_x; /* Maximum horizontal size (cm) */ - unsigned char max_y; /* Maximum vertical size (cm) */ -}; +#include "fb.h" struct framebuffer_driver_interface { diff --git a/include/fb.h b/include/fb.h index c0fb6c8..5f6ad14 100644 --- a/include/fb.h +++ b/include/fb.h @@ -1,6 +1,8 @@ #ifndef _FB_H #define _FB_H +#include "bas_types.h" + /* Definitions of frame buffers */ #define FB_MAJOR 29 @@ -183,22 +185,22 @@ extern struct mode_option resolution; /* fVDI */ struct fb_fix_screeninfo { char id[16]; /* identification string eg "TT Builtin" */ - unsigned long smem_start; /* Start of frame buffer mem */ + uint32_t smem_start; /* Start of frame buffer mem */ /* (physical address) */ - unsigned long smem_len; /* Length of frame buffer mem */ - unsigned long type; /* see FB_TYPE_* */ - unsigned long type_aux; /* Interleave for interleaved Planes */ - unsigned long visual; /* see FB_VISUAL_* */ - unsigned short xpanstep; /* zero if no hardware panning */ - unsigned short ypanstep; /* zero if no hardware panning */ - unsigned short ywrapstep; /* zero if no hardware ywrap */ - unsigned long line_length; /* length of a line in bytes */ - unsigned long mmio_start; /* Start of Memory Mapped I/O */ + uint32_t smem_len; /* Length of frame buffer mem */ + uint32_t type; /* see FB_TYPE_* */ + uint32_t type_aux; /* Interleave for interleaved Planes */ + uint32_t visual; /* see FB_VISUAL_* */ + uint16_t xpanstep; /* zero if no hardware panning */ + uint16_t ypanstep; /* zero if no hardware panning */ + uint16_t ywrapstep; /* zero if no hardware ywrap */ + uint32_t line_length; /* length of a line in bytes */ + uint32_t mmio_start; /* Start of Memory Mapped I/O */ /* (physical address) */ - unsigned long mmio_len; /* Length of Memory Mapped I/O */ - unsigned long accel; /* Indicate to driver which */ + uint32_t mmio_len; /* Length of Memory Mapped I/O */ + uint32_t accel; /* Indicate to driver which */ /* specific chip/card we have */ - unsigned short reserved[3]; /* Reserved for future compatibility */ + uint16_t reserved[3]; /* Reserved for future compatibility */ }; /* Interpretation of offset for color fields: All offsets are from the right, @@ -209,9 +211,9 @@ struct fb_fix_screeninfo */ struct fb_bitfield { - unsigned long offset; /* beginning of bitfield */ - unsigned long length; /* length of bitfield */ - unsigned long msb_right; /* != 0 : Most significant bit is */ + uint32_t offset; /* beginning of bitfield */ + uint32_t length; /* length of bitfield */ + uint32_t msb_right; /* != 0 : Most significant bit is */ /* right */ }; @@ -253,43 +255,43 @@ struct fb_bitfield struct fb_var_screeninfo { - unsigned long xres; /* visible resolution */ - unsigned long yres; - unsigned long xres_virtual; /* virtual resolution */ - unsigned long yres_virtual; - unsigned long xoffset; /* offset from virtual to visible */ - unsigned long yoffset; /* resolution */ + uint32_t xres; /* visible resolution */ + uint32_t yres; + uint32_t xres_virtual; /* virtual resolution */ + uint32_t yres_virtual; + uint32_t xoffset; /* offset from virtual to visible */ + uint32_t yoffset; /* resolution */ - unsigned long bits_per_pixel; /* guess what */ - unsigned long grayscale; /* != 0 Graylevels instead of colors */ + uint32_t bits_per_pixel; /* guess what */ + uint32_t grayscale; /* != 0 Graylevels instead of colors */ struct fb_bitfield red; /* bitfield in fb mem if true color, */ struct fb_bitfield green; /* else only length is significant */ struct fb_bitfield blue; struct fb_bitfield transp; /* transparency */ - unsigned long nonstd; /* != 0 Non standard pixel format */ + uint32_t nonstd; /* != 0 Non standard pixel format */ - unsigned long activate; /* see FB_ACTIVATE_* */ + uint32_t activate; /* see FB_ACTIVATE_* */ - unsigned long height; /* height of picture in mm */ - unsigned long width; /* width of picture in mm */ + uint32_t height; /* height of picture in mm */ + uint32_t width; /* width of picture in mm */ - unsigned long accel_flags; /* (OBSOLETE) see fb_info.flags */ + uint32_t accel_flags; /* (OBSOLETE) see fb_info.flags */ /* Timing: All values in pixclocks, except pixclock (of course) */ - unsigned long pixclock; /* pixel clock in ps (pico seconds) */ - unsigned long left_margin; /* time from sync to picture */ - unsigned long right_margin; /* time from picture to sync */ - unsigned long upper_margin; /* time from sync to picture */ - unsigned long lower_margin; - unsigned long hsync_len; /* length of horizontal sync */ - unsigned long vsync_len; /* length of vertical sync */ - unsigned long sync; /* see FB_SYNC_* */ - unsigned long vmode; /* see FB_VMODE_* */ - unsigned long rotate; /* angle we rotate counter clockwise */ - unsigned long refresh; - unsigned long reserved[4]; /* Reserved for future compatibility */ + uint32_t pixclock; /* pixel clock in ps (pico seconds) */ + uint32_t left_margin; /* time from sync to picture */ + uint32_t right_margin; /* time from picture to sync */ + uint32_t upper_margin; /* time from sync to picture */ + uint32_t lower_margin; + uint32_t hsync_len; /* length of horizontal sync */ + uint32_t vsync_len; /* length of vertical sync */ + uint32_t sync; /* see FB_SYNC_* */ + uint32_t vmode; /* see FB_VMODE_* */ + uint32_t rotate; /* angle we rotate counter clockwise */ + uint32_t refresh; + uint32_t reserved[4]; /* Reserved for future compatibility */ }; /* VESA Blanking Levels */ @@ -324,11 +326,11 @@ enum struct fb_vblank { - unsigned long flags; /* FB_VBLANK flags */ - unsigned long count; /* counter of retraces since boot */ - unsigned long vcount; /* current scanline position */ - unsigned long hcount; /* current scandot position */ - unsigned long reserved[4]; /* reserved for future compatibility */ + uint32_t flags; /* FB_VBLANK flags */ + uint32_t count; /* counter of retraces since boot */ + uint32_t vcount; /* current scanline position */ + uint32_t hcount; /* current scandot position */ + uint32_t reserved[4]; /* reserved for future compatibility */ }; struct vm_area_struct; @@ -364,65 +366,65 @@ struct file; struct fb_chroma { - unsigned long redx; /* in fraction of 1024 */ - unsigned long greenx; - unsigned long bluex; - unsigned long whitex; - unsigned long redy; - unsigned long greeny; - unsigned long bluey; - unsigned long whitey; + uint32_t redx; /* in fraction of 1024 */ + uint32_t greenx; + uint32_t bluex; + uint32_t whitex; + uint32_t redy; + uint32_t greeny; + uint32_t bluey; + uint32_t whitey; }; struct fb_monspecs { struct fb_chroma chroma; struct fb_videomode *modedb; /* mode database */ - unsigned char manufacturer[4]; /* Manufacturer */ - unsigned char monitor[14]; /* Monitor String */ - unsigned char serial_no[14]; /* Serial Number */ - unsigned char ascii[14]; /* ? */ - unsigned long modedb_len; /* mode database length */ - unsigned long model; /* Monitor Model */ - unsigned long serial; /* Serial Number - Integer */ - unsigned long year; /* Year manufactured */ - unsigned long week; /* Week Manufactured */ - unsigned long hfmin; /* hfreq lower limit (Hz) */ - unsigned long hfmax; /* hfreq upper limit (Hz) */ - unsigned long dclkmin; /* pixelclock lower limit (Hz) */ - unsigned long dclkmax; /* pixelclock upper limit (Hz) */ - unsigned short input; /* display type - see FB_DISP_* */ - unsigned short dpms; /* DPMS support - see FB_DPMS_ */ - unsigned short signal; /* Signal Type - see FB_SIGNAL_* */ - unsigned short vfmin; /* vfreq lower limit (Hz) */ - unsigned short vfmax; /* vfreq upper limit (Hz) */ - unsigned short gamma; /* Gamma - in fractions of 100 */ - unsigned short gtf : 1; /* supports GTF */ - unsigned short misc; /* Misc flags - see FB_MISC_* */ - unsigned char version; /* EDID version... */ - unsigned char revision; /* ...and revision */ - unsigned char max_x; /* Maximum horizontal size (cm) */ - unsigned char max_y; /* Maximum vertical size (cm) */ + uint8_t manufacturer[4]; /* Manufacturer */ + uint8_t monitor[14]; /* Monitor String */ + uint8_t serial_no[14]; /* Serial Number */ + uint8_t ascii[14]; /* ? */ + uint32_t modedb_len; /* mode database length */ + uint32_t model; /* Monitor Model */ + uint32_t serial; /* Serial Number - Integer */ + uint32_t year; /* Year manufactured */ + uint32_t week; /* Week Manufactured */ + uint32_t hfmin; /* hfreq lower limit (Hz) */ + uint32_t hfmax; /* hfreq upper limit (Hz) */ + uint32_t dclkmin; /* pixelclock lower limit (Hz) */ + uint32_t dclkmax; /* pixelclock upper limit (Hz) */ + uint16_t input; /* display type - see FB_DISP_* */ + uint16_t dpms; /* DPMS support - see FB_DPMS_ */ + uint16_t signal; /* Signal Type - see FB_SIGNAL_* */ + uint16_t vfmin; /* vfreq lower limit (Hz) */ + uint16_t vfmax; /* vfreq upper limit (Hz) */ + uint16_t gamma; /* Gamma - in fractions of 100 */ + uint16_t gtf : 1; /* supports GTF */ + uint16_t misc; /* Misc flags - see FB_MISC_* */ + uint8_t version; /* EDID version... */ + uint8_t revision; /* ...and revision */ + uint8_t max_x; /* Maximum horizontal size (cm) */ + uint8_t max_y; /* Maximum vertical size (cm) */ }; struct fb_ops { /* checks var and eventually tweaks if to something supported, * DO NOT MODIFY PAR */ - int (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info); + int32_t (*fb_check_var)(struct fb_var_screeninfo *var, struct fb_info *info); /* set the video mode according to info->var */ - int (*fb_set_par)(struct fb_info *info); + int32_t (*fb_set_par)(struct fb_info *info); /* set color register */ - int (*fb_setcolreg)(unsigned regno, unsigned red, unsigned green, - unsigned blue, unsigned transp, struct fb_info *info); + int32_t (*fb_setcolreg)(uint32_t regno, uint32_t red, uint32_t green, + uint32_t blue, uint32_t transp, struct fb_info *info); /* pan display */ - int (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info); + int32_t (*fb_pan_display)(struct fb_var_screeninfo *var, struct fb_info *info); /* blank display */ - int (*fb_blank)(int blank, struct fb_info *info); + int32_t (*fb_blank)(int32_t blank, struct fb_info *info); /* wait for blit idle */ - int (*fb_sync)(struct fb_info *info); + int32_t (*fb_sync)(struct fb_info *info); /* perform fb specific ioctl */ - int (*fb_ioctl)(unsigned int cmd, unsigned long arg, struct fb_info *info); + int32_t (*fb_ioctl)(uint32_t cmd, uint32_t arg, struct fb_info *info); /* Buildthe modedb for head 1 (head 2 will come later), check panel infos * from either BIOS or EDID, and pick up the default mode */ void (*fb_check_modes)(struct fb_info *info, struct mode_option *resolution); @@ -432,33 +434,33 @@ struct fb_ops #define DEGREES_180 2 #define DEGREES_270 3 #define OMIT_LAST 1 - void (*SetupForSolidFill)(struct fb_info *info, int color, int rop, unsigned int planemask); - void (*SubsequentSolidFillRect)(struct fb_info *info, int x, int y, int w, int h); - void (*SetupForSolidLine)(struct fb_info *info, int color, int rop, unsigned int planemask); - void (*SubsequentSolidHorVertLine)(struct fb_info *info, int x, int y, int len, int dir); - void (*SubsequentSolidTwoPointLine)(struct fb_info *info, int xa, int ya, int xb, int yb, int flags); - void (*SetupForDashedLine)(struct fb_info *info, int fg, int bg, int rop, unsigned int planemask, int length, unsigned char *pattern); - void (*SubsequentDashedTwoPointLine)(struct fb_info *info, int xa, int ya, int xb, int yb, int flags, int phase); - void (*SetupForScreenToScreenCopy)(struct fb_info *info, int xdir, int ydir, int rop, unsigned int planemask, int trans_color); - void (*SubsequentScreenToScreenCopy)(struct fb_info *info, int xa, int ya, int xb, int yb, int w, int h); - void (*ScreenToScreenCopy)(struct fb_info *info, int xa, int ya, int xb, int yb, int w, int h, int rop); - void (*SetupForMono8x8PatternFill)(struct fb_info *info, int patternx, int patterny, int fg, int bg, int rop, unsigned int planemask); - void (*SubsequentMono8x8PatternFillRect)(struct fb_info *info, int patternx, int patterny, int x, int y, int w, int h); - void (*SetupForScanlineCPUToScreenColorExpandFill)(struct fb_info *info, int fg, int bg, int rop, unsigned int planemask); - void (*SubsequentScanlineCPUToScreenColorExpandFill)(struct fb_info *info, int x, int y, int w, int h, int skipleft); - void (*SubsequentScanline)(struct fb_info *info, unsigned long *buf); - void (*SetupForScanlineImageWrite)(struct fb_info *info, int rop, unsigned int planemask, int trans_color, int bpp); - void (*SubsequentScanlineImageWriteRect)(struct fb_info *info, int x, int y, int w, int h, int skipleft); - void (*SetClippingRectangle)(struct fb_info *info, int xa, int ya, int xb, int yb); + void (*SetupForSolidFill)(struct fb_info *info, int32_t color, int32_t rop, uint32_t planemask); + void (*SubsequentSolidFillRect)(struct fb_info *info, int32_t x, int32_t y, int32_t w, int32_t h); + void (*SetupForSolidLine)(struct fb_info *info, int32_t color, int32_t rop, uint32_t planemask); + void (*SubsequentSolidHorVertLine)(struct fb_info *info, int32_t x, int32_t y, int32_t len, int32_t dir); + void (*SubsequentSolidTwoPointLine)(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t flags); + void (*SetupForDashedLine)(struct fb_info *info, int32_t fg, int32_t bg, int32_t rop, uint32_t planemask, int32_t length, uint8_t *pattern); + void (*SubsequentDashedTwoPointLine)(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t flags, int32_t phase); + void (*SetupForScreenToScreenCopy)(struct fb_info *info, int32_t xdir, int32_t ydir, int32_t rop, uint32_t planemask, int32_t trans_color); + void (*SubsequentScreenToScreenCopy)(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t w, int32_t h); + void (*ScreenToScreenCopy)(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t w, int32_t h, int32_t rop); + void (*SetupForMono8x8PatternFill)(struct fb_info *info, int32_t patternx, int32_t patterny, int32_t fg, int32_t bg, int32_t rop, uint32_t planemask); + void (*SubsequentMono8x8PatternFillRect)(struct fb_info *info, int32_t patternx, int32_t patterny, int32_t x, int32_t y, int32_t w, int32_t h); + void (*SetupForScanlineCPUToScreenColorExpandFill)(struct fb_info *info, int32_t fg, int32_t bg, int32_t rop, uint32_t planemask); + void (*SubsequentScanlineCPUToScreenColorExpandFill)(struct fb_info *info, int32_t x, int32_t y, int32_t w, int32_t h, int32_t skipleft); + void (*SubsequentScanline)(struct fb_info *info, uint32_t *buf); + void (*SetupForScanlineImageWrite)(struct fb_info *info, int32_t rop, uint32_t planemask, int32_t trans_color, int32_t bpp); + void (*SubsequentScanlineImageWriteRect)(struct fb_info *info, int32_t x, int32_t y, int32_t w, int32_t h, int32_t skipleft); + void (*SetClippingRectangle)(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb); void (*DisableClipping)(struct fb_info *info); - int (*SetupForCPUToScreenAlphaTexture)(struct fb_info *info, - int op, unsigned short red, unsigned short green, unsigned short blue, unsigned short alpha, unsigned long maskFormat, unsigned long dstFormat, unsigned char *alphaPtr, int alphaPitch, int width, int height, int flags); - int (*SetupForCPUToScreenTexture)(struct fb_info *info, int op, unsigned long srcFormat, unsigned long dstFormat, unsigned char *texPtr, int texPitch, int width, int height, int flags); - void (*SubsequentCPUToScreenTexture)(struct fb_info *info, int dstx, int dsty, int srcx, int srcy, int width, int height); + int32_t (*SetupForCPUToScreenAlphaTexture)(struct fb_info *info, + int32_t op, uint16_t red, uint16_t green, uint16_t blue, uint16_t alpha, uint32_t maskFormat, uint32_t dstFormat, uint8_t *alphaPtr, int32_t alphaPitch, int32_t width, int32_t height, int32_t flags); + int32_t (*SetupForCPUToScreenTexture)(struct fb_info *info, int32_t op, uint32_t srcFormat, uint32_t dstFormat, uint8_t *texPtr, int32_t texPitch, int32_t width, int32_t height, int32_t flags); + void (*SubsequentCPUToScreenTexture)(struct fb_info *info, int32_t dstx, int32_t dsty, int32_t srcx, int32_t srcy, int32_t width, int32_t height); /* Cursor functions */ - void (*SetCursorColors)(struct fb_info *info, int bg, int fg); - void (*SetCursorPosition)(struct fb_info *info, int x, int y); - void (*LoadCursorImage)(struct fb_info *info, unsigned short *mask, unsigned short *data, int zoom); + void (*SetCursorColors)(struct fb_info *info, int32_t bg, int32_t fg); + void (*SetCursorPosition)(struct fb_info *info, int32_t x, int32_t y); + void (*LoadCursorImage)(struct fb_info *info, uint16_t *mask, uint16_t *data, int32_t zoom); void (*HideCursor)(struct fb_info *info); void (*ShowCursor)(struct fb_info *info); long (*CursorInit)(struct fb_info *info); @@ -472,9 +474,9 @@ struct fb_info struct fb_monspecs monspecs; /* Current Monitor specs */ struct fb_videomode *mode; /* current mode */ char *screen_base; /* Virtual address */ - unsigned long screen_size; + uint32_t screen_size; char *ram_base; /* base vram */ - unsigned long ram_size; /* vram size */ + uint32_t ram_size; /* vram size */ char *screen_mono; long update_mono; struct fb_ops *fbops; @@ -482,15 +484,15 @@ struct fb_info }; /* fbmem.c */ -extern int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); -extern int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); -extern int fb_blank(struct fb_info *info, int blank); -extern int fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg); -extern struct fb_info *framebuffer_alloc(unsigned long size); +extern int32_t fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var); +extern int32_t fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var); +extern int32_t fb_blank(struct fb_info *info, int32_t blank); +extern int32_t fb_ioctl(struct fb_info *info, uint32_t cmd, uint32_t arg); +extern struct fb_info *framebuffer_alloc(uint32_t size); extern void framebuffer_release(struct fb_info *info); /* offscreen.c */ -extern long offscreen_free(struct fb_info *info, long addr); +extern long offscreen_free(struct fb_info *info, void *addr); extern long offscreen_alloc(struct fb_info *info, long amount); extern long offscren_reserved(struct fb_info *info); extern void offscreen_init(struct fb_info *info); @@ -511,44 +513,44 @@ extern void offscreen_init(struct fb_info *info); #define FB_MODE_IS_FROM_VAR 32 extern void fb_destroy_modedb(struct fb_videomode *modedb); -extern int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var); -extern void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs); -extern int fb_get_mode(int flags, unsigned long val, struct fb_var_screeninfo *var, struct fb_info *info); -extern int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info); +extern int32_t fb_parse_edid(uint8_t *edid, struct fb_var_screeninfo *var); +extern void fb_edid_to_monspecs(uint8_t *edid, struct fb_monspecs *specs); +extern int32_t fb_get_mode(int32_t flags, uint32_t val, struct fb_var_screeninfo *var, struct fb_info *info); +extern int32_t fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info); /* modedb.c */ #define VESA_MODEDB_SIZE 34 -extern int fb_find_mode(struct fb_var_screeninfo *var, +extern int32_t fb_find_mode(struct fb_var_screeninfo *var, struct fb_info *info, struct mode_option *resolution , - const struct fb_videomode *db, unsigned int dbsize, - const struct fb_videomode *default_mode, unsigned int default_bpp); + const struct fb_videomode *db, uint32_t dbsize, + const struct fb_videomode *default_mode, uint32_t default_bpp); extern void fb_var_to_videomode(struct fb_videomode *mode, struct fb_var_screeninfo *var); extern void fb_videomode_to_var(struct fb_var_screeninfo *var, struct fb_videomode *mode); -extern int fb_mode_is_equal(struct fb_videomode *mode1, struct fb_videomode *mode2); +extern int32_t fb_mode_is_equal(struct fb_videomode *mode1, struct fb_videomode *mode2); struct fb_videomode { - unsigned short refresh; /* optional */ - unsigned short xres; - unsigned short yres; - unsigned long pixclock; - unsigned short left_margin; - unsigned short right_margin; - unsigned short upper_margin; - unsigned short lower_margin; - unsigned short hsync_len; - unsigned short vsync_len; - unsigned short sync; - unsigned short vmode; - unsigned short flag; + uint16_t refresh; /* optional */ + uint16_t xres; + uint16_t yres; + uint32_t pixclock; + uint16_t left_margin; + uint16_t right_margin; + uint16_t upper_margin; + uint16_t lower_margin; + uint16_t hsync_len; + uint16_t vsync_len; + uint16_t sync; + uint16_t vmode; + uint16_t flag; }; extern const struct fb_videomode vesa_modes[]; extern void start_timeout(void); -extern int end_timeout(long msec); +extern int32_t end_timeout(long msec); extern void mdelay(long msec); -extern void install_vbl_timer(void *func, int remove); +extern void install_vbl_timer(void *func, int32_t remove); extern void uninstall_vbl_timer(void *func); extern struct fb_info *info_fvdi; diff --git a/include/radeonfb.h b/include/radeonfb.h index 89c3c7f..f153a33 100644 --- a/include/radeonfb.h +++ b/include/radeonfb.h @@ -535,9 +535,9 @@ extern void radeonfb_pm_exit(struct radeonfb_info *rinfo); /* Monitor probe functions */ extern void radeon_probe_screens(struct radeonfb_info *rinfo, - const char *monitor_layout, int ignore_edid); + const char *monitor_layout, int32_t ignore_edid); extern void radeon_check_modes(struct radeonfb_info *rinfo, struct mode_option *resolution); -extern int radeon_match_mode(struct radeonfb_info *rinfo, +extern int32_t radeon_match_mode(struct radeonfb_info *rinfo, struct fb_var_screeninfo *dest, const struct fb_var_screeninfo *src); @@ -575,7 +575,7 @@ extern void RADEONVIP_reset(struct radeonfb_info *rinfo); /* Accel functions */ -extern void radeon_wait_for_fifo_function(struct radeonfb_info *rinfo, int entries); +extern void radeon_wait_for_fifo_function(struct radeonfb_info *rinfo, int32_t entries); extern void radeon_engine_flush(struct radeonfb_info *rinfo); extern void radeon_engine_reset(struct radeonfb_info *rinfo); extern void radeon_engine_restore(struct radeonfb_info *rinfo); @@ -592,7 +592,7 @@ extern void radeon_wait_for_idle_mmio(struct radeonfb_info *rinfo); rinfo->fifo_slots -= entries; \ } while (0) -static inline int radeonfb_sync(struct fb_info *info) +static inline int32_t radeonfb_sync(struct fb_info *info) { struct radeonfb_info *rinfo = info->par; radeon_engine_idle(); @@ -600,44 +600,44 @@ static inline int radeonfb_sync(struct fb_info *info) } extern void radeon_restore_accel_state_mmio(struct fb_info *info); -extern void radeon_setup_for_solid_fill(struct fb_info *info, int color, int rop, unsigned int planemask); -extern void radeon_subsequent_solid_fill_rect_mmio(struct fb_info *info, int x, int y, int w, int h); -extern void radeon_setup_for_solid_line_mmio(struct fb_info *info, int color, int rop, unsigned int planemask); -extern void radeon_subsequent_solid_hor_vert_line_mmio(struct fb_info *info, int x, int y, int len, int dir); -extern void radeon_subsequent_solid_two_point_line_mmio(struct fb_info *info, int xa, int ya, int xb, - int yb, int flags); -extern void radeon_setup_for_dashed_line_mmio(struct fb_info *info, int fg, int bg, - int rop, unsigned int planemask, int length, unsigned char *pattern); +extern void radeon_setup_for_solid_fill(struct fb_info *info, int32_t color, int32_t rop, uint32_t planemask); +extern void radeon_subsequent_solid_fill_rect_mmio(struct fb_info *info, int32_t x, int32_t y, int32_t w, int32_t h); +extern void radeon_setup_for_solid_line_mmio(struct fb_info *info, int32_t color, int32_t rop, uint32_t planemask); +extern void radeon_subsequent_solid_hor_vert_line_mmio(struct fb_info *info, int32_t x, int32_t y, int32_t len, int32_t dir); +extern void radeon_subsequent_solid_two_point_line_mmio(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, + int32_t yb, int32_t flags); +extern void radeon_setup_for_dashed_line_mmio(struct fb_info *info, int32_t fg, int32_t bg, + int32_t rop, uint32_t planemask, int32_t length, unsigned char *pattern); extern void radeon_subsequent_dashed_two_point_line_mmio(struct fb_info *info, - int xa, int ya, int xb, int yb, int flags, int phase); + int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t flags, int32_t phase); extern void radeon_setup_for_screen_to_screen_copy_mmio(struct fb_info *info, - int xdir, int ydir, int rop, unsigned int planemask, int trans_color); + int32_t xdir, int32_t ydir, int32_t rop, uint32_t planemask, int32_t trans_color); extern void radeon_subsequent_screen_to_screen_copy_mmio(struct fb_info *info, - int xa, int ya, int xb, int yb, int w, int h); + int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t w, int32_t h); extern void radeon_screen_to_screen_copy_mmio(struct fb_info *info, - int xa, int ya, int xb, int yb, int w, int h, int rop); + int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t w, int32_t h, int32_t rop); extern void radeon_setup_for_mono_8x8_pattern_fill_mmio(struct fb_info *info, - int patternx, int patterny, int fg, int bg, int rop, unsigned int planemask); + int32_t patternx, int32_t patterny, int32_t fg, int32_t bg, int32_t rop, uint32_t planemask); extern void radeon_subsequent_mono_8x8_pattern_fill_rect_mmio(struct fb_info *info, - int patternx, int patterny, int x, int y, int w, int h); + int32_t patternx, int32_t patterny, int32_t x, int32_t y, int32_t w, int32_t h); extern void radeon_setup_for_scanline_cpu_to_screen_color_expand_fill_mmio(struct fb_info *info, - int fg, int bg, int rop, unsigned int planemask); + int32_t fg, int32_t bg, int32_t rop, uint32_t planemask); extern void radeon_subsequent_scanline_cpu_to_screen_color_expand_fill_mmio(struct fb_info *info, - int x, int y, int w, int h, int skipleft); -extern void radeon_subsequent_scanline_mmio(struct fb_info *info, unsigned long *buf); + int32_t x, int32_t y, int32_t w, int32_t h, int32_t skipleft); +extern void radeon_subsequent_scanline_mmio(struct fb_info *info, uint32_t *buf); extern void radeon_setup_for_scanline_image_write_mmio(struct fb_info *info, - int rop, unsigned int planemask, int trans_color, int bpp); + int32_t rop, uint32_t planemask, int32_t trans_color, int32_t bpp); extern void radeon_subsequent_scanline_image_write_rect_mmio(struct fb_info *info, - int x, int y, int w, int h, int skipleft); + int32_t x, int32_t y, int32_t w, int32_t h, int32_t skipleft); extern void radeon_set_clipping_rectangle_mmio(struct fb_info *info, - int xa, int ya, int xb, int yb); + int32_t xa, int32_t ya, int32_t xb, int32_t yb); extern void radeon_disable_clipping_mmio(struct fb_info *info); extern int32_t radeon_setup_for_cpu_to_screen_alpha_texture_mmio(struct fb_info *info, - int op, int red, int green, int blue, - int alpha, int maskFormat, int dstFormat, - uint8_t *alphaPtr, int alphaPitch, - int width, int height, int32_t flags); + int32_t op, int32_t red, int32_t green, int32_t blue, + int32_t alpha, int32_t maskFormat, int32_t dstFormat, + uint8_t *alphaPtr, int32_t alphaPitch, + int32_t width, int32_t height, int32_t flags); extern int32_t radeon_setup_for_cpu_to_screen_texture_mmio(struct fb_info *info, int32_t op, uint32_t srcFormat, uint32_t dstFormat, uint8_t *texPtr, int32_t texPitch, @@ -647,9 +647,9 @@ extern void radeon_subsequent_cpu_to_screen_texture_mmio(struct fb_info *info, int32_t srcx, int32_t srcy, int32_t width, int32_t height); /* Cursor functions */ -extern void radeon_set_cursor_colors(struct fb_info *info, int bg, int fg); -extern void radeon_set_cursor_position(struct fb_info *info, int x, int y); -extern void radeon_load_cursor_image(struct fb_info *info, unsigned short *mask, unsigned short *data, int zoom); +extern void radeon_set_cursor_colors(struct fb_info *info, int32_t bg, int32_t fg); +extern void radeon_set_cursor_position(struct fb_info *info, int32_t x, int32_t y); +extern void radeon_load_cursor_image(struct fb_info *info, unsigned short *mask, unsigned short *data, int32_t zoom); extern void radeon_hide_cursor(struct fb_info *info); extern void radeon_show_cursor(struct fb_info *info); extern long radeon_cursor_init(struct fb_info *info); @@ -657,8 +657,8 @@ extern long radeon_cursor_init(struct fb_info *info); /* Other functions */ extern int32_t radeon_screen_blank(struct radeonfb_info *rinfo, int32_t blank, int32_t mode_switch); extern void radeon_write_mode(struct radeonfb_info *rinfo, struct radeon_regs *mode, int32_t reg_only); -int radeonfb_setcolreg(unsigned regno, unsigned red, unsigned green, - unsigned blue, unsigned transp, struct fb_info *info); +int32_t radeonfb_setcolreg(uint32_t regno, uint32_t red, uint32_t green, + uint32_t blue, uint32_t transp, struct fb_info *info); extern int32_t radeonfb_pci_register(int32_t handle, const struct pci_device_id *ent); extern void radeonfb_pci_unregister(void); diff --git a/include/version.h b/include/version.h index d86f899..d41e15a 100644 --- a/include/version.h +++ b/include/version.h @@ -29,7 +29,7 @@ */ #define MAJOR_VERSION 0 -#define MINOR_VERSION 91 +#define MINOR_VERSION 92 #endif /* VERSION_H_ */ diff --git a/radeon/radeon_accel.c b/radeon/radeon_accel.c index 0dc80a2..818d12c 100644 --- a/radeon/radeon_accel.c +++ b/radeon/radeon_accel.c @@ -64,12 +64,15 @@ * */ +// #define DEBUG +#include "debug.h" + #include "fb.h" #include "radeonfb.h" static struct { - int rop; - int pattern; + int32_t rop; + int32_t pattern; } RADEON_ROP[] = { { ROP3_ZERO, ROP3_ZERO }, /* GXclear */ { ROP3_DSa, ROP3_DPa }, /* Gxand */ @@ -103,7 +106,7 @@ static struct { */ void radeon_wait_for_idle_mmio(struct radeonfb_info *rinfo) { - int i = 0; + int32_t i = 0; /* Wait for the engine to go idle */ radeon_wait_for_fifo_function(rinfo, 64); while(1) @@ -136,7 +139,7 @@ void RADEONRestoreAccelStateMMIO(struct fb_info *info) #endif /* Setup for XAA SolidFill */ -void radeon_setup_for_solid_fill(struct fb_info *info, int color, int rop, unsigned int planemask) +void radeon_setup_for_solid_fill(struct fb_info *info, int32_t color, int32_t rop, uint32_t planemask) { struct radeonfb_info *rinfo = info->par; ACCEL_PREAMBLE(); @@ -152,7 +155,7 @@ void radeon_setup_for_solid_fill(struct fb_info *info, int color, int rop, unsig } /* Subsequent XAA SolidFillRect */ -void radeon_subsequent_solid_fill_rect_mmio(struct fb_info *info, int x, int y, int w, int h) +void radeon_subsequent_solid_fill_rect_mmio(struct fb_info *info, int32_t x, int32_t y, int32_t w, int32_t h) { struct radeonfb_info *rinfo = info->par; ACCEL_PREAMBLE(); @@ -169,7 +172,7 @@ void radeon_subsequent_solid_fill_rect_mmio(struct fb_info *info, int x, int y, } /* Setup for XAA solid lines */ -void radeon_setup_for_solid_line_mmio(struct fb_info *info, int color, int rop, unsigned int planemask) +void radeon_setup_for_solid_line_mmio(struct fb_info *info, int32_t color, int32_t rop, uint32_t planemask) { struct radeonfb_info *rinfo = info->par; ACCEL_PREAMBLE(); @@ -189,11 +192,11 @@ void radeon_setup_for_solid_line_mmio(struct fb_info *info, int color, int rop, } /* Subsequent XAA solid horizontal and vertical lines */ -void radeon_subsequent_solid_hor_vert_line_mmio(struct fb_info *info, int x, int y, int len, int dir) +void radeon_subsequent_solid_hor_vert_line_mmio(struct fb_info *info, int32_t x, int32_t y, int32_t len, int32_t dir) { struct radeonfb_info *rinfo = info->par; - int w = 1; - int h = 1; + int32_t w = 1; + int32_t h = 1; ACCEL_PREAMBLE(); if (dir == DEGREES_0) w = len; @@ -215,7 +218,7 @@ void radeon_subsequent_solid_hor_vert_line_mmio(struct fb_info *info, int x, int /* Subsequent XAA solid TwoPointLine line */ void radeon_subsequent_solid_two_point_line_mmio(struct fb_info *info, - int xa, int ya, int xb, int yb, int flags) + int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t flags) { struct radeonfb_info *rinfo = info->par; @@ -239,8 +242,8 @@ void radeon_subsequent_solid_two_point_line_mmio(struct fb_info *info, /* Setup for XAA dashed lines * NOTE: Since we can only accelerate lines with power-of-2 patterns of * length <= 32 */ -void radeon_setup_for_dashed_line_mmio(struct fb_info *info, int fg, int bg, - int rop, unsigned int planemask, int length, unsigned char *pattern) +void radeon_setup_for_dashed_line_mmio(struct fb_info *info, int32_t fg, int32_t bg, + int32_t rop, uint32_t planemask, int32_t length, unsigned char *pattern) { struct radeonfb_info *rinfo = info->par; unsigned long pat = *(unsigned long *) pattern; @@ -287,7 +290,7 @@ void radeon_setup_for_dashed_line_mmio(struct fb_info *info, int fg, int bg, /* Helper function to draw last point for dashed lines */ static void RADEONDashedLastPelMMIO(struct fb_info *info, - int x, int y, int fg) + int32_t x, int32_t y, int32_t fg) { struct radeonfb_info *rinfo = info->par; unsigned long dp_gui_master_cntl = rinfo->dp_gui_master_cntl_clip; @@ -317,7 +320,7 @@ static void RADEONDashedLastPelMMIO(struct fb_info *info, } /* Subsequent XAA dashed line */ -void radeon_subsequent_dashed_two_point_line_mmio(struct fb_info *info, int xa, int ya, int xb, int yb, int flags, int phase) +void radeon_subsequent_dashed_two_point_line_mmio(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t flags, int32_t phase) { struct radeonfb_info *rinfo = info->par; @@ -326,9 +329,9 @@ void radeon_subsequent_dashed_two_point_line_mmio(struct fb_info *info, int xa, /* TODO: Check bounds -- RADEON only has 14 bits */ if (!(flags & OMIT_LAST)) { - int deltax = xa - xb; - int deltay = ya - yb; - int shift; + int32_t deltax = xa - xb; + int32_t deltay = ya - yb; + int32_t shift; if (deltax < 0) deltax = -deltax; if (deltay < 0) @@ -363,7 +366,7 @@ void radeon_subsequent_dashed_two_point_line_mmio(struct fb_info *info, int xa, * It should only draw when source != trans_color, this is the opposite * of that. */ -static void radeon_set_transparency_mmio(struct radeonfb_info *rinfo, int trans_color) +static void radeon_set_transparency_mmio(struct radeonfb_info *rinfo, int32_t trans_color) { if (trans_color != -1) { @@ -378,7 +381,7 @@ static void radeon_set_transparency_mmio(struct radeonfb_info *rinfo, int trans_ /* Setup for XAA screen-to-screen copy */ void radeon_setup_for_screen_to_screen_copy_mmio(struct fb_info *info, - int xdir, int ydir, int rop, unsigned int planemask, int trans_color) + int32_t xdir, int32_t ydir, int32_t rop, uint32_t planemask, int32_t trans_color) { struct radeonfb_info *rinfo = info->par; @@ -405,7 +408,7 @@ void radeon_setup_for_screen_to_screen_copy_mmio(struct fb_info *info, } /* Subsequent XAA screen-to-screen copy */ -void radeon_subsequent_screen_to_screen_copy_mmio(struct fb_info *info, int xa, int ya, int xb, int yb, int w, int h) +void radeon_subsequent_screen_to_screen_copy_mmio(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t w, int32_t h) { struct radeonfb_info *rinfo = info->par; @@ -432,12 +435,12 @@ void radeon_subsequent_screen_to_screen_copy_mmio(struct fb_info *info, int xa, } /* XAA screen-to-screen copy */ -void radeon_screen_to_screen_copy_mmio(struct fb_info *info, int xa, int ya, int xb, int yb, int w, int h, int rop) +void radeon_screen_to_screen_copy_mmio(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb, int32_t w, int32_t h, int32_t rop) { struct radeonfb_info *rinfo = info->par; - int xdir = xa - xb; - int ydir = ya - yb; + int32_t xdir = xa - xb; + int32_t ydir = ya - yb; ACCEL_PREAMBLE(); if (xdir < 0) xa += w - 1, xb += w - 1; @@ -473,8 +476,8 @@ void radeon_screen_to_screen_copy_mmio(struct fb_info *info, int xa, int ya, int * transparency use `bg == -1'. This routine is only used if the XAA * pixmap cache is turned on. */ -void radeon_setup_for_mono_8x8_pattern_fill_mmio(struct fb_info *info, int patternx, int patterny, - int fg, int bg, int rop, unsigned int planemask) +void radeon_setup_for_mono_8x8_pattern_fill_mmio(struct fb_info *info, int32_t patternx, int32_t patterny, + int32_t fg, int32_t bg, int32_t rop, uint32_t planemask) { struct radeonfb_info *rinfo = info->par; unsigned char pattern[8]; @@ -523,8 +526,8 @@ void radeon_setup_for_mono_8x8_pattern_fill_mmio(struct fb_info *info, int patte /* Subsequent XAA 8x8 pattern color expansion. Because they are used in * the setup function, `patternx' and `patterny' are not used here. */ -void radeon_subsequent_mono_8x8_pattern_fill_rect_mmio(struct fb_info *info, int patternx, int patterny, - int x, int y, int w, int h) +void radeon_subsequent_mono_8x8_pattern_fill_rect_mmio(struct fb_info *info, int32_t patternx, int32_t patterny, + int32_t x, int32_t y, int32_t w, int32_t h) { struct radeonfb_info *rinfo = info->par; @@ -548,7 +551,7 @@ void radeon_subsequent_mono_8x8_pattern_fill_rect_mmio(struct fb_info *info, int * `bg == -1'. */ void radeon_setup_for_scanline_cpu_to_screen_color_expand_fill_mmio(struct fb_info *info, - int fg, int bg, int rop, unsigned int planemask) + int32_t fg, int32_t bg, int32_t rop, uint32_t planemask) { struct radeonfb_info *rinfo = info->par; @@ -582,7 +585,7 @@ void radeon_setup_for_scanline_cpu_to_screen_color_expand_fill_mmio(struct fb_in * called once for each rectangle. */ void radeon_subsequent_scanline_cpu_to_screen_color_expand_fill_mmio(struct fb_info *info, - int x, int y, int w, int h, int skipleft) + int32_t x, int32_t y, int32_t w, int32_t h, int32_t skipleft) { struct radeonfb_info *rinfo = info->par; ACCEL_PREAMBLE(); @@ -609,7 +612,7 @@ void radeon_subsequent_scanline_cpu_to_screen_color_expand_fill_mmio(struct fb_i void radeon_subsequent_scanline_mmio(struct fb_info *info, unsigned long *src) { struct radeonfb_info *rinfo = info->par; - int left = rinfo->scanline_words; + int32_t left = rinfo->scanline_words; volatile unsigned long *d; ACCEL_PREAMBLE(); --rinfo->scanline_h; @@ -654,8 +657,8 @@ void radeon_subsequent_scanline_mmio(struct fb_info *info, unsigned long *src) } /* Setup for XAA indirect image write */ -void radeon_setup_for_scanline_image_write_mmio(struct fb_info *info, int rop, unsigned int planemask, - int trans_color, int bpp) +void radeon_setup_for_scanline_image_write_mmio(struct fb_info *info, int32_t rop, uint32_t planemask, + int32_t trans_color, int32_t bpp) { struct radeonfb_info *rinfo = info->par; @@ -686,10 +689,10 @@ void radeon_setup_for_scanline_image_write_mmio(struct fb_info *info, int rop, u } /* Subsequent XAA indirect image write. This is only called once for each rectangle. */ -void radeon_subsequent_scanline_image_write_rect_mmio(struct fb_info *info, int x, int y, int w, int h, int skipleft) +void radeon_subsequent_scanline_image_write_rect_mmio(struct fb_info *info, int32_t x, int32_t y, int32_t w, int32_t h, int32_t skipleft) { struct radeonfb_info *rinfo = info->par; - int shift = 0; /* 32bpp */ + int32_t shift = 0; /* 32bpp */ ACCEL_PREAMBLE(); if (rinfo->bpp == 8) shift = 3; @@ -713,7 +716,7 @@ void radeon_subsequent_scanline_image_write_rect_mmio(struct fb_info *info, int } /* Set up the clipping rectangle */ -void radeon_set_clipping_rectangle_mmio(struct fb_info *info, int xa, int ya, int xb, int yb) +void radeon_set_clipping_rectangle_mmio(struct fb_info *info, int32_t xa, int32_t ya, int32_t xb, int32_t yb) { struct radeonfb_info *rinfo = info->par; @@ -786,11 +789,11 @@ void radeon_disable_clipping_mmio(struct fb_info *info) void RADEONChangeSurfaces(struct fb_info *info) { struct radeonfb_info *rinfo = info->par; - int cpp = rinfo->bpp >> 3; + int32_t cpp = rinfo->bpp >> 3; /* depth/front/back pitch must be identical (and the same as displayWidth) */ - int width_bytes = info->var.xres_virtual * cpp; - int bufferSize = (((((info->var.yres_virtual + 15) & ~15) * width_bytes) + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN); - unsigned int depth_pattern, color_pattern, swap_pattern, surf_info; + int32_t width_bytes = info->var.xres_virtual * cpp; + int32_t bufferSize = (((((info->var.yres_virtual + 15) & ~15) * width_bytes) + RADEON_BUFFER_ALIGN) & ~RADEON_BUFFER_ALIGN); + uint32_t depth_pattern, color_pattern, swap_pattern, surf_info; if (rinfo->big_endian) { switch(rinfo->bpp) @@ -854,9 +857,9 @@ void RADEONChangeSurfaces(struct fb_info *info) * The FIFO has 64 slots. This routines waits until at least `entries' * of these slots are empty. */ -void radeon_wait_for_fifo_function(struct radeonfb_info *rinfo, int entries) +void radeon_wait_for_fifo_function(struct radeonfb_info *rinfo, int32_t entries) { - int i; + int32_t i; while(1) { for(i = 0; i < RADEON_TIMEOUT; i++) @@ -873,7 +876,7 @@ void radeon_wait_for_fifo_function(struct radeonfb_info *rinfo, int entries) /* Flush all dirty data in the Pixel Cache to memory */ void radeon_engine_flush(struct radeonfb_info *rinfo) { - int i; + int32_t i; OUTREGP(RB2D_DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL, ~RB2D_DC_FLUSH_ALL); for(i = 0; i < RADEON_TIMEOUT; i++) { diff --git a/radeon/radeon_base.c b/radeon/radeon_base.c index ae1f13f..3936932 100644 --- a/radeon/radeon_base.c +++ b/radeon/radeon_base.c @@ -333,7 +333,7 @@ void __OUTPLLP(struct radeonfb_info *rinfo, uint32_t index, uint32_t val, uint32 __OUTPLL(rinfo, index, tmp); } -static __inline int round_div(int num, int den) +static __inline int32_t round_div(int32_t num, int32_t den) { return(num + (den / 2)) / den; } @@ -343,7 +343,7 @@ static __inline uint32_t read_vline_crnt(struct radeonfb_info *rinfo) return (INREG(CRTC_VLINE_CRNT_VLINE) >> 16) & 0x3FF; } -static int radeon_map_ROM(struct radeonfb_info *rinfo) +static int32_t radeon_map_ROM(struct radeonfb_info *rinfo) { uint16_t dptr; uint8_t rom_type; @@ -374,7 +374,7 @@ static int radeon_map_ROM(struct radeonfb_info *rinfo) /* Very simple test to make sure it appeared */ if (BIOS_IN16(0) != 0xaa55) { - dbg("Invalid ROM signature 0x%04x instead of 0x%04x found\r\n", BIOS_IN16(0), 0xaa55); + err("Invalid ROM signature 0x%04x instead of 0x%04x found\r\n", BIOS_IN16(0), 0xaa55); goto failed; } @@ -410,7 +410,7 @@ static int radeon_map_ROM(struct radeonfb_info *rinfo) if (BIOS_IN32(dptr) != (('R' << 24) | ('I' << 16) | ('C' << 8) | 'P')) { - dbg("PCI DATA signature in ROM incorrect: %p\r\n", BIOS_IN32(dptr)); + err("PCI DATA signature in ROM incorrect: %p\r\n", BIOS_IN32(dptr)); goto anyway; } @@ -418,16 +418,16 @@ static int radeon_map_ROM(struct radeonfb_info *rinfo) switch(rom_type) { case 0: - dbg("Found Intel x86 BIOS ROM Image\r\n"); + inf("Found Intel x86 BIOS ROM Image\r\n"); break; case 1: - dbg("Found Open Firmware ROM Image\r\n"); + inf("Found Open Firmware ROM Image\r\n"); goto failed; case 2: - dbg("Found HP PA-RISC ROM Image\r\n"); + inf("Found HP PA-RISC ROM Image\r\n"); goto failed; default: - dbg("Found unknown type %d ROM Image\r\n", rom_type); + inf("Found unknown type %d ROM Image\r\n", rom_type); goto failed; } @@ -458,29 +458,29 @@ failed: /* * Read PLL infos from chip registers */ -static int radeon_probe_pll_params(struct radeonfb_info *rinfo) +static int32_t radeon_probe_pll_params(struct radeonfb_info *rinfo) { uint8_t ppll_div_sel; - unsigned Ns; - unsigned Nm; - unsigned M; - unsigned sclk; - unsigned mclk; - unsigned tmp; - unsigned ref_div; - int hTotal; - int vTotal; - int num; - int denom; - int m; - int n; + uint32_t Ns; + uint32_t Nm; + uint32_t M; + uint32_t sclk; + uint32_t mclk; + uint32_t tmp; + uint32_t ref_div; + int32_t hTotal; + int32_t vTotal; + int32_t num; + int32_t denom; + int32_t m; + int32_t n; double hz; double vclk; int32_t xtal; uint32_t start_tv; uint32_t stop_tv; - int timeout = 0; - int ipl; + int32_t timeout = 0; + int32_t ipl; uint32_t vline; /* @@ -548,7 +548,7 @@ static int radeon_probe_pll_params(struct radeonfb_info *rinfo) dbg("vTotal=%d\r\n", vTotal); vclk = (double) hTotal * (double) vTotal * hz; - dbg("vclk=%d\r\n", (int) vclk); + dbg("vclk=%d\r\n", (int32_t) vclk); switch ((INPLL(PPLL_REF_DIV) & 0x30000) >> 16) { @@ -620,7 +620,7 @@ static int radeon_probe_pll_params(struct radeonfb_info *rinfo) xtal = 2950; else { - dbg("xtal calculation failed: %d\r\n", xtal); + err("xtal calculation failed: %d\r\n", xtal); return -1; /* error */ } @@ -726,7 +726,7 @@ static void radeon_get_pllinfo(struct radeonfb_info *rinfo) rinfo->pll.ref_div = rinfo->bios_pll.ref_div; rinfo->pll.ppll_min = rinfo->bios_pll.ppll_min; rinfo->pll.ppll_max = rinfo->bios_pll.ppll_max; - dbg("Retreived PLL infos from BIOS\r\n"); + inf("Retreived PLL infos from BIOS\r\n"); goto found; } @@ -737,14 +737,14 @@ static void radeon_get_pllinfo(struct radeonfb_info *rinfo) */ if (radeon_probe_pll_params(rinfo) == 0) { - dbg("Retreived PLL infos from registers\r\n"); + inf("Retreived PLL infos from registers\r\n"); goto found; } /* * Fall back to already-set defaults... */ - dbg("Used default PLL infos\r\n"); + inf("Used default PLL infos\r\n"); found: /* @@ -763,7 +763,7 @@ found: rinfo->pll.sclk / 100, rinfo->pll.ppll_min, rinfo->pll.ppll_max); } -static int var_to_depth(const struct fb_var_screeninfo *var) +static int32_t var_to_depth(const struct fb_var_screeninfo *var) { if (var->bits_per_pixel != 16) return var->bits_per_pixel; @@ -771,11 +771,11 @@ static int var_to_depth(const struct fb_var_screeninfo *var) return(var->green.length == 5) ? 15 : 16; } -int radeonfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) +int32_t radeonfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) { struct radeonfb_info *rinfo = info->par; struct fb_var_screeninfo v; - int nom, den; + int32_t nom, den; uint32_t pitch; dbg("\r\n"); @@ -783,15 +783,15 @@ int radeonfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) /* clocks over 135 MHz have heat isues with DVI on RV100 */ if ((rinfo->mon1_type == MT_DFP) && (rinfo->family == CHIP_FAMILY_RV100) && ((100000000 / var->pixclock) > 13500)) { - dbg("mode %d x %d x %d", var->xres, var->yres, var->bits_per_pixel); - dbg("rejected, RV100 DVI clock over 135 MHz\r\n"); + err("mode %d x %d x %d", var->xres, var->yres, var->bits_per_pixel); + err("rejected, RV100 DVI clock over 135 MHz\r\n"); return -1; //-EINVAL; } if (radeon_match_mode(rinfo, &v, var)) { - dbg("invalid mode\r\n"); + err("invalid mode\r\n"); return -1; //-EINVAL; } @@ -815,7 +815,7 @@ int radeonfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) break; default: - dbg("invalid bits per pixel\r\n"); + err("invalid bits per pixel\r\n"); return -1; //-EINVAL; } @@ -872,7 +872,7 @@ int radeonfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) break; default: - dbg("radeonfb: mode %d x %d x %d rejected, color depth invalid\r\n ", + err("radeonfb: mode %d x %d x %d rejected, color depth invalid\r\n ", var->xres, var->yres, var->bits_per_pixel); return -1; //-EINVAL; } @@ -891,7 +891,7 @@ int radeonfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) if (((v.xres_virtual * v.yres_virtual * nom) / den) > info->screen_size) { - dbg("mode %d x %d rejected (screen size too small)\r\n", v.xres_virtual, v.yres_virtual); + err("mode %d x %d rejected (screen size too small)\r\n", v.xres_virtual, v.yres_virtual); return -1; //-EINVAL; } @@ -913,14 +913,14 @@ int radeonfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) v.red.msb_right = v.green.msb_right = v.blue.msb_right = 0; v.transp.offset = v.transp.length = v.transp.msb_right = 0; - dbg("using mode %d x %d \r\n", v.xres, v.yres); + inf("using mode %d x %d \r\n", v.xres, v.yres); memcpy(var, &v, sizeof(v)); return 0; } -int radeonfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) +int32_t radeonfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) { struct radeonfb_info *rinfo = info->par; dbg("\r\n"); @@ -954,7 +954,7 @@ int radeonfb_pan_display(struct fb_var_screeninfo *var, struct fb_info *info) short mirror; -int radeonfb_ioctl(unsigned int cmd, unsigned long arg, struct fb_info *info) +int32_t radeonfb_ioctl(uint32_t cmd, uint32_t arg, struct fb_info *info) { struct radeonfb_info *rinfo = info->par; uint32_t tmp; @@ -1020,7 +1020,7 @@ int32_t radeon_screen_blank(struct radeonfb_info *rinfo, int32_t blank, int32_t { uint32_t val; uint32_t tmp_pix_clks; - int unblank = 0; + int32_t unblank = 0; if (rinfo->lock_blank) return 0; @@ -1135,7 +1135,7 @@ int32_t radeon_screen_blank(struct radeonfb_info *rinfo, int32_t blank, int32_t return(blank == FB_BLANK_NORMAL) ? -1 /* -EINVAL */ : 0; } -int radeonfb_blank(int blank, struct fb_info *info) +int32_t radeonfb_blank(int32_t blank, struct fb_info *info) { struct radeonfb_info *rinfo = info->par; @@ -1145,8 +1145,8 @@ int radeonfb_blank(int blank, struct fb_info *info) return radeon_screen_blank(rinfo, blank, 0); } -static int radeon_setcolreg(unsigned regno, unsigned red, unsigned green, - unsigned blue, unsigned transp, struct fb_info *info) +static int32_t radeon_setcolreg(uint32_t regno, uint32_t red, uint32_t green, + uint32_t blue, uint32_t transp, struct fb_info *info) { struct radeonfb_info *rinfo = info->par; uint32_t pindex; @@ -1196,12 +1196,12 @@ static int radeon_setcolreg(unsigned regno, unsigned red, unsigned green, return 0; } -int radeonfb_setcolreg(unsigned regno, unsigned red, unsigned green, - unsigned blue, unsigned transp, struct fb_info *info) +int32_t radeonfb_setcolreg(uint32_t regno, uint32_t red, uint32_t green, + uint32_t blue, uint32_t transp, struct fb_info *info) { struct radeonfb_info *rinfo = info->par; uint32_t dac_cntl2, vclk_cntl = 0; - int rc; + int32_t rc; if (!rinfo->asleep) { @@ -1263,7 +1263,7 @@ static void radeon_save_state(struct radeonfb_info *rinfo, struct radeon_regs *s static void radeon_write_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs *mode) { - int i; + int32_t i; dbg("\r\n"); radeon_wait_for_fifo(rinfo, 20); @@ -1369,8 +1369,8 @@ static void radeon_timer_func(void) struct fb_var_screeninfo var; uint32_t x; uint32_t y; - int chg; - int disp; + int32_t chg; + int32_t disp; static int32_t start_timer; @@ -1398,22 +1398,22 @@ static void radeon_timer_func(void) int32_t foreground = 255; int32_t background = 0; uint8_t *src_buf = (uint8_t *) info->screen_mono; - int skipleft = ((int) src_buf & 3) << 3; - int dst_x = 0; - int w = (int) info->var.xres_virtual; - int h = (int) info->var.yres_virtual; + int32_t skipleft = ((int32_t) src_buf & 3) << 3; + int32_t dst_x = 0; + int32_t w = (int32_t) info->var.xres_virtual; + int32_t h = (int32_t) info->var.yres_virtual; // info->fbops->SetClippingRectangle(info,0,0,w-1,h-1); src_buf = (uint8_t*) ((int32_t) src_buf & ~3); dst_x -= (int32_t) skipleft; w += (int32_t) skipleft; - info->fbops->SetupForScanlineCPUToScreenColorExpandFill(info, (int) foreground, (int) background, 3, 0xffffffff); - info->fbops->SubsequentScanlineCPUToScreenColorExpandFill(info, (int) dst_x, 0, w, h, skipleft); + info->fbops->SetupForScanlineCPUToScreenColorExpandFill(info, (int32_t) foreground, (int32_t) background, 3, 0xffffffff); + info->fbops->SubsequentScanlineCPUToScreenColorExpandFill(info, (int32_t) dst_x, 0, w, h, skipleft); while (--h >= 0) { - info->fbops->SubsequentScanline(info, (unsigned long *) src_buf); + info->fbops->SubsequentScanline(info, (uint32_t *) src_buf); src_buf += (info->var.xres_virtual >> 3); } @@ -1425,7 +1425,7 @@ static void radeon_timer_func(void) if ((info->var.xres_virtual != info->var.xres) || (info->var.yres_virtual != info->var.yres)) { - int ipl; + int32_t ipl; ipl = set_ipl(0); chg = 0; @@ -1478,8 +1478,8 @@ static void radeon_timer_func(void) */ void radeon_write_mode(struct radeonfb_info *rinfo, struct radeon_regs *mode, int32_t regs_only) { - int i; - int primary_mon = PRIMARY_MONITOR(rinfo); + int32_t i; + int32_t primary_mon = PRIMARY_MONITOR(rinfo); dbg("radeonfb: radeon_write_mode\r\n"); @@ -1552,8 +1552,8 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs { static const struct { - int divider; - int bitvalue; + int32_t divider; + int32_t bitvalue; } *post_div, post_divs[] = { @@ -1567,8 +1567,8 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs { 12, 7 }, { 0, 0 }, }; - int fb_div, pll_output_freq = 0; - int uses_dvo = 0; + int32_t fb_div, pll_output_freq = 0; + int32_t uses_dvo = 0; /* Check if the DVO port is enabled and sourced from the primary CRTC. I'm * not sure which model starts having FP2_GEN_CNTL, I assume anything more @@ -1588,7 +1588,7 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs { uint32_t fp2_gen_cntl = INREG(FP2_GEN_CNTL); uint32_t disp_output_cntl; - int source; + int32_t source; /* FP2 path not enabled */ if ((fp2_gen_cntl & FP2_ON) == 0) @@ -1664,21 +1664,21 @@ static void radeon_calc_pll_regs(struct radeonfb_info *rinfo, struct radeon_regs regs->ppll_div_3 = fb_div | (post_div->bitvalue << 16); } -int radeonfb_set_par(struct fb_info *info) +int32_t radeonfb_set_par(struct fb_info *info) { struct radeonfb_info *rinfo = info->par; struct fb_var_screeninfo *mode = &info->var; struct radeon_regs *newmode; - int hTotal; - int vTotal; - int hSyncStart; - int hSyncEnd; - int vSyncStart; - int vSyncEnd; + int32_t hTotal; + int32_t vTotal; + int32_t hSyncStart; + int32_t hSyncEnd; + int32_t vSyncStart; + int32_t vSyncEnd; - // FIXME: int hSyncPol; this is not used anywhere - // FIXME: int vSyncPol; this is not used anywhere - // FIXME: int cSync; this is not used anywhere + // FIXME: int32_t hSyncPol; this is not used anywhere + // FIXME: int32_t vSyncPol; this is not used anywhere + // FIXME: int32_t cSync; this is not used anywhere static uint8_t hsync_adj_tab[] = { 0, 0x12, 9, 9, 6, 5 }; static uint8_t hsync_fudge_fp[] = { 2, 2, 0, 0, 5, 5 }; @@ -1687,19 +1687,19 @@ int radeonfb_set_par(struct fb_info *info) uint32_t v_sync_pol; uint32_t dotClock; uint32_t pixClock; - int i; - int freq; - int format = 0; - int nopllcalc = 0; - int hsync_start; - int hsync_fudge; + int32_t i; + int32_t freq; + int32_t format = 0; + int32_t nopllcalc = 0; + int32_t hsync_start; + int32_t hsync_fudge; - // int bytpp; FIXME: this doesn't seem to be used anywhere - int hsync_wid; - int vsync_wid; - int primary_mon = PRIMARY_MONITOR(rinfo); - int depth = var_to_depth(mode); - int use_rmx = 0; + // int32_t bytpp; FIXME: this doesn't seem to be used anywhere + int32_t hsync_wid; + int32_t vsync_wid; + int32_t primary_mon = PRIMARY_MONITOR(rinfo); + int32_t depth = var_to_depth(mode); + int32_t use_rmx = 0; dbg("depth=%d\r\n", depth); @@ -1898,7 +1898,7 @@ int radeonfb_set_par(struct fb_info *info) newmode->vclk_ecp_cntl = rinfo->init_state.vclk_ecp_cntl; if ((primary_mon == MT_DFP) || (primary_mon == MT_LCD)) { - int hRatio, vRatio; + int32_t hRatio, vRatio; if (mode->xres > rinfo->panel_info.xres) mode->xres = rinfo->panel_info.xres; if (mode->yres > rinfo->panel_info.yres) @@ -2051,7 +2051,7 @@ static struct fb_ops radeonfb_ops = .WaitVbl = radeon_wait_vbl, }; -static int radeon_set_fbinfo(struct radeonfb_info *rinfo) +static int32_t radeon_set_fbinfo(struct radeonfb_info *rinfo) { struct fb_info *info = rinfo->info; @@ -2066,7 +2066,7 @@ static int radeon_set_fbinfo(struct radeonfb_info *rinfo) info->screen_size = MIN_MAPPED_VRAM; dbg("ram_base %p\r\n", info->screen_base); - dbg("ram_size %p\r\n", info->ram_size); + dbg("ram_size 0x%08lx\r\n", info->ram_size); /* Fill fix common fields */ memcpy(info->fix.id, rinfo->name, sizeof(info->fix.id)); @@ -2182,8 +2182,8 @@ static void radeon_identify_vram(struct radeonfb_info *rinfo) case CHIP_FAMILY_R350: inf("chip type: %s\r\n", "R350"); break; case CHIP_FAMILY_RV350: inf("chip type: %s\r\n", "RV350"); break; case CHIP_FAMILY_RV380: inf("chip type: %s\r\n", "RV380"); break; - case CHIP_FAMILY_R420: dbg("chip type: %s\r\n", "R420"); break; - default: inf("chip type: %s\r\n", "UNKNOW"); break; + case CHIP_FAMILY_R420: inf("chip type: %s\r\n", "R420"); break; + default: inf("chip type: %s\r\n", "UNKNOWN"); break; } inf("found %d KB of %d bits wide %s video RAM\r\n", rinfo->video_ram / 1024, rinfo->vram_width, rinfo->vram_ddr ? "DDR" : "SDRAM"); @@ -2302,7 +2302,7 @@ int32_t radeonfb_pci_register(int32_t handle, const struct pci_device_id *ent) } while (!(flags & FLG_LAST)); } else - dbg("get_resource error\r\n"); + err("get_resource error\r\n"); /* map the regions */ dbg("map memory regions\r\n"); @@ -2380,7 +2380,7 @@ int32_t radeonfb_pci_register(int32_t handle, const struct pci_device_id *ent) } else { - inf("%d KB of VRAM mapped to %p\r\n", rinfo->mapped_vram / 1024, rinfo->fb_base); + inf("%d KB of video RAM mapped to %p\r\n", rinfo->mapped_vram / 1024, rinfo->fb_base); } /* Get informations about the board's PLL */ @@ -2403,7 +2403,7 @@ int32_t radeonfb_pci_register(int32_t handle, const struct pci_device_id *ent) /* Probe screen types */ dbg("probe screen types, monitor_layout: %s\r\n", monitor_layout); - radeon_probe_screens(rinfo, monitor_layout, (int) ignore_edid); + radeon_probe_screens(rinfo, monitor_layout, (int32_t) ignore_edid); /* Build mode list, check out panel native model */ dbg("build mode list\r\n"); @@ -2419,7 +2419,7 @@ int32_t radeonfb_pci_register(int32_t handle, const struct pci_device_id *ent) /* Setup Power Management capabilities */ // DPRINT("radeonfb: radeonfb_pci_register: setup power management\r\n"); - // radeonfb_pm_init(rinfo, (int)default_dynclk); + // radeonfb_pm_init(rinfo, (int32_t)default_dynclk); dbg("install VBL timer\r\n"); rinfo->lvds_timer = 0; diff --git a/radeon/radeon_cursor.c b/radeon/radeon_cursor.c index ab9a700..32a93c8 100644 --- a/radeon/radeon_cursor.c +++ b/radeon/radeon_cursor.c @@ -78,7 +78,7 @@ (OUTREG(SURFACE_CNTL, __surface_cntl)); /* Set cursor foreground and background colors */ -void radeon_set_cursor_colors(struct fb_info *info, int bg, int fg) +void radeon_set_cursor_colors(struct fb_info *info, int32_t bg, int32_t fg) { struct radeonfb_info *rinfo = info->par; unsigned long *pixels = (unsigned long *)((unsigned long) rinfo->fb_base + rinfo->cursor_start); @@ -110,7 +110,7 @@ void radeon_set_cursor_colors(struct fb_info *info, int bg, int fg) /* Set cursor position to (x,y) with offset into cursor bitmap at * (xorigin,yorigin) */ -void radeon_set_cursor_position(struct fb_info *info, int x, int y) +void radeon_set_cursor_position(struct fb_info *info, int32_t x, int32_t y) { struct radeonfb_info *rinfo = info->par; struct fb_var_screeninfo *mode = &info->var; @@ -142,7 +142,7 @@ void radeon_set_cursor_position(struct fb_info *info, int x, int y) * Copy cursor image from `image' to video memory. RADEONSetCursorPosition * will be called after this, so we can ignore xorigin and yorigin. */ -void radeon_load_cursor_image(struct fb_info *info, unsigned short *mask, unsigned short *data, int zoom) +void radeon_load_cursor_image(struct fb_info *info, unsigned short *mask, unsigned short *data, int32_t zoom) { struct radeonfb_info *rinfo = info->par; unsigned long *d = (unsigned long *)((unsigned long)rinfo->fb_base+rinfo->cursor_start); diff --git a/radeon/radeon_i2c.c b/radeon/radeon_i2c.c index 3470dfc..55ff7a7 100644 --- a/radeon/radeon_i2c.c +++ b/radeon/radeon_i2c.c @@ -139,7 +139,7 @@ static unsigned char *radeon_do_probe_i2c_edid(struct radeon_i2c_chan *chan) if (i2c_transfer(&chan->adapter, msgs, 2) == 2) return buf; else - err("i2c_transfer() failed\r\n"); + dbg("i2c_transfer() failed\r\n"); driver_mem_free(buf); return NULL; diff --git a/radeon/radeon_monitor.c b/radeon/radeon_monitor.c index 11304cc..c46b7f9 100644 --- a/radeon/radeon_monitor.c +++ b/radeon/radeon_monitor.c @@ -212,7 +212,7 @@ static int radeon_parse_monitor_layout(struct radeonfb_info *rinfo, const char * * Probe display on both primary and secondary card's connector (if any) * by i2c and try to retreive EDID. The algorithm here comes from XFree's * radeon driver */ -void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layout, int ignore_edid) +void radeon_probe_screens(struct radeonfb_info *rinfo, const char *monitor_layout, int32_t ignore_edid) { #ifdef CONFIG_FB_RADEON_I2C @@ -661,7 +661,7 @@ static int radeon_compare_modes(const struct fb_var_screeninfo *var, * outputs a valid mode matching the passed-in one as closely as possible. * We need something better ultimately. */ -int radeon_match_mode(struct radeonfb_info *rinfo, +int32_t radeon_match_mode(struct radeonfb_info *rinfo, struct fb_var_screeninfo *dest, const struct fb_var_screeninfo *src) { diff --git a/video/fbmem.c b/video/fbmem.c index 5cf7639..a99a4fe 100644 --- a/video/fbmem.c +++ b/video/fbmem.c @@ -28,11 +28,11 @@ */ -int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) +int32_t fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) { - int xoffset = var->xoffset; - int yoffset = var->yoffset; - int err; + int32_t xoffset = var->xoffset; + int32_t yoffset = var->yoffset; + int32_t err; dbg("\r\n"); if ((xoffset < 0) || (yoffset < 0) @@ -58,9 +58,9 @@ int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var) return 0; } -int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) +int32_t fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) { - int err; + int32_t err; dbg("var->activate = 0x%x\r\n", var->activate); @@ -91,7 +91,7 @@ int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var) return 0; } -int fb_blank(struct fb_info *info, int blank) +int32_t fb_blank(struct fb_info *info, int32_t blank) { dbg("\r\n"); if (blank > FB_BLANK_POWERDOWN) @@ -99,12 +99,12 @@ int fb_blank(struct fb_info *info, int blank) return(info->fbops->fb_blank(blank, info)); } -int fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) +int32_t fb_ioctl(struct fb_info *info, uint32_t cmd, unsigned long arg) { struct fb_var_screeninfo var; struct fb_fix_screeninfo fix; void *argp = (void *) arg; - int i; + int32_t i; dbg("\r\n"); switch(cmd) @@ -138,10 +138,10 @@ int fb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) return i; case FBIO_ALLOC: - return(offscreen_alloc(info,(long)arg)); + return(offscreen_alloc(info, arg)); case FBIO_FREE: - return(offscreen_free(info,(long)arg)); + return(offscreen_free(info, (void *) arg)); default: return(info->fbops->fb_ioctl(cmd, arg, info)); diff --git a/video/fbmodedb.c b/video/fbmodedb.c index 66c2e1f..841c352 100644 --- a/video/fbmodedb.c +++ b/video/fbmodedb.c @@ -407,10 +407,10 @@ const struct fb_videomode vesa_modes[] = * */ -static int fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info, - const struct fb_videomode *mode, unsigned int bpp) +static int32_t fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info, + const struct fb_videomode *mode, uint32_t bpp) { - int err = 0; + int32_t err = 0; dbg("Trying mode %d x %d - %d @ %d\r\n", mode->xres, mode->yres, bpp, mode->refresh); var->xres = mode->xres; @@ -470,16 +470,16 @@ static int fb_try_mode(struct fb_var_screeninfo *var, struct fb_info *info, * */ -int fb_find_mode(struct fb_var_screeninfo *var, +int32_t fb_find_mode(struct fb_var_screeninfo *var, struct fb_info *info, struct mode_option *resolution , - const struct fb_videomode *db, unsigned int dbsize, + const struct fb_videomode *db, uint32_t dbsize, const struct fb_videomode *default_mode, - unsigned int default_bpp) + uint32_t default_bpp) { - int i,abs; - int res_specified = 0, bpp_specified = 0, refresh_specified = 0; - unsigned int xres = 0, yres = 0, bpp = default_bpp, refresh = 0; - int yres_specified = 0; + int32_t i,abs; + int32_t res_specified = 0, bpp_specified = 0, refresh_specified = 0; + uint32_t xres = 0, yres = 0, bpp = default_bpp, refresh = 0; + int32_t yres_specified = 0; unsigned long best, diff; dbg("fb_find_mode\r\n"); @@ -513,18 +513,18 @@ int fb_find_mode(struct fb_var_screeninfo *var, /* Did the user specify a video mode? */ if (resolution->used) /* fVDI mode */ { - refresh = (unsigned int)resolution->freq; + refresh = (uint32_t)resolution->freq; if (refresh) refresh_specified = 1; - bpp = (unsigned int)resolution->bpp; + bpp = (uint32_t)resolution->bpp; if (resolution->flags & MODE_EMUL_MONO_FLAG) bpp = 8; if (bpp) bpp_specified = 1; - yres = (unsigned int)resolution->height; + yres = (uint32_t)resolution->height; if (yres) yres_specified = 1; - xres = (unsigned int)resolution->width; + xres = (uint32_t)resolution->width; if (xres) res_specified = 1; } diff --git a/video/fbmon.c b/video/fbmon.c index 318e0fb..b7bde43 100644 --- a/video/fbmon.c +++ b/video/fbmon.c @@ -68,7 +68,7 @@ static const unsigned char edid_v1_header[] = { 0x00, 0xff, 0xff, 0xff, static void copy_string(unsigned char *c, unsigned char *s) { - int i; + int32_t i; c = c + 5; for (i = 0; (i < 13 && *c != 0x0A); i++) *(s++) = *(c++); @@ -76,12 +76,12 @@ static void copy_string(unsigned char *c, unsigned char *s) while (i-- && (*--s == 0x20)) *s = 0; } -static int check_edid(unsigned char *edid) +static int32_t check_edid(unsigned char *edid) { unsigned char *block = edid + ID_MANUFACTURER_NAME, manufacturer[4]; unsigned char *b; unsigned long model; - int i, fix = 0, ret = 0; + int32_t i, fix = 0, ret = 0; manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@'; manufacturer[1] = ((block[0] & 0x03) << 3) + ((block[1] & 0xe0) >> 5) + '@'; manufacturer[2] = (block[1] & 0x1f) + '@'; @@ -119,7 +119,7 @@ static int check_edid(unsigned char *edid) return ret; } -static void fix_edid(unsigned char *edid, int fix) +static void fix_edid(unsigned char *edid, int32_t fix) { unsigned char *b; switch(fix) @@ -135,10 +135,10 @@ static void fix_edid(unsigned char *edid, int fix) } } -static int edid_checksum(unsigned char *edid) +static int32_t edid_checksum(unsigned char *edid) { unsigned char i, csum = 0, all_null = 0; - int err = 0, fix = check_edid(edid); + int32_t err = 0, fix = check_edid(edid); if(fix) fix_edid(edid, fix); for(i = 0; i < EDID_LENGTH; i++) @@ -154,9 +154,9 @@ static int edid_checksum(unsigned char *edid) return err; } -static int edid_check_header(unsigned char *edid) +static int32_t edid_check_header(unsigned char *edid) { - int i, err = 1, fix = check_edid(edid); + int32_t i, err = 1, fix = check_edid(edid); if(fix) fix_edid(edid, fix); for(i = 0; i < 8; i++) @@ -202,7 +202,7 @@ static void get_dpms_capabilities(unsigned char flags, struct fb_monspecs *specs static void get_chroma(unsigned char *block, struct fb_monspecs *specs) { - int tmp; + int32_t tmp; /* Chromaticity data */ tmp = ((block[5] & (3 << 6)) >> 6) | (block[0x7] << 2); @@ -254,7 +254,7 @@ static void get_chroma(unsigned char *block, struct fb_monspecs *specs) dbg(" WhiteY: %d\r\n", specs->chroma.whitey / 10); } -static int edid_is_serial_block(unsigned char *block) +static int32_t edid_is_serial_block(unsigned char *block) { if((block[0] == 0x00) && (block[1] == 0x00) && (block[2] == 0x00) && (block[3] == 0xff) && (block[4] == 0x00)) @@ -263,7 +263,7 @@ static int edid_is_serial_block(unsigned char *block) return 0; } -static int edid_is_ascii_block(unsigned char *block) +static int32_t edid_is_ascii_block(unsigned char *block) { if((block[0] == 0x00) && (block[1] == 0x00) && (block[2] == 0x00) && (block[3] == 0xfe) && (block[4] == 0x00)) @@ -272,7 +272,7 @@ static int edid_is_ascii_block(unsigned char *block) return 0; } -static int edid_is_limits_block(unsigned char *block) +static int32_t edid_is_limits_block(unsigned char *block) { if((block[0] == 0x00) && (block[1] == 0x00) && (block[2] == 0x00) && (block[3] == 0xfd) && (block[4] == 0x00)) @@ -281,7 +281,7 @@ static int edid_is_limits_block(unsigned char *block) return 0; } -static int edid_is_monitor_block(unsigned char *block) +static int32_t edid_is_monitor_block(unsigned char *block) { if((block[0] == 0x00) && (block[1] == 0x00) && (block[2] == 0x00) && (block[3] == 0xfc) && (block[4] == 0x00)) @@ -290,7 +290,7 @@ static int edid_is_monitor_block(unsigned char *block) return 0; } -static void calc_mode_timings(int xres, int yres, int refresh, struct fb_videomode *mode) +static void calc_mode_timings(int32_t xres, int32_t yres, int32_t refresh, struct fb_videomode *mode) { struct fb_var_screeninfo var; struct fb_info info; @@ -311,9 +311,9 @@ static void calc_mode_timings(int xres, int yres, int refresh, struct fb_videomo mode->sync = 0; } -static int get_est_timing(unsigned char *block, struct fb_videomode *mode) +static int32_t get_est_timing(unsigned char *block, struct fb_videomode *mode) { - int num = 0; + int32_t num = 0; unsigned char c; c = block[0]; if(c&0x80) @@ -412,9 +412,9 @@ static int get_est_timing(unsigned char *block, struct fb_videomode *mode) return num; } -static int get_std_timing(unsigned char *block, struct fb_videomode *mode) +static int32_t get_std_timing(unsigned char *block, struct fb_videomode *mode) { - int xres, yres = 0, refresh, ratio, i; + int32_t xres, yres = 0, refresh, ratio, i; xres = (block[0] + 31) * 8; if(xres <= 256) return 0; @@ -443,9 +443,9 @@ static int get_std_timing(unsigned char *block, struct fb_videomode *mode) return 1; } -static int get_dst_timing(unsigned char *block, struct fb_videomode *mode) +static int32_t get_dst_timing(unsigned char *block, struct fb_videomode *mode) { - int j, num = 0; + int32_t j, num = 0; for(j = 0; j < 6; j++, block+= STD_TIMING_DESCRIPTION_SIZE) num += get_std_timing(block, &mode[num]); return num; @@ -490,16 +490,16 @@ static void get_detailed_timing(unsigned char *block, struct fb_videomode *mode) static struct fb_videomode tab_db[MAX_DB_ALLOC]; static struct fb_videomode *db_used[MAX_DB_ALLOC]; -static struct fb_videomode *alloc_db(int num) +static struct fb_videomode *alloc_db(int32_t num) { - int i = 0; + int32_t i = 0; if(!num) return(NULL); while(i < MAX_DB_ALLOC) { if((db_used[i] == NULL) && ((i + num) <= MAX_DB_ALLOC)) { - int j; /* search contiguous num db free */ + int32_t j; /* search contiguous num db free */ for(j = 0; j < num; j++) { if(db_used[i+j] != NULL) @@ -519,7 +519,7 @@ static struct fb_videomode *alloc_db(int num) static void free_db(struct fb_videomode *db) { - int i; + int32_t i; for(i = 0; i < MAX_DB_ALLOC; i++) { if(db_used[i] == db) @@ -551,11 +551,11 @@ void fb_destroy_modedb(struct fb_videomode *modedb) * This function builds a mode database using the contents of the EDID * data */ -static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize) +static struct fb_videomode *fb_create_modedb(unsigned char *edid, int32_t *dbsize) { struct fb_videomode *mode, *m; unsigned char *block; - int num = 0, i; + int32_t num = 0, i; // mode = Funcs_malloc(50 * sizeof(struct fb_videomode), 3); mode = alloc_db(50); if(mode == NULL) @@ -578,7 +578,7 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize) block = edid + DETAILED_TIMING_DESCRIPTIONS_START; for(i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) { - int first = 1; + int32_t first = 1; if(block[0] == 0x00 && block[1] == 0x00) { if(block[3] == 0xfa) @@ -611,9 +611,9 @@ static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize) return m; } -static int fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs) +static int32_t fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs) { - int i, retval = 1; + int32_t i, retval = 1; unsigned char *block; block = edid + DETAILED_TIMING_DESCRIPTIONS_START; dbg(" Monitor Operating Limits: "); @@ -636,7 +636,7 @@ static int fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs) if(retval) { struct fb_videomode *modes; - int num_modes, i, hz, hscan, pixclock; + int32_t num_modes, i, hz, hscan, pixclock; modes = fb_create_modedb(edid, &num_modes); if(!modes) { @@ -788,7 +788,7 @@ static void get_monspecs(unsigned char *edid, struct fb_monspecs *specs) } } -static int edid_is_timing_block(unsigned char *block) +static int32_t edid_is_timing_block(unsigned char *block) { if((block[0] != 0x00) || (block[1] != 0x00) || (block[2] != 0x00) || (block[4] != 0x00)) @@ -797,9 +797,9 @@ static int edid_is_timing_block(unsigned char *block) return 0; } -int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var) +int32_t fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var) { - int i; + int32_t i; unsigned char *block; if(edid == NULL || var == NULL) return 1; @@ -838,7 +838,7 @@ int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var) void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs) { unsigned char *block; - int i; + int32_t i; if(edid == NULL) return; if(!(edid_checksum(edid))) @@ -883,7 +883,7 @@ void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs) } //DPRINT(" Display Characteristics:\r\n"); get_monspecs(edid, specs); - specs->modedb = fb_create_modedb(edid, (int *)&specs->modedb_len); + specs->modedb = fb_create_modedb(edid, (int32_t *)&specs->modedb_len); dbg("========================================\r\n"); } @@ -967,7 +967,7 @@ static unsigned long fb_get_hblank_by_hfreq(unsigned long hfreq, unsigned long x } /* Quick integer square root using binomial theorem (from Dr. Dobbs journal) */ -static int int_sqrt(int N) +static int32_t int32_t_sqrt(int32_t N) { unsigned long l2, u, v, u2, n; if(N < 2) @@ -1023,7 +1023,7 @@ static unsigned long fb_get_hblank_by_dclk(unsigned long dclk, unsigned long xre h_period *= h_period; h_period += (M_VAL * xres * 2 * 1000)/(5 * dclk); h_period *=10000; - h_period = int_sqrt(h_period); + h_period = int32_t_sqrt(h_period); h_period -= (100 - C_VAL) * 100; h_period *= 1000; h_period /= 2 * M_VAL; @@ -1119,7 +1119,7 @@ static void fb_timings_dclk(struct __fb_timings *timings) * REQUIRES: * A valid info->monspecs, otherwise 'safe numbers' will be used. */ -int fb_get_mode(int flags, unsigned long val, struct fb_var_screeninfo *var, struct fb_info *info) +int32_t fb_get_mode(int32_t flags, unsigned long val, struct fb_var_screeninfo *var, struct fb_info *info) { struct __fb_timings timings; unsigned long interlace = 1, dscan = 1; @@ -1216,7 +1216,7 @@ int fb_get_mode(int flags, unsigned long val, struct fb_var_screeninfo *var, str * REQUIRES: * A valid info->monspecs. */ -int fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info) +int32_t fb_validate_mode(const struct fb_var_screeninfo *var, struct fb_info *info) { unsigned long hfreq, vfreq, htotal, vtotal, pixclock; unsigned long hfmin, hfmax, vfmin, vfmax, dclkmin, dclkmax; diff --git a/video/offscreen.c b/video/offscreen.c index 1a5fe16..e148bfc 100644 --- a/video/offscreen.c +++ b/video/offscreen.c @@ -199,7 +199,7 @@ static void freeit(MD *m, MPB *mp) } } -long offscreen_free(struct fb_info *info, long addr) +long offscreen_free(struct fb_info *info, void *addr) { MD *p; MD **q; diff --git a/video/video.c b/video/video.c index 164da5a..a166a70 100644 --- a/video/video.c +++ b/video/video.c @@ -344,7 +344,7 @@ struct mode_option resolution = }; int16_t force_measure_pll = 0; -void install_vbl_timer(void *func, int remove) +void install_vbl_timer(void *func, int32_t remove) { dbg("not implemented\r\n"); }