summaryrefslogtreecommitdiffstats
path: root/libvo/vo_svga.c
diff options
context:
space:
mode:
Diffstat (limited to 'libvo/vo_svga.c')
-rw-r--r--libvo/vo_svga.c39
1 files changed, 19 insertions, 20 deletions
diff --git a/libvo/vo_svga.c b/libvo/vo_svga.c
index aa9158b093..ebc51a3a19 100644
--- a/libvo/vo_svga.c
+++ b/libvo/vo_svga.c
@@ -52,7 +52,6 @@ TODO:
//silence warnings, probably it have to go in some global header
#define UNUSED(x) ((void)(x))
-extern int verbose;
static int query_format(uint32_t format);
static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
@@ -172,7 +171,7 @@ char s[64];
force_vm=vga_getmodenumber(s);
if(force_vm>0) {
- if(verbose) printf("vo_svga: Forcing mode %i\n",force_vm);
+ if( mp_msg_test(MSGT_VO,MSGL_V) ) printf("vo_svga: Forcing mode %i\n",force_vm);
}else{
force_vm = 0;
}
@@ -191,7 +190,7 @@ uint8_t * rgbplane;
int i;
if (mode_capabilities&CAP_ACCEL_CLEAR){
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: clearing box %d,%d - %d,%d with HW acceleration\n",
x,y,w,h);
if(mode_capabilities&CAP_ACCEL_BACKGR)
@@ -201,7 +200,7 @@ int i;
return;
}
if (mode_capabilities & CAP_LINEAR){
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: clearing box %d,%d - %d,%d with memset\n",x,y,w,h);
rgbplane=PageStore[0].vbase + (y*mode_stride) + (x*modeinfo->bytesperpixel);
for(i=0;i<h;i++){
@@ -213,7 +212,7 @@ int i;
return;
}
//native
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: clearing box %d,%d - %d,%d with native draw \n",x,y,w,h);
if(modeinfo->bytesperpixel!=0) w*=modeinfo->bytesperpixel;
for(i=0;i<h;i++){
@@ -229,7 +228,7 @@ int bytesperline;
int page;
if(mpi->flags & MP_IMGFLAG_DIRECT){
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: drawing direct rendered surface\n");
cpage=(uint32_t)mpi->priv;
assert((cpage>=0)&&(cpage<max_pages));
@@ -259,7 +258,7 @@ int page;
(stride == mode_stride) ){ //only monolite image can be accelerated
w=(stride*8)/mpi->bpp;//we transfer pixels in the stride so the source
//ACCELERATE
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: using HW PutImage (x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
if(mode_capabilities & CAP_ACCEL_BACKGR)
vga_accel(ACCEL_SYNC);
@@ -270,7 +269,7 @@ int page;
if( mode_capabilities&CAP_LINEAR){
//DIRECT
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: using Direct memcpy (x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
bytesperline=(w*mpi->bpp)/8;
base=PageStore[cpage].vbase + (y*mode_stride) + (x*mpi->bpp)/8;
@@ -292,7 +291,7 @@ int page;
//one byte per pixel! svgalib innovation
if(mpi->imgfmt==IMGFMT_RG4B || mpi->imgfmt==IMGFMT_BG4B) length=w;
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: using Native vga_draw(x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
y+=PageStore[cpage].yoffset;//y position of the page beggining
for(i=0;i<h;i++){
@@ -328,7 +327,7 @@ int find_best_svga_mode(int req_w,int req_h, int req_bpp){
for(i=1;i<=lastmode;i++){
vminfo = vga_getmodeinfo(i);
if( vminfo == NULL ) continue;
- if(verbose>3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: testing mode %d (%s)\n",i,vga_getmodename(i));
if( vga_hasmode(i) == 0 ) continue;
if( req_bpp != bpp_from_vminfo(vminfo) )continue;
@@ -341,7 +340,7 @@ int find_best_svga_mode(int req_w,int req_h, int req_bpp){
if( bestmode==0 || prev_badness >= badness ){//modeX etc...
prev_badness=badness;
bestmode=i;
- if(verbose>3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: found good mode %d with badness %d\n",i,badness);
}
}
@@ -404,7 +403,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
int32_t req_bpp;
uint32_t accflags;
- if(verbose)
+ if( mp_msg_test(MSGT_VO,MSGL_V) )
printf("vo_svga: config(%i, %i, %i, %i, %08x, %s, %08x)\n", width, height,
d_width, d_height, flags, title, format);
//Only RGB modes supported
@@ -414,7 +413,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width,
if( vo_dbpp!=0 && vo_dbpp!=req_bpp) {assert(0);return-1;}
if(!force_vm) {
- if (verbose) {
+ if ( mp_msg_test(MSGT_VO,MSGL_V) ) {
printf("vo_svga: Looking for the best resolution...\n");
printf("vo_svga: req_w: %d, req_h: %d, bpp: %d\n",req_w,req_h,req_bpp);
}
@@ -593,7 +592,7 @@ UNUSED(src);
static void draw_osd(void)
{
- if(verbose > 3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: draw_osd()\n");
//only modes with bytesperpixel>0 can draw OSD
if(modeinfo->bytesperpixel==0) return;
@@ -622,10 +621,10 @@ static void flip_page(void) {
PageStore[old_page].locks=PAGE_EMPTY;
PageStore[cpage].locks=PAGE_BUSY;
- if(verbose > 2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: viewing page %d\n",cpage);
if(sync_flip && old_page!=cpage){
- if(verbose > 2) printf("vo_svga:vga_waitretrace\n");
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) ) printf("vo_svga:vga_waitretrace\n");
vga_waitretrace();
}
vga_setdisplaystart(PageStore[cpage].doffset);
@@ -650,7 +649,7 @@ int32_t req_bpp,flags;
int i,lastmode;
vga_modeinfo * vminfo;
- if (verbose >3)
+ if ( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: query_format=%X \n",format);
//only RGB modes supported
if( (!IMGFMT_IS_RGB(format)) && (!IMGFMT_IS_BGR(format)) ) return 0;
@@ -688,7 +687,7 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
unsigned char *srca, int stride) {
char* base;
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: draw_alpha(x0=%d,y0=%d,w=%d,h=%d,src=%p,srca=%p,stride=%d\n",
x0,y0,w,h,src,srca,stride);
if(!blackbar_osd) {
@@ -697,7 +696,7 @@ static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
y0+=y_pos;
}
- if(verbose>3)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG4) )
printf("vo_svga: OSD draw in page %d\n",cpage);
base=PageStore[cpage].vbase + y0*mode_stride + x0*modeinfo->bytesperpixel;
switch (mode_bpp) {
@@ -745,7 +744,7 @@ int page;
mpi->planes[0] = PageStore[page].vbase +
y_pos*mode_stride + (x_pos*mpi->bpp)/8;
mpi->priv=(void *)page;
- if(verbose>2)
+ if( mp_msg_test(MSGT_VO,MSGL_DBG3) )
printf("vo_svga: direct render allocated! page=%d\n",page);
return(VO_TRUE);
}