radeonfb tests (debug output activated)

This commit is contained in:
Markus Fröschle
2016-10-28 05:21:24 +00:00
parent 411b959cff
commit f2ed9ccece
8 changed files with 93 additions and 70 deletions

View File

@@ -19,7 +19,7 @@
#include "driver_mem.h"
#include "bas_string.h"
// #define DEBUG
#define DEBUG
#include "debug.h"
@@ -37,9 +37,18 @@ int fb_pan_display(struct fb_info *info, struct fb_var_screeninfo *var)
dbg("\r\n");
if ((xoffset < 0) || (yoffset < 0)
|| ((xoffset + info->var.xres) > info->var.xres_virtual))
{
dbg("xoffset=%d, yoffset=%d, xres=%d, xres_virtual = %d\r\n",
xoffset, yoffset, info->var.xres, info->var.xres_virtual);
return -1; //-EINVAL;
}
if ((err = info->fbops->fb_pan_display(var, info)))
{
dbg("fb_pan_display returned %d\r\n", err);
return err;
}
info->var.xoffset = var->xoffset;
info->var.yoffset = var->yoffset;
if (var->vmode & FB_VMODE_YWRAP)
@@ -53,11 +62,11 @@ int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
{
int err;
dbg("\r\n");
dbg("var->activate = 0x%x\r\n", var->activate);
if (var->activate & FB_ACTIVATE_INV_MODE)
{
/* return 1 if equal */
dbg("invalid mode\r\n");
return !memcmp((char *) &info->var, (char *) var, sizeof(struct fb_var_screeninfo));
}
@@ -66,6 +75,7 @@ int fb_set_var(struct fb_info *info, struct fb_var_screeninfo *var)
{
if ((err = info->fbops->fb_check_var(var, info)))
{
dbg("fb_check_var failed\r\n");
return err;
}

View File

@@ -16,7 +16,7 @@
#include "bas_printf.h"
#include "bas_string.h"
// #define DEBUG
#define DEBUG
#include "debug.h"
#define name_matches(v, s, l) \

View File

@@ -7,7 +7,7 @@
#include "fb.h"
#include "radeonfb.h"
// #define DEBUG
#define DEBUG
#include "debug.h"
#ifdef _USE_VIDEL_
@@ -274,40 +274,42 @@ void videl_screen_init(void)
static struct radeonfb_info rfb;
static struct fb_var_screeninfo default_fb =
{
.xres = 1280,
.yres = 1024,
.xres_virtual = 2560,
.yres_virtual = 2048,
.xoffset = 0,
.yoffset = 0,
.bits_per_pixel = 8,
.grayscale = 0,
.red = { 0, 0, 0 },
.green = { 0, 0, 0 },
.blue = { 0, 0, 0 },
.transp = { 0, 0, 0 },
.nonstd = 0,
.activate = FB_ACTIVATE_FORCE | FB_ACTIVATE_NOW,
.height = 1024,
.width = 1280,
.accel_flags = 0L,
.pixclock = 70 * 100000000L,
.left_margin = 0,
.right_margin = 0,
.upper_margin = 0,
.lower_margin = 0,
.hsync_len = 0,
.vsync_len = 0,
.sync = FB_SYNC_HOR_HIGH_ACT,
.vmode = FB_VMODE_CONUPDATE,
.rotate = 0,
.refresh = 60,
};
static struct fb_info fb =
{
.par = &rfb,
.var =
{
.xres = 640,
.yres = 480,
.xres_virtual = 640,
.yres_virtual = 480,
.xoffset = 0,
.yoffset = 0,
.bits_per_pixel = 8,
.grayscale = 0,
.red = { 0, 0, 0 },
.green = { 0, 0, 0 },
.blue = { 0, 0, 0 },
.transp = { 0, 0, 0 },
.nonstd = 0,
.activate = FB_ACTIVATE_FORCE | FB_ACTIVATE_NOW,
.height = 480,
.width = 640,
.accel_flags = 0L,
.pixclock = 0,
.left_margin = 0,
.right_margin = 0,
.upper_margin = 0,
.lower_margin = 0,
.hsync_len = 0,
.vsync_len = 0,
.sync = FB_SYNC_HOR_HIGH_ACT,
.vmode = FB_VMODE_CONUPDATE,
.rotate = 0,
.refresh = 60,
},
.fix =
{
"ATI Radeon",
@@ -334,8 +336,8 @@ int16_t ignore_edid;
struct mode_option resolution =
{
.used = 1,
.width = 640,
.height = 480,
.width = 1280,
.height = 1024,
.bpp = 8,
.freq = 60,
.flags = MODE_VESA_FLAG
@@ -397,7 +399,7 @@ void video_init(void)
if (radeonfb_pci_register(handle, board) >= 0)
{
fb_set_var(info_fb, &info_fb->var);
fb_set_var(info_fb, &default_fb);
inf("RADEON video card found and registered\r\n");
}
else