annotate libvo/vo_svga.c @ 11016:8bad8ffae07b

final pre2 changelog
author alex
date Sun, 05 Oct 2003 14:25:04 +0000
parents 6e35326c742f
children 85f4534d1edb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
1 /*
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
2
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
3 Video driver for SVGAlib
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
4 by Zoltan Mark Vician <se7en@sch.bme.hu>
381
bbd079aa1614 Date bugfix :)
se7encode
parents: 377
diff changeset
5 Code started: Mon Apr 1 23:25:47 2001
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
6 Some changes by Matan Ziv-Av <matan@svgalib.org>
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
7 Compleat rewrite by Ivan Kalvachev 19 Mar 2003:
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
8
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
9 Wrangings:
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
10 - 1bpp doesn't work right for me with '-double' and svgalib 1.4.3,
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
11 but works OK with svgalib 1.9.17
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
12 - The HW acceleration is not tested - svgalibs supports few chipsets,
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
13 and i don't have any of them. If it works for you then let me know.
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
14 I will remove this warning after confirm its status.
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
15 - retrace sync works only in doublebuffer mode.
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
16 - the retrace sync may slow down decoding a lot - mplayer is blocked while
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
17 waiting for retrace
9659
iive
parents: 9658
diff changeset
18 - denoise3d fails to find common colorspace, use -vf denoise3d,scale
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
19
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
20 TODO:
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
21 - let choose_best_mode take aspect into account
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
22 - set palette from mpi->palette or mpi->plane[1]
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
23 - make faster OSD black bars clear - need some OSD changes
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
24 - Make nicer CONFIG parsing
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
25 - change video mode logical width to match img->stride[0] - for HW only
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
26 */
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
27
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
28 #include <stdio.h>
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
29 #include <stdlib.h>
7472
c4434bdf6e51 tons of warning fixes, also some 10l bugfixes, including Dominik's PVA bug
arpi
parents: 7124
diff changeset
30 #include <string.h>
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
31
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
32 #include <vga.h>
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
33
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
34 #include <limits.h>
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
35
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
36 #include "config.h"
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
37 #include "video_out.h"
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
38 #include "video_out_internal.h"
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
39 #include "fastmemcpy.h"
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
40 #include "osdep/getch2.h"
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
41 #ifdef CONFIG_VIDIX
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
42 #include "vosub_vidix.h"
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
43 #endif
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
44
616
41d6eec69b60 clean up
pontscho
parents: 612
diff changeset
45 #include "sub.h"
41d6eec69b60 clean up
pontscho
parents: 612
diff changeset
46
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
47 #include "../mp_msg.h"
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
48 //#include "../mp_image.h"
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
49
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
50 #include <assert.h>
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
51
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
52 //silence warnings, probably it have to go in some global header
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
53 #define UNUSED(x) ((void)(x))
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
54
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
55 extern int vo_doublebuffering;
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
56 extern int vo_directrendering;
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
57 extern int vo_dbpp;
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
58 extern int verbose;
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
59
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
60 static uint32_t query_format(uint32_t format);
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
61 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
62 unsigned char *srca, int stride);
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
63 static uint32_t get_image(mp_image_t *mpi);
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
64
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
65 #define MAXPAGES 16
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
66 #define PAGE_EMPTY 0
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
67 #define PAGE_BUSY 1
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
68
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
69 #define CAP_ACCEL_CLEAR 8
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
70 #define CAP_ACCEL_PUTIMAGE 4
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
71 #define CAP_ACCEL_BACKGR 2
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
72 #define CAP_LINEAR 1
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
73
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
74 static uint8_t zerobuf[8192];//used when clear screen with vga_draw
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
75
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
76 static int squarepix;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
77 static int force_vm=0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
78 static int force_native=0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
79 static int sync_flip=0;
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
80 static int blackbar_osd=0;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
81 static int cpage,max_pages,old_page;
447
b3b28a0d9404 All available videomodes support added.
se7encode
parents: 411
diff changeset
82
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
83 static vga_modeinfo * modeinfo;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
84 static int mode_stride; //keep it in case of vga_setlogicalwidth
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
85 static int stride_granularity; //not yet used
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
86 static int mode_bpp;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
87 static int mode_capabilities;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
88
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
89 static int image_width,image_height; // used by OSD
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
90 static int x_pos, y_pos;
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
91
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
92 static struct {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
93 int yoffset;//y position of the page
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
94 int doffset;//display start of the page
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
95 void * vbase;//memory start address of the page
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
96 int locks;
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
97 }PageStore[MAXPAGES];
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
98
8148
5b39e79af5fe removed get_info, using the same sheme as in libmpcodecs instead
alex
parents: 7691
diff changeset
99 static vo_info_t info = {
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
100 "SVGAlib",
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
101 "svga",
10940
b99be2c88faf OSD stride fix and correct email
iive
parents: 10924
diff changeset
102 "Ivan Kalvachev <iive@users.sf.net>",
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
103 ""
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
104 };
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
105
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
106 #ifdef CONFIG_VIDIX
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
107 static char vidix_name[32] = "";
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
108 #endif
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
109
8148
5b39e79af5fe removed get_info, using the same sheme as in libmpcodecs instead
alex
parents: 7691
diff changeset
110 LIBVO_EXTERN(svga)
5b39e79af5fe removed get_info, using the same sheme as in libmpcodecs instead
alex
parents: 7691
diff changeset
111
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
112
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
113 //return number of 1'st free page or -1 if no free one
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
114 static inline int page_find_free(){
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
115 int i;
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
116 for(i=0;i<max_pages;i++)
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
117 if(PageStore[i].locks == PAGE_EMPTY) return i;
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
118 return -1;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
119 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
120
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
121 static uint32_t preinit(const char *arg)
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
122 {
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
123 int i;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
124 char s[64];
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
125
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
126 getch2_disable();
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
127 memset(zerobuf,0,sizeof(zerobuf));
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
128 force_vm=force_native=squarepix=0;
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
129 sync_flip=vo_vsync;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
130 blackbar_osd=0;
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
131
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
132 if(arg)while(*arg) {
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
133 #ifdef CONFIG_VIDIX
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
134 if(memcmp(arg,"vidix",5)==0) {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
135 i=6;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
136 while(arg[i] && arg[i]!=':') i++;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
137 strncpy(vidix_name, arg+6, i-6);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
138 vidix_name[i-5]=0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
139 if(arg[i]==':')i++;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
140 arg+=i;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
141 vidix_preinit(vidix_name, &video_out_svga);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
142 }
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
143 #endif
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
144 if(!strncmp(arg,"sq",2)) {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
145 squarepix=1;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
146 arg+=2;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
147 if( *arg == ':' ) arg++;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
148 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
149
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
150 if(!strncmp(arg,"native",6)) {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
151 force_native=1;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
152 arg+=6;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
153 if( *arg == ':' ) arg++;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
154 }
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
155
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
156 if(!strncmp(arg,"bbosd",5)) {
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
157 blackbar_osd=1;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
158 arg+=5;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
159 if( *arg == ':' ) arg++;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
160 }
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
161
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
162 if(!strncmp(arg,"retrace",7)) {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
163 sync_flip=1;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
164 arg+=7;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
165 if( *arg == ':' ) arg++;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
166 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
167
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
168 if(*arg) {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
169 i=0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
170 while(arg[i] && arg[i]!=':')i++;
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
171 if(i<64){
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
172 strncpy(s, arg, i);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
173 s[i]=0;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
174
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
175 force_vm=vga_getmodenumber(s);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
176 if(force_vm>0) {
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
177 if(verbose) printf("vo_svga: Forcing mode %i\n",force_vm);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
178 }else{
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
179 force_vm = 0;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
180 }
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
181 }
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
182 arg+=i;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
183 if(*arg==':')arg++;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
184 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
185 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
186
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
187 vga_init();
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
188 return 0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
189 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
190
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
191 static void svga_clear_box(int x,int y,int w,int h){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
192 uint8_t * rgbplane;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
193 int i;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
194
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
195 if (mode_capabilities&CAP_ACCEL_CLEAR){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
196 if(verbose > 2)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
197 printf("vo_svga: clearing box %d,%d - %d,%d with HW acceleration\n",
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
198 x,y,w,h);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
199 if(mode_capabilities&CAP_ACCEL_BACKGR)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
200 vga_accel(ACCEL_SYNC);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
201 vga_accel(ACCEL_SETFGCOLOR,0);//black
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
202 vga_accel(ACCEL_FILLBOX,x,y,w,h);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
203 return;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
204 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
205 if (mode_capabilities & CAP_LINEAR){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
206 if(verbose > 2)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
207 printf("vo_svga: clearing box %d,%d - %d,%d with memset\n",x,y,w,h);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
208 rgbplane=PageStore[0].vbase + (y*mode_stride) + (x*modeinfo->bytesperpixel);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
209 for(i=0;i<h;i++){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
210 //i'm afraid that memcpy is better optimized than memset;)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
211 memcpy(rgbplane,zerobuf,w*modeinfo->bytesperpixel);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
212 // memset(rgbplane,0,w*modeinfo->bytesperpixel);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
213 rgbplane+=mode_stride;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
214 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
215 return;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
216 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
217 //native
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
218 if(verbose > 2)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
219 printf("vo_svga: clearing box %d,%d - %d,%d with native draw \n",x,y,w,h);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
220 if(modeinfo->bytesperpixel!=0) w*=modeinfo->bytesperpixel;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
221 for(i=0;i<h;i++){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
222 vga_drawscansegment(zerobuf,x,y+i,w);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
223 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
224 };
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
225
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
226 static uint32_t svga_draw_image(mp_image_t *mpi){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
227 int i,x,y,w,h;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
228 int stride;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
229 uint8_t *rgbplane, *base;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
230 int bytesperline;
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
231 int page;
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
232
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
233 if(mpi->flags & MP_IMGFLAG_DIRECT){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
234 if(verbose > 2)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
235 printf("vo_svga: drawing direct rendered surface\n");
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
236 cpage=(uint32_t)mpi->priv;
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
237 assert((cpage>=0)&&(cpage<max_pages));
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
238 return VO_TRUE; //it's already done
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
239 }
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
240 // if (mpi->flags&MP_IMGFLAGS_DRAWBACK)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
241 // return VO_TRUE;//direct render method 2
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
242
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
243 //find a free page to draw into
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
244 //if there is no one then use the current one
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
245 page = page_find_free();
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
246 if(page>=0) cpage=page;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
247 PageStore[cpage].locks=PAGE_BUSY;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
248
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
249 // these variables are used in loops
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
250 x = mpi->x;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
251 y = mpi->y;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
252 w = mpi->w;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
253 h = mpi->h;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
254 stride = mpi->stride[0];
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
255 rgbplane = mpi->planes[0] + y*stride + (x*mpi->bpp)/8;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
256 x+=x_pos;//center
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
257 y+=y_pos;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
258
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
259 if(mpi->bpp >= 8){//for modes<8 use only native
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
260 if( (mode_capabilities&CAP_ACCEL_PUTIMAGE) && (x==0) && (w==mpi->width) &&
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
261 (stride == mode_stride) ){ //only monolite image can be accelerated
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
262 w=(stride*8)/mpi->bpp;//we transfer pixels in the stride so the source
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
263 //ACCELERATE
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
264 if(verbose>2)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
265 printf("vo_svga: using HW PutImage (x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
266 if(mode_capabilities & CAP_ACCEL_BACKGR)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
267 vga_accel(ACCEL_SYNC);
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
268
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
269 vga_accel(ACCEL_PUTIMAGE,x,y+PageStore[cpage].yoffset,w,h,rgbplane);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
270 return VO_TRUE;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
271 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
272
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
273 if( mode_capabilities&CAP_LINEAR){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
274 //DIRECT
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
275 if(verbose>2)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
276 printf("vo_svga: using Direct memcpy (x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
277 bytesperline=(w*mpi->bpp)/8;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
278 base=PageStore[cpage].vbase + (y*mode_stride) + (x*mpi->bpp)/8;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
279
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
280 for(i=0;i<h;i++){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
281 mem2agpcpy(base,rgbplane,bytesperline);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
282 base+=mode_stride;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
283 rgbplane+=stride;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
284 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
285 return VO_TRUE;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
286 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
287 }//(modebpp>=8
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
288
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
289
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
290 //NATIVE
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
291 {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
292 int length;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
293 length=(w*mpi->bpp)/8;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
294 //one byte per pixel! svgalib innovation
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
295 if(mpi->imgfmt==IMGFMT_RG4B || mpi->imgfmt==IMGFMT_BG4B) length=w;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
296
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
297 if(verbose>2)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
298 printf("vo_svga: using Native vga_draw(x=%d,y=%d,w=%d,h=%d)\n",x,y,w,h);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
299 y+=PageStore[cpage].yoffset;//y position of the page beggining
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
300 for(i=0;i<h;i++){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
301 vga_drawscansegment(rgbplane,x,y+i,length);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
302 rgbplane+=stride;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
303 }
7675
f78dc7d40730 mode check at preinit()
arpi
parents: 7558
diff changeset
304 }
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
305 return VO_TRUE;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
306 }
7675
f78dc7d40730 mode check at preinit()
arpi
parents: 7558
diff changeset
307
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
308 int bpp_from_vminfo(vga_modeinfo *vminfo){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
309 switch(vminfo->colors){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
310 case 2: return 1;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
311 case 16: return 4;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
312 case 256: return 8;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
313 case 32768: return 15;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
314 case 65536: return 16;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
315 case 1<<24: return 8*vminfo->bytesperpixel;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
316 }
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
317 return 0;
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
318 }
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
319
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
320 int find_best_svga_mode(int req_w,int req_h, int req_bpp){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
321 int badness,prev_badness;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
322 int bestmode,lastmode;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
323 int i;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
324 vga_modeinfo *vminfo;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
325 //int best aspect mode // best linear mode // best normal mode (no modeX)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
326
9658
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
327 prev_badness = 0;//take care of special case below
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
328 bestmode = 0; //0 is the TEXT mode
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
329 lastmode = vga_lastmodenumber();
9686
a7aeb72f6fc9 Fix last mode ignored bug
iive
parents: 9659
diff changeset
330 for(i=1;i<=lastmode;i++){
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
331 vminfo = vga_getmodeinfo(i);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
332 if( vminfo == NULL ) continue;
9686
a7aeb72f6fc9 Fix last mode ignored bug
iive
parents: 9659
diff changeset
333 if(verbose>3)
9788
2390fddbe581 force_mode wrong has_mode check, verbose retrace message
iive
parents: 9686
diff changeset
334 printf("vo_svga: testing mode %d (%s)\n",i,vga_getmodename(i));
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
335 if( vga_hasmode(i) == 0 ) continue;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
336 if( req_bpp != bpp_from_vminfo(vminfo) )continue;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
337 if( (vminfo->width < req_w) || (vminfo->height < req_h) ) continue;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
338 badness=(vminfo->width * vminfo->height) - (req_h * req_w);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
339 //put here aspect calculations
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
340 if(squarepix)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
341 if( vminfo->width*3 != vminfo->height*4 ) continue;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
342
9658
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
343 if( bestmode==0 || prev_badness >= badness ){//modeX etc...
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
344 prev_badness=badness;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
345 bestmode=i;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
346 if(verbose>3)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
347 printf("vo_svga: found good mode %d with badness %d\n",i,badness);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
348 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
349 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
350 return bestmode;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
351 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
352
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
353 static uint32_t control(uint32_t request, void *data, ...)
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
354 {
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
355 switch (request) {
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
356 case VOCTRL_QUERY_FORMAT:
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
357 return query_format(*((uint32_t*)data));
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
358 case VOCTRL_DRAW_IMAGE:
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
359 return svga_draw_image( (mp_image_t *)data);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
360 case VOCTRL_GET_IMAGE:
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
361 return get_image(data);
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
362 }
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
363 return VO_NOTIMPL;
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
364 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
365
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
366 //
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
367 // This function is called to init the video driver for specific mode
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
368 //
4433
df8e0f71cc3c new info for tuning
nick
parents: 4352
diff changeset
369 static uint32_t config(uint32_t width, uint32_t height, uint32_t d_width,
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
370 uint32_t d_height, uint32_t flags, char *title,
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
371 uint32_t format) {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
372 int32_t req_w = width;// (d_width > 0 ? d_width : width);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
373 int32_t req_h = height;// (d_height > 0 ? d_height : height);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
374 uint16_t vid_mode = 0;
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
375 int32_t req_bpp;
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
376
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
377 uint32_t accflags;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
378 if(verbose)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
379 printf("vo_svga: config(%i, %i, %i, %i, %08x, %s, %08x)\n", width, height,
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
380 d_width, d_height, flags, title, format);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
381 //Only RGB modes supported
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
382 if (!IMGFMT_IS_RGB(format) && !IMGFMT_IS_BGR(format)) {assert(0);return -1;}
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
383 req_bpp = IMGFMT_BGR_DEPTH(format);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
384
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
385 if( vo_dbpp!=0 && vo_dbpp!=req_bpp) {assert(0);return-1;}
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
386
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
387 if(!force_vm) {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
388 if (verbose) {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
389 printf("vo_svga: Looking for the best resolution...\n");
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
390 printf("vo_svga: req_w: %d, req_h: %d, bpp: %d\n",req_w,req_h,req_bpp);
411
53203545daa7 -bpp added.
se7encode
parents: 407
diff changeset
391 }
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
392 vid_mode=find_best_svga_mode(req_w,req_h,req_bpp);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
393 if(vid_mode==0)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
394 return 1;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
395 modeinfo=vga_getmodeinfo(vid_mode);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
396 }else{//force_vm
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
397 vid_mode=force_vm;
9788
2390fddbe581 force_mode wrong has_mode check, verbose retrace message
iive
parents: 9686
diff changeset
398 if(vga_hasmode(vid_mode) == 0){
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
399 printf("vo_svga: forced vid_mode %d (%s) not available\n",
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
400 vid_mode,vga_getmodename(vid_mode));
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
401 return 1; //error;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
402 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
403 modeinfo=vga_getmodeinfo(vid_mode);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
404 if( (modeinfo->width < req_w) || (modeinfo->height < req_h) ){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
405 printf("vo_svga: forced vid_mode %d (%s) too small\n",
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
406 vid_mode,vga_getmodename(vid_mode));
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
407 return 1;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
408 }
504
a77e23145686 Some debug information (using verbose) added.
se7encode
parents: 502
diff changeset
409 }
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
410 mode_bpp=bpp_from_vminfo(modeinfo);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
411
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
412 printf("vo_svga: vid_mode: %d, %dx%d %dbpp\n",
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
413 vid_mode,modeinfo->width,modeinfo->height,mode_bpp);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
414
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
415 if (vga_setmode(vid_mode) == -1) {
286
b2f3f2ab3787 integrated vo_svga by se7en
arpi_esp
parents: 285
diff changeset
416 printf("vo_svga: vga_setmode(%d) failed.\n",vid_mode);
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
417 uninit();
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
418 return 1; // error
6451
ed906af317da 8bpp support (no dithering yet, use -vop noise for now)
michael
parents: 6052
diff changeset
419 }
ed906af317da 8bpp support (no dithering yet, use -vop noise for now)
michael
parents: 6052
diff changeset
420 /* set 332 palette for 8 bpp */
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
421 if(mode_bpp==8){
6451
ed906af317da 8bpp support (no dithering yet, use -vop noise for now)
michael
parents: 6052
diff changeset
422 int i;
ed906af317da 8bpp support (no dithering yet, use -vop noise for now)
michael
parents: 6052
diff changeset
423 for(i=0; i<256; i++)
6453
7f06ef0d58a6 8bpp bugfixes (brightness, contrast ...)
michael
parents: 6451
diff changeset
424 vga_setpalette(i, ((i>>5)&7)*9, ((i>>2)&7)*9, (i&3)*21);
7f06ef0d58a6 8bpp bugfixes (brightness, contrast ...)
michael
parents: 6451
diff changeset
425 }
7f06ef0d58a6 8bpp bugfixes (brightness, contrast ...)
michael
parents: 6451
diff changeset
426 /* set 121 palette for 4 bpp */
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
427 else if(mode_bpp==4){
6453
7f06ef0d58a6 8bpp bugfixes (brightness, contrast ...)
michael
parents: 6451
diff changeset
428 int i;
7f06ef0d58a6 8bpp bugfixes (brightness, contrast ...)
michael
parents: 6451
diff changeset
429 for(i=0; i<16; i++)
7f06ef0d58a6 8bpp bugfixes (brightness, contrast ...)
michael
parents: 6451
diff changeset
430 vga_setpalette(i, ((i>>3)&1)*63, ((i>>1)&3)*21, (i&1)*63);
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
431 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
432 //if we change the logical width, we should know the granularity
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
433 stride_granularity=8;//according to man vga_logicalwidth
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
434 if(modeinfo->flags & EXT_INFO_AVAILABLE){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
435 stride_granularity=modeinfo->linewidth_unit;
286
b2f3f2ab3787 integrated vo_svga by se7en
arpi_esp
parents: 285
diff changeset
436 }
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
437 //look for hardware acceleration
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
438 mode_capabilities=0;//NATIVE;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
439 if(!force_native){//if we want to use only native drawers
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
440 if(modeinfo->flags & HAVE_EXT_SET){//support for hwaccel interface
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
441 accflags=vga_ext_set(VGA_EXT_AVAILABLE,VGA_AVAIL_ACCEL);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
442 if(accflags & ACCELFLAG_FILLBOX) // clear screen
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
443 mode_capabilities|=CAP_ACCEL_CLEAR;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
444 if(accflags & ACCELFLAG_PUTIMAGE)//support for mem->vid transfer
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
445 mode_capabilities|=CAP_ACCEL_PUTIMAGE;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
446 if((accflags & ACCELFLAG_SETMODE) && (accflags & ACCELFLAG_SYNC)){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
447 vga_accel(ACCEL_SETMODE,BLITS_IN_BACKGROUND);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
448 mode_capabilities|=CAP_ACCEL_BACKGR;//can draw in backgraund
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
449 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
450 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
451 if(modeinfo->flags & IS_LINEAR){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
452 mode_capabilities|=CAP_LINEAR; //don't use bank & vga_draw
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
453 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
454 else{
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
455 if(modeinfo->flags & CAPABLE_LINEAR){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
456 int vid_mem_size;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
457 vid_mem_size = vga_setlinearaddressing();
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
458 if(vid_mem_size != -1){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
459 modeinfo=vga_getmodeinfo(vid_mode);//sometimes they change parameters
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
460 mode_capabilities|=CAP_LINEAR;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
461 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
462 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
463 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
464 }//fi force native
9658
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
465 if(mode_capabilities&CAP_LINEAR){
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
466 printf("vo_svga: video mode is linear and memcpy could be used for image transfer\n");
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
467 }
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
468 if(mode_capabilities&CAP_ACCEL_PUTIMAGE){
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
469 printf("vo_svga: video mode have hardware acceleration and put_image could be used\n");
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
470 printf("vo_svga: If it works for you i would like to know \nvo_svga: (send log with `mplayer test.avi -v -v -v -v &> svga.log`). Thx\n");
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
471 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
472
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
473 //here is the place to handle strides for accel_ modes;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
474 mode_stride=modeinfo->linewidth;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
475 //we may try to set a bigger stride for video mode that will match the mpi->stride,
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
476 //this way we will transfer more data, but HW put_image can do it in backgraund!
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
477
11000
6e35326c742f many small typo and grammar fixes
gabucino
parents: 10940
diff changeset
478 //now let's see how many pages we can use
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
479 max_pages = modeinfo->maxpixels/(modeinfo->height * modeinfo->width);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
480 if(max_pages > MAXPAGES) max_pages = MAXPAGES;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
481 if(!vo_doublebuffering) max_pages=1;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
482 //fill PageStore structs
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
483 {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
484 int i;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
485 uint8_t * GRAPH_MEM;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
486 int dof;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
487 GRAPH_MEM=vga_getgraphmem();
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
488 for(i=0;i<max_pages;i++){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
489 //calculate display offset
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
490 dof = i * modeinfo->height * modeinfo->width;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
491 if(modeinfo->bytesperpixel != 0) dof*=modeinfo->bytesperpixel;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
492 //check video chip limitations
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
493 if( dof != (dof & modeinfo->startaddressrange) ){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
494 max_pages=i;//page 0 will never come here
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
495 break;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
496 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
497 PageStore[i].yoffset = i * modeinfo->height;//starting y offset
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
498 PageStore[i].vbase = GRAPH_MEM + i*modeinfo->height*mode_stride; //memory base address
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
499 PageStore[i].doffset = dof; //display offset
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
500 PageStore[i].locks = PAGE_EMPTY;
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
501 }
483
92f170c8b9ba fix to newest revision after cvs rollback
atmosfear
parents: 448
diff changeset
502 }
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
503 assert(max_pages>0);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
504 printf("vo_svga: video mode have %d page(s)\n",max_pages);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
505 //15bpp
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
506 if(modeinfo->bytesperpixel!=0)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
507 vga_claimvideomemory(max_pages * modeinfo->height * modeinfo->width * modeinfo->bytesperpixel);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
508 else
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
509 vga_claimvideomemory(max_pages * modeinfo->height * modeinfo->width * mode_bpp / 8);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
510
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
511 cpage=old_page=0;
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
512 svga_clear_box(0,0,modeinfo->width,modeinfo->height * max_pages);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
513
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
514 image_height=req_h;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
515 image_width=req_w;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
516 x_pos = (modeinfo->width - req_w) / 2;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
517 y_pos = (modeinfo->height - req_h) / 2;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
518 x_pos &= ~(15); //align x offset position to 16 pixels
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
519 printf("vo_svga: centering image. start at (%d,%d)\n",x_pos,y_pos);
8520
602cf042a013 10l by Matan
alex
parents: 8515
diff changeset
520
602cf042a013 10l by Matan
alex
parents: 8515
diff changeset
521 #ifdef CONFIG_VIDIX
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
522
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
523 if(vidix_name[0]){
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
524 vidix_init(width, height, x_pos, y_pos, modeinfo->width, modeinfo->height,
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
525 format, mode_bpp, modeinfo->width,modeinfo->height);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
526 printf("vo_svga: Using VIDIX. w=%i h=%i mw=%i mh=%i\n",width,height,
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
527 modeinfo->width,modeinfo->height);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
528 vidix_start();
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
529 }
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
530 #endif
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
531
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
532 vga_setdisplaystart(0);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
533 return (0);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
534 }
6456
f0b64210ce97 1bpp support
michael
parents: 6453
diff changeset
535
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
536 static uint32_t draw_slice(uint8_t *image[],int stride[],
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
537 int w, int h, int x, int y) {
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
538 assert(0);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
539 UNUSED(image);UNUSED(stride);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
540 UNUSED(w);UNUSED(h);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
541 UNUSED(x);UNUSED(y);
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
542
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
543 return VO_ERROR;//this is yv12 only -> vf_scale should do all transforms
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
544 }
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
545
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
546 static uint32_t draw_frame(uint8_t *src[]) {
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
547 assert(0);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
548 UNUSED(src);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
549 return VO_ERROR;//this one should not be called
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
550 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
551
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
552 static void draw_osd(void)
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
553 {
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
554 if(verbose > 3)
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
555 printf("vo_svga: draw_osd()\n");
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
556 //only modes with bytesperpixel>0 can draw OSD
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
557 if(modeinfo->bytesperpixel==0) return;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
558 if(!(mode_capabilities&CAP_LINEAR)) return;//force_native will remove OSD
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
559
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
560 if(blackbar_osd){
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
561 //111
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
562 //3 4
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
563 //222
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
564 svga_clear_box(0,0 + PageStore[cpage].yoffset,
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
565 modeinfo->width, y_pos);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
566 svga_clear_box(0, image_height + y_pos + PageStore[cpage].yoffset,
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
567 modeinfo->width, modeinfo->height-(image_height+ y_pos));
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
568 svga_clear_box(0, y_pos + PageStore[cpage].yoffset,
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
569 x_pos, image_height);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
570 svga_clear_box(image_width + x_pos, y_pos + PageStore[cpage].yoffset,
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
571 modeinfo->width-(x_pos+image_width), image_height);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
572 // vo_remove_text(modeinfo->width, modeinfo->height, clear_alpha);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
573 vo_draw_text(modeinfo->width, modeinfo->height, draw_alpha);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
574 }else{
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
575 vo_draw_text(image_width, image_height, draw_alpha);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
576 }
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
577 }
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
578
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
579 static void flip_page(void) {
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
580 PageStore[old_page].locks=PAGE_EMPTY;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
581 PageStore[cpage].locks=PAGE_BUSY;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
582
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
583 if(verbose > 2)
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
584 printf("vo_svga: viewing page %d\n",cpage);
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
585 if(sync_flip && old_page!=cpage){
9788
2390fddbe581 force_mode wrong has_mode check, verbose retrace message
iive
parents: 9686
diff changeset
586 if(verbose > 2) printf("vo_svga:vga_waitretrace\n");
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
587 vga_waitretrace();
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
588 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
589 vga_setdisplaystart(PageStore[cpage].doffset);
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
590
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
591 old_page=cpage;//cpage will be overwriten on next draw_image
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
592 }
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
593
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
594 static void check_events(void) {
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
595 }
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
596
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
597 static void uninit(void) {
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
598
8515
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
599 #ifdef CONFIG_VIDIX
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
600 if(vidix_name[0])vidix_term();
b4e5d87b878b vidix support and better device options handler by Matan Ziv-Av <matan@svgalib.org>
alex
parents: 8148
diff changeset
601 #endif
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
602 vga_setmode(TEXT);
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
603 }
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
604
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
605 /* --------------------------------------------------------------------- */
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
606 static uint32_t query_format(uint32_t format) {
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
607 int32_t req_bpp,flags;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
608 int i,lastmode;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
609 vga_modeinfo * vminfo;
407
0a5b131f1f11 24/15bpp -> 32/16bpp added.
se7encode
parents: 387
diff changeset
610
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
611 if (verbose >3)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
612 printf("vo_svga: query_format=%X \n",format);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
613 //only RGB modes supported
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
614 if( (!IMGFMT_IS_RGB(format)) && (!IMGFMT_IS_BGR(format)) ) return 0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
615
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
616 // Reject different endian
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
617 #ifdef WORDS_BIGENDIAN
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
618 if (IMGFMT_IS_BGR(format)) return 0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
619 #else
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
620 if (IMGFMT_IS_RGB(format)) return 0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
621 #endif
485
dfafa47d751d Tons of code rewrites.
se7encode
parents: 483
diff changeset
622
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
623 //svgalib supports only BG4B! if we want BGR4 we have to emulate it (sw)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
624 if( format==IMGFMT_BGR4 || format==IMGFMT_RGB4) return 0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
625 req_bpp = IMGFMT_RGB_DEPTH(format);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
626 if( vo_dbpp>0 && vo_dbpp!=req_bpp ) return 0; //support -bpp options
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
627 //scan all modes
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
628 lastmode = vga_lastmodenumber();
9686
a7aeb72f6fc9 Fix last mode ignored bug
iive
parents: 9659
diff changeset
629 for(i=1;i<=lastmode;i++){
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
630 vminfo = vga_getmodeinfo(i);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
631 if( vminfo == NULL ) continue;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
632 if( vga_hasmode(i) == 0 ) continue;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
633 if( req_bpp != bpp_from_vminfo(vminfo) ) continue;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
634 if( (force_vm > 0) && (force_vm != i) ) continue;//quick hack
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
635 flags = VFCAP_CSP_SUPPORTED|
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
636 VFCAP_CSP_SUPPORTED_BY_HW|
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
637 VFCAP_ACCEPT_STRIDE|
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
638 0;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
639 if(req_bpp>8) flags|=VFCAP_OSD;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
640 return flags;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
641 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
642 return 0;
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
643 }
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
644
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
645 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src,
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
646 unsigned char *srca, int stride) {
7558
f89b4a70dbda warning fix - hope it don't break it
arpi
parents: 7472
diff changeset
647 char* base;
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
648
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
649 if(verbose>2)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
650 printf("vo_svga: draw_alpha(x0=%d,y0=%d,w=%d,h=%d,src=%p,srca=%p,stride=%d\n",
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
651 x0,y0,w,h,src,srca,stride);
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
652 if(!blackbar_osd) {
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
653 //drawing in the image, so place the stuff there
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
654 x0+=x_pos;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
655 y0+=y_pos;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
656 }
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
657
9658
0e6d7f48309e fix find_best fail if the black area is bigger than image, few more verbose messages, OSD not rendered if native mode
iive
parents: 9621
diff changeset
658 if(verbose>3)
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
659 printf("vo_svga: OSD draw in page %d\n",cpage);
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
660 base=PageStore[cpage].vbase + y0*mode_stride + x0*modeinfo->bytesperpixel;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
661 switch (mode_bpp) {
327
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
662 case 32:
10940
b99be2c88faf OSD stride fix and correct email
iive
parents: 10924
diff changeset
663 vo_draw_alpha_rgb32(w, h, src, srca, stride, base, mode_stride);
327
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
664 break;
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
665 case 24:
10940
b99be2c88faf OSD stride fix and correct email
iive
parents: 10924
diff changeset
666 vo_draw_alpha_rgb24(w, h, src, srca, stride, base, mode_stride);
327
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
667 break;
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
668 case 16:
10940
b99be2c88faf OSD stride fix and correct email
iive
parents: 10924
diff changeset
669 vo_draw_alpha_rgb16(w, h, src, srca, stride, base, mode_stride);
327
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
670 break;
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
671 case 15:
10940
b99be2c88faf OSD stride fix and correct email
iive
parents: 10924
diff changeset
672 vo_draw_alpha_rgb15(w, h, src, srca, stride, base, mode_stride);
327
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
673 break;
e7731f5c76cc OSD renderers for all modes added.
se7encode
parents: 293
diff changeset
674 }
285
5cb4fdc94146 SVGAlib support - vo_svga.c added.
se7encode
parents:
diff changeset
675 }
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2982
diff changeset
676
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
677 static uint32_t get_image(mp_image_t *mpi){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
678 int page;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
679
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
680 if(!IMGFMT_IS_BGR(mpi->imgfmt) && !IMGFMT_IS_RGB(mpi->imgfmt) ){
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
681 assert(0);//should never happen
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
682 return(VO_FALSE);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
683 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
684
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
685 if (
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
686 ( (mpi->type != MP_IMGTYPE_STATIC) && (mpi->type != MP_IMGTYPE_TEMP)) ||
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
687 (mpi->flags & MP_IMGFLAG_PLANAR) ||
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
688 (mpi->flags & MP_IMGFLAG_YUV)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
689 )
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
690 return(VO_FALSE);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
691
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
692 //reading from video memory is horribly slow
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
693 if( !(mpi->flags & MP_IMGFLAG_READABLE) && vo_directrendering &&
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
694 (mode_capabilities & CAP_LINEAR) ){
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
695
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
696 //find free page and reserve it
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
697 page=page_find_free();
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
698 if(page >= 0){
10924
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
699 PageStore[page].locks=PAGE_BUSY;
f531971e44cf blackbar osd support based on patch send by Dimitar Zhekov <jimmy@is-vn.bg>, page code removed/merged, small updates
iive
parents: 9788
diff changeset
700
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
701 mpi->flags |= MP_IMGFLAG_DIRECT;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
702 mpi->stride[0] = mode_stride;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
703 mpi->planes[0] = PageStore[page].vbase +
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
704 y_pos*mode_stride + (x_pos*mpi->bpp)/8;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
705 (int)mpi->priv=page;
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
706 if(verbose>2)
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
707 printf("vo_svga: direct render allocated! page=%d\n",page);
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
708 return(VO_TRUE);
5679
30f196ff3bec This patch replaces vo_svga.c with an improved version that does not use
arpi
parents: 4596
diff changeset
709 }
9621
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
710 }
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
711
3ef467aac4a1 new svga driver - support double buffering, fast_memcpy, direct render and HW acceleration
iive
parents: 9237
diff changeset
712 return(VO_FALSE);
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 2982
diff changeset
713 }