diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-23 16:16:32 +0100 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-03-23 16:16:32 +0100 |
commit | a80c7e0c5a22c303bc24c97f01f61466eb94b03e (patch) | |
tree | a2d713ec50cddada4737be9ffe0f39a2e0e233f1 | |
parent | 3da80cb1474b455f4ed3d27aa72441fd145a9898 (diff) | |
download | fbida-a80c7e0c5a22c303bc24c97f01f61466eb94b03e.tar.gz |
gfx: move over memory pointer
-rw-r--r-- | fb-gui.c | 4 | ||||
-rw-r--r-- | fbtools.c | 6 | ||||
-rw-r--r-- | fbtools.h | 2 | ||||
-rw-r--r-- | gfx.h | 1 |
4 files changed, 7 insertions, 6 deletions
@@ -100,7 +100,7 @@ void shadow_render(gfxstate *gfx) for (i = 0; i < sheight; i++, offset += gfx->stride) { if (0 == sdirty[i]) continue; - shadow_render_line(gfx, i, fb_mem + offset, shadow[i]); + shadow_render_line(gfx, i, gfx->mem + offset, shadow[i]); sdirty[i] = 0; } } @@ -566,5 +566,5 @@ FT_Face font_open(char *fcname) void fb_clear_screen(gfxstate *gfx) { if (visible) - fb_memset(fb_mem,0,gfx->stride * gfx->vdisplay); + fb_memset(gfx->mem, 0, gfx->stride * gfx->vdisplay); } @@ -34,8 +34,6 @@ static const char *strsignal(int signr) /* -------------------------------------------------------------------- */ /* exported stuff */ -unsigned char *fb_mem; -int fb_mem_offset = 0; int fb_switch_state = FB_ACTIVE; /* -------------------------------------------------------------------- */ @@ -43,6 +41,8 @@ int fb_switch_state = FB_ACTIVE; static struct fb_fix_screeninfo fb_fix; static struct fb_var_screeninfo fb_var; +static unsigned char *fb_mem; +static int fb_mem_offset = 0; static int fb,tty; @@ -524,6 +524,8 @@ gfxstate* fb_init(char *device, char *mode, int vt) gfx->hdisplay = fb_var.xres; gfx->vdisplay = fb_var.yres; gfx->stride = fb_fix.line_length; + gfx->mem = fb_mem; + gfx->rlen = fb_var.red.length; gfx->glen = fb_var.green.length; gfx->blen = fb_var.blue.length; @@ -6,8 +6,6 @@ #define FB_ACQ_REQ 3 /* info about videomode - yes I know, quick & dirty... */ -extern unsigned char *fb_mem; -extern int fb_mem_offset; extern int fb_switch_state; /* init + cleanup */ @@ -7,6 +7,7 @@ struct gfxstate { uint32_t hdisplay; uint32_t vdisplay; uint32_t stride; + uint8_t *mem; uint32_t bits_per_pixel; uint32_t rlen, glen, blen, tlen; |