+2006-12-19 Matthew Allum <mallum@openedhand.com>
+
+ * psplash-fb.c:
+ * psplash-fb.h:
+ * psplash.c:
+ Add some as yet tested basic rotation code.
+ * psplash.h:
+ Disable DBG output by default.
+
2006-11-21 Richard Purdie <rpurdie@openedhand.com>
* psplash-write.c:
fb_var.bits_per_pixel);
}
- fb->width = fb_var.xres;
- fb->height = fb_var.yres;
+ fb->real_width = fb->width = fb_var.xres;
+ fb->real_height = fb->height = fb_var.yres;
fb->bpp = fb_var.bits_per_pixel;
fb->stride = fb_fix.line_length;
fb->type = fb_fix.type;
DBG("width: %i, height: %i, bpp: %i, stride: %i",
fb->width, fb->height, fb->bpp, fb->stride);
-
fb->base = (char *) mmap ((caddr_t) NULL,
/*fb_fix.smem_len */
fb->stride * fb->height,
status = 2;
#endif
+ switch (fb->angle)
+ {
+ case 270:
+ case 90:
+ fb->width = fb->real_height;
+ fb->height = fb->real_width;
+ break;
+ case 180:
+ case 0:
+ default:
+ break;
+ }
+
return fb;
fail:
{
int off;
- if (x < 0 || x > fb->width-1 || y < 0 || y > fb->height-1)
- return;
-
- off = (y * fb->stride) + (x * (fb->bpp >> 3));
+ switch (fb->angle)
+ {
+ case 270:
+ off = ((fb->width - x) * fb->stride) + (y * (fb->bpp >> 3));
+ break;
+ case 180:
+ off = ((fb->height - y) * fb->stride) + ((fb->width - x) * (fb->bpp >> 3));
+ break;
+ case 90:
+ off = (x * fb->stride) + (y * (fb->bpp >> 3));
+ break;
+ case 0:
+ default:
+ if (x < 0 || x > fb->width-1 || y < 0 || y > fb->height-1)
+ return;
+ off = (y * fb->stride) + (x * (fb->bpp >> 3));
+ break;
+ }
/* FIXME: handle no RGB orderings */
switch (fb->bpp)
psplash_fb_text_size (fb, &w, &h, &radeon_font, msg);
- DBG("displaying '%s' %ix%i\n", msg, w, h)
+ DBG("displaying '%s' %ix%i\n", msg, w, h);
/* Clear */
BAR_IMG_BYTES_PER_PIXEL,
BAR_IMG_RLE_PIXEL_DATA);
-
psplash_draw_progress (fb, 0);
psplash_draw_msg (fb, MSG);