annotate libvo/vo_vesa.c @ 4428:3e1378354c2e

Compilation fixing
author nick
date Thu, 31 Jan 2002 08:39:21 +0000
parents 7ef67ffa9274
children df8e0f71cc3c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2519
6f3fa9bc3b27 yv12 to yv12 scaler
michael
parents: 2506
diff changeset
1 /*
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
2 * video_out_vesa.c
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
3 *
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
4 * Copyright (C) Nick Kurshev <nickols_k@mail.ru> - Oct 2001
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
5 *
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
6 * You can redistribute this file under terms and conditions
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
7 * of GNU General Public licence v2.
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
8 * This file is partly based on vbetest.c from lrmi distributive.
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
9 */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
10
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
11 /*
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
12 TODO:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
13 - hw YUV support (need volunteers who have corresponding hardware)
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
14 - triple buffering (if it will really speedup playback).
2692
b8e628b7a029 Minor notes
nick
parents: 2689
diff changeset
15 note: triple buffering requires VBE 3.0 - need volunteers.
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
16 - refresh rate support (need additional info from mplayer)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
17 */
2775
8e3875816f6d added missing #include <malloc.h>
pl
parents: 2774
diff changeset
18 #include "config.h"
8e3875816f6d added missing #include <malloc.h>
pl
parents: 2774
diff changeset
19
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
20 #include <stdio.h>
2775
8e3875816f6d added missing #include <malloc.h>
pl
parents: 2774
diff changeset
21 #ifdef HAVE_MALLOC_H
8e3875816f6d added missing #include <malloc.h>
pl
parents: 2774
diff changeset
22 #include <malloc.h>
8e3875816f6d added missing #include <malloc.h>
pl
parents: 2774
diff changeset
23 #endif
2446
6fb598bd7ede Suppressing warnings
nick
parents: 2410
diff changeset
24 #include <stdlib.h>
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
25 #include <string.h>
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
26 #include <stddef.h>
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
27 #include <limits.h>
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
28
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
29 #include "video_out.h"
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
30 #include "video_out_internal.h"
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
31
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
32 #include "fastmemcpy.h"
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
33 #include "sub.h"
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
34 #include "linux/vbelib.h"
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
35 #include "bswap.h"
2689
6a5b6b16d85c Use standard aspect code
nick
parents: 2688
diff changeset
36 #include "aspect.h"
3202
e9b18714e3dc Minor optimization
nick
parents: 2971
diff changeset
37 #include "vesa_lvo.h"
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
38 #ifdef CONFIG_VIDIX
4030
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
39 #include "vosub_vidix.h"
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
40 #endif
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
41
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
42 #include "../postproc/swscale.h"
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
43 #include "../postproc/rgb2rgb.h"
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
44
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
45 LIBVO_EXTERN(vesa)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
46 extern int verbose;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
47
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
48 #define MAX_BUFFERS 3
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
49
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
50 #ifndef max
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
51 #define max(a,b) ((a)>(b)?(a):(b))
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
52 #endif
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
53 #ifndef min
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
54 #define min(a,b) ((a)<(b)?(a):(b))
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
55 #endif
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
56
2688
e9f6634c6374 Code cleanup
nick
parents: 2686
diff changeset
57 #define UNUSED(x) ((void)(x)) /**< Removes warning about unused arguments */
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
58
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
59 static vo_info_t vo_info =
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
60 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
61 "VESA VBE 2.0 video output",
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
62 "vesa",
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
63 "Nick Kurshev <nickols_k@mail.ru>",
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
64 "Requires ROOT privileges"
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
65 };
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
66
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
67 /* driver data */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
68
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
69 struct win_frame
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
70 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
71 uint8_t *ptr; /* pointer to window's frame memory */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
72 uint32_t low; /* lowest boundary of frame */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
73 uint32_t high; /* highest boundary of frame */
2610
65cb69a90a9f vo_vesa: DGA support
nick
parents: 2554
diff changeset
74 char idx; /* indicates index of relocatable frame (A=0 or B=1)
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
75 special case for DGA: idx=-1
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
76 idx=-2 indicates invalid frame, exists only in init() */
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
77 };
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
78
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
79 static void (*cpy_blk_fnc)(unsigned long,uint8_t *,unsigned long) = NULL;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
80
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
81 static int vesa_zoom=0; /* software scaling */
3209
0b172eb639f1 swscaler cleanup
michael
parents: 3202
diff changeset
82 static unsigned int scale_srcW=0;
0b172eb639f1 swscaler cleanup
michael
parents: 3202
diff changeset
83 static unsigned int scale_srcH=0;
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
84
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
85 static uint32_t image_bpp,image_width, image_height; /* source image dimension */
2329
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
86 static int32_t x_offset,y_offset; /* to center image on screen */
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
87 static unsigned init_mode; /* mode before run of mplayer */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
88 static void *init_state = NULL; /* state before run of mplayer */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
89 static struct win_frame win; /* real-mode window to video memory */
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
90 static uint8_t *dga_buffer = NULL; /* for yuv2rgb and sw_scaling */
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
91 static unsigned video_mode; /* selected video mode for playback */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
92 static struct VesaModeInfoBlock video_mode_info;
2331
9e8585a7182e Final fix of libmpeg2 zooming: flipping page support
nick
parents: 2329
diff changeset
93 static int flip_trigger = 0;
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
94 static void (*draw_alpha_fnc)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride);
2676
d3393d940aa5 Fixed rgb2rgb in DGA mode
nick
parents: 2649
diff changeset
95 static void (*rgb2rgb_fnc)(const uint8_t *src,uint8_t *dst,uint32_t src_size);
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
96
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
97 /* multibuffering */
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
98 uint8_t* video_base; /* should be never changed */
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
99 uint32_t multi_buff[MAX_BUFFERS]; /* contains offsets of buffers */
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
100 uint8_t multi_size=0; /* total number of buffers */
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
101 uint8_t multi_idx=0; /* active buffer */
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
102
2869
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
103 /* Linux Video Overlay */
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
104 static const char *lvo_name = NULL;
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
105 #ifdef CONFIG_VIDIX
4030
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
106 static const char *vidix_name = NULL;
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
107 #endif
2869
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
108
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
109 #define HAS_DGA() (win.idx == -1)
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
110 #define MOVIE_MODE (MODE_ATTR_COLOR | MODE_ATTR_GRAPHICS)
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
111 #define FRAME_MODE (MODE_WIN_RELOCATABLE | MODE_WIN_WRITEABLE)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
112
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
113 static char * vbeErrToStr(int err)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
114 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
115 char *retval;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
116 static char sbuff[80];
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
117 if((err & VBE_VESA_ERROR_MASK) == VBE_VESA_ERROR_MASK)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
118 {
2255
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
119 sprintf(sbuff,"VESA failed = 0x4f%x",(err & VBE_VESA_ERRCODE_MASK)>>8);
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
120 retval = sbuff;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
121 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
122 else
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
123 switch(err)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
124 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
125 case VBE_OK: retval = "No error"; break;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
126 case VBE_VM86_FAIL: retval = "vm86() syscall failed"; break;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
127 case VBE_OUT_OF_DOS_MEM: retval = "Out of DOS memory"; break;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
128 case VBE_OUT_OF_MEM: retval = "Out of memory"; break;
2360
aa4d96380b7f Broken BIOS test
nick
parents: 2337
diff changeset
129 case VBE_BROKEN_BIOS: retval = "Broken BIOS or DOS TSR"; break;
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
130 default: sprintf(sbuff,"Unknown or internal error: %i",err); retval=sbuff; break;
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
131 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
132 return retval;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
133 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
134
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
135 #define PRINT_VBE_ERR(name,err) { printf("vo_vesa: %s returns: %s\n",name,vbeErrToStr(err)); fflush(stdout); }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
136
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
137 static void vesa_term( void )
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
138 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
139 int err;
2869
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
140 if(lvo_name) vlvo_term();
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
141 #ifdef CONFIG_VIDIX
4030
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
142 else if(vidix_name) vidix_term();
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
143 #endif
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
144 if((err=vbeRestoreState(init_state)) != VBE_OK) PRINT_VBE_ERR("vbeRestoreState",err);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
145 if((err=vbeSetMode(init_mode,NULL)) != VBE_OK) PRINT_VBE_ERR("vbeSetMode",err);
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
146 if(HAS_DGA()) vbeUnmapVideoBuffer((unsigned long)win.ptr,win.high);
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
147 if(dga_buffer && !HAS_DGA()) free(dga_buffer);
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
148 vbeDestroy();
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
149 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
150
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
151 #define VALID_WIN_FRAME(offset) (offset >= win.low && offset < win.high)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
152 #define VIDEO_PTR(offset) (win.ptr + offset - win.low)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
153
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
154 static inline void __vbeSwitchBank(unsigned long offset)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
155 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
156 unsigned long gran;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
157 unsigned new_offset;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
158 int err;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
159 gran = video_mode_info.WinGranularity*1024;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
160 new_offset = offset / gran;
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
161 if(HAS_DGA()) { err = -1; goto show_err; }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
162 if((err=vbeSetWindow(win.idx,new_offset)) != VBE_OK)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
163 {
2610
65cb69a90a9f vo_vesa: DGA support
nick
parents: 2554
diff changeset
164 show_err:
2686
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
165 vesa_term();
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
166 PRINT_VBE_ERR("vbeSetWindow",err);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
167 printf("vo_vesa: Fatal error occured! Can't continue\n");
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
168 exit(-1);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
169 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
170 win.low = new_offset * gran;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
171 win.high = win.low + video_mode_info.WinSize*1024;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
172 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
173
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
174 static void __vbeSetPixel(int x, int y, int r, int g, int b)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
175 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
176 int x_res = video_mode_info.XResolution;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
177 int y_res = video_mode_info.YResolution;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
178 int shift_r = video_mode_info.RedFieldPosition;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
179 int shift_g = video_mode_info.GreenFieldPosition;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
180 int shift_b = video_mode_info.BlueFieldPosition;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
181 int pixel_size = (video_mode_info.BitsPerPixel+7)/8;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
182 int bpl = video_mode_info.BytesPerScanLine;
2676
d3393d940aa5 Fixed rgb2rgb in DGA mode
nick
parents: 2649
diff changeset
183 int color;
d3393d940aa5 Fixed rgb2rgb in DGA mode
nick
parents: 2649
diff changeset
184 unsigned offset;
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
185
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
186 if (x < 0 || x >= x_res || y < 0 || y >= y_res) return;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
187 r >>= 8 - video_mode_info.RedMaskSize;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
188 g >>= 8 - video_mode_info.GreenMaskSize;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
189 b >>= 8 - video_mode_info.BlueMaskSize;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
190 color = (r << shift_r) | (g << shift_g) | (b << shift_b);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
191 offset = y * bpl + (x * pixel_size);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
192 if(!VALID_WIN_FRAME(offset)) __vbeSwitchBank(offset);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
193 memcpy(VIDEO_PTR(offset), &color, pixel_size);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
194 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
195
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
196 /*
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
197 Copies part of frame to video memory. Data should be in the same format
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
198 as video memory.
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
199 */
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
200 static void __vbeCopyBlockFast(unsigned long offset,uint8_t *image,unsigned long size)
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
201 {
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
202 memcpy(&win.ptr[offset],image,size);
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
203 }
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
204
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
205 static void __vbeCopyBlock(unsigned long offset,uint8_t *image,unsigned long size)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
206 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
207 unsigned long delta,src_idx = 0;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
208 while(size)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
209 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
210 if(!VALID_WIN_FRAME(offset)) __vbeSwitchBank(offset);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
211 delta = min(size,win.high - offset);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
212 memcpy(VIDEO_PTR(offset),&image[src_idx],delta);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
213 src_idx += delta;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
214 offset += delta;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
215 size -= delta;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
216 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
217 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
218
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
219 /*
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
220 Copies frame to video memory. Data should be in the same format as video
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
221 memory.
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
222 */
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
223
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
224 #define PIXEL_SIZE() ((video_mode_info.BitsPerPixel+7)/8)
2676
d3393d940aa5 Fixed rgb2rgb in DGA mode
nick
parents: 2649
diff changeset
225 #define SCREEN_LINE_SIZE(pixel_size) (video_mode_info.XResolution*(pixel_size) )
d3393d940aa5 Fixed rgb2rgb in DGA mode
nick
parents: 2649
diff changeset
226 #define IMAGE_LINE_SIZE(pixel_size) (image_width*(pixel_size))
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
227
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
228 static void __vbeCopyData(uint8_t *image)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
229 {
2308
ce35271bdb10 Best fix of slice drawing with libmpeg2
nick
parents: 2307
diff changeset
230 unsigned long i,j,image_offset,offset;
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
231 unsigned pixel_size,image_line_size,screen_line_size,x_shift;
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
232 pixel_size = PIXEL_SIZE();
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
233 screen_line_size = SCREEN_LINE_SIZE(pixel_size);
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
234 image_line_size = IMAGE_LINE_SIZE(pixel_size);
2306
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
235 if(image_width == video_mode_info.XResolution)
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
236 {
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
237 /* Special case for zooming */
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
238 (*cpy_blk_fnc)(y_offset*screen_line_size,image,image_line_size*image_height);
2306
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
239 }
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
240 else
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
241 {
2306
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
242 x_shift = x_offset*pixel_size;
2308
ce35271bdb10 Best fix of slice drawing with libmpeg2
nick
parents: 2307
diff changeset
243 for(j=0,i=y_offset;j<image_height;i++,j++)
2306
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
244 {
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
245 offset = i*screen_line_size+x_shift;
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
246 image_offset = j*image_line_size;
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
247 (*cpy_blk_fnc)(offset,&image[image_offset],image_line_size);
2306
42cf51474f45 Qualitative speedup for P3 & K7 cpus
nick
parents: 2305
diff changeset
248 }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
249 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
250 }
2328
00f64d5858b8 Bad fix of libmpeg2 zooming
nick
parents: 2308
diff changeset
251
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
252 /* is called for yuv only */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
253 static uint32_t draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
254 {
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
255 if(verbose > 2)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
256 printf("vo_vesa: draw_slice was called: w=%u h=%u x=%u y=%u\n",w,h,x,y);
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
257 if(vesa_zoom)
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
258 {
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
259 uint8_t *dst[3]= {dga_buffer, NULL, NULL};
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
260 int dst_stride;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
261 if(HAS_DGA()) dst[0] += y_offset*SCREEN_LINE_SIZE(PIXEL_SIZE())+x_offset*PIXEL_SIZE();
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
262 dst_stride = PIXEL_SIZE()*(HAS_DGA()?video_mode_info.XResolution:image_width);
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
263 SwScale_YV12slice(image,stride,y,h,dst,dst_stride,
3209
0b172eb639f1 swscaler cleanup
michael
parents: 3202
diff changeset
264 video_mode_info.BitsPerPixel,
0b172eb639f1 swscaler cleanup
michael
parents: 3202
diff changeset
265 scale_srcW, scale_srcH, image_width, image_height);
0b172eb639f1 swscaler cleanup
michael
parents: 3202
diff changeset
266
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
267 }
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
268 else
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
269 {
2331
9e8585a7182e Final fix of libmpeg2 zooming: flipping page support
nick
parents: 2329
diff changeset
270 uint8_t *yuv_slice;
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
271 int rgb_stride;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
272 yuv_slice=dga_buffer;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
273 if(HAS_DGA()) yuv_slice += y_offset*SCREEN_LINE_SIZE(PIXEL_SIZE())+x_offset*PIXEL_SIZE();
2636
27e829d53e8e Fixed bug of -vc libmpeg2 on vesa:dga
nick
parents: 2633
diff changeset
274 rgb_stride = HAS_DGA()?video_mode_info.XResolution:image_width;
27e829d53e8e Fixed bug of -vc libmpeg2 on vesa:dga
nick
parents: 2633
diff changeset
275 yuv_slice+=(rgb_stride*y+x)*PIXEL_SIZE();
27e829d53e8e Fixed bug of -vc libmpeg2 on vesa:dga
nick
parents: 2633
diff changeset
276 rgb_stride *= PIXEL_SIZE();
2331
9e8585a7182e Final fix of libmpeg2 zooming: flipping page support
nick
parents: 2329
diff changeset
277 yuv2rgb(yuv_slice, image[0], image[1], image[2], w, h,
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
278 rgb_stride, stride[0], stride[1]);
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
279 }
2331
9e8585a7182e Final fix of libmpeg2 zooming: flipping page support
nick
parents: 2329
diff changeset
280 flip_trigger = 1;
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
281 return 0;
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
282 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
283
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
284 static void draw_alpha_32(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
285 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
286 unsigned int dstride=HAS_DGA()?video_mode_info.XResolution:image_width;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
287 vo_draw_alpha_rgb32(w,h,src,srca,stride,dga_buffer+4*(y0*dstride+x0),4*dstride);
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
288 }
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
289
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
290 static void draw_alpha_24(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
291 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
292 unsigned int dstride=HAS_DGA()?video_mode_info.XResolution:image_width;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
293 vo_draw_alpha_rgb24(w,h,src,srca,stride,dga_buffer+3*(y0*dstride+x0),3*dstride);
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
294 }
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
295
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
296 static void draw_alpha_16(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
297 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
298 unsigned int dstride=HAS_DGA()?video_mode_info.XResolution:image_width;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
299 vo_draw_alpha_rgb16(w,h,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride);
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
300 }
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
301
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
302 static void draw_alpha_15(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
303 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
304 unsigned int dstride=HAS_DGA()?video_mode_info.XResolution:image_width;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
305 vo_draw_alpha_rgb15(w,h,src,srca,stride,dga_buffer+2*(y0*dstride+x0),2*dstride);
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
306 }
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
307
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
308 static void draw_alpha_null(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
309 {
2688
e9f6634c6374 Code cleanup
nick
parents: 2686
diff changeset
310 UNUSED(x0);
e9f6634c6374 Code cleanup
nick
parents: 2686
diff changeset
311 UNUSED(y0);
e9f6634c6374 Code cleanup
nick
parents: 2686
diff changeset
312 UNUSED(w);
e9f6634c6374 Code cleanup
nick
parents: 2686
diff changeset
313 UNUSED(h);
e9f6634c6374 Code cleanup
nick
parents: 2686
diff changeset
314 UNUSED(src);
e9f6634c6374 Code cleanup
nick
parents: 2686
diff changeset
315 UNUSED(srca);
e9f6634c6374 Code cleanup
nick
parents: 2686
diff changeset
316 UNUSED(stride);
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
317 }
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
318
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
319
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
320 static void draw_osd(void)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
321 {
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
322 uint32_t w,h;
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
323 if(verbose > 2)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
324 printf("vo_vesa: draw_osd was called\n");
2869
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
325 {
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
326 w = HAS_DGA()?video_mode_info.XResolution:image_width;
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
327 h = HAS_DGA()?video_mode_info.YResolution:image_height;
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
328 if(dga_buffer) vo_draw_text(w,h,draw_alpha_fnc);
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
329 }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
330 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
331
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
332 static void flip_page(void)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
333 {
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
334 if(verbose > 2)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
335 printf("vo_vesa: flip_page was called\n");
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
336 if(flip_trigger)
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
337 {
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
338 if(!HAS_DGA()) __vbeCopyData(dga_buffer);
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
339 flip_trigger = 0;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
340 }
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
341 if(vo_doublebuffering && multi_size > 1 && !lvo_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
342 #ifdef CONFIG_VIDIX
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
343 && !vidix_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
344 #endif
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
345 )
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
346 {
2686
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
347 int err;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
348 if((err=vbeSetDisplayStart(multi_buff[multi_idx],1)) != VBE_OK)
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
349 {
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
350 vesa_term();
2692
b8e628b7a029 Minor notes
nick
parents: 2689
diff changeset
351 PRINT_VBE_ERR("vbeSetDisplayStart",err);
2686
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
352 printf("vo_vesa: Fatal error occured! Can't continue\n");
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
353 exit(EXIT_FAILURE);
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
354 }
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
355 multi_idx = multi_idx ? 0 : 1;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
356 win.ptr = dga_buffer = video_base + multi_buff[multi_idx];
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
357 }
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
358 /*
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
359 else
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
360 if(tripple_buffering)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
361 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
362 vbeSetScheduledDisplayStart(multi_buffer[multi_idx],1);
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
363 multi_idx++;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
364 if(multi_idx > 2) multi_idx = 0;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
365 win.ptr = dga_buffer = video_base + multi_buffer[multi_idx];
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
366 }
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
367 */
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
368 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
369
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
370 /* is called for rgb only */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
371 static uint32_t draw_frame(uint8_t *src[])
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
372 {
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
373 uint8_t *data = src[0];
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
374 if(verbose > 2)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
375 printf("vo_vesa: draw_frame was called\n");
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
376 if(rgb2rgb_fnc)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
377 {
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
378 if(HAS_DGA())
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
379 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
380 size_t i, psize, ssize, dsize;
2676
d3393d940aa5 Fixed rgb2rgb in DGA mode
nick
parents: 2649
diff changeset
381 uint8_t *dest;
d3393d940aa5 Fixed rgb2rgb in DGA mode
nick
parents: 2649
diff changeset
382 const uint8_t *sptr;
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
383 psize = PIXEL_SIZE();
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
384 dsize = SCREEN_LINE_SIZE(psize);
2676
d3393d940aa5 Fixed rgb2rgb in DGA mode
nick
parents: 2649
diff changeset
385 ssize = IMAGE_LINE_SIZE((image_bpp+7)/8);
d3393d940aa5 Fixed rgb2rgb in DGA mode
nick
parents: 2649
diff changeset
386 dest = dga_buffer + y_offset*dsize + x_offset*psize;
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
387 sptr = src[0];
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
388 for(i=0;i<image_height;i++)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
389 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
390 (*rgb2rgb_fnc)(sptr,dest,ssize);
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
391 sptr += ssize;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
392 dest += dsize;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
393 }
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
394 }
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
395 else
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
396 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
397 (*rgb2rgb_fnc)(src[0],dga_buffer,image_width*image_height*image_bpp);
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
398 data = dga_buffer;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
399 }
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
400 if(verbose > 2)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
401 printf("vo_vesa: rgb2rgb_fnc was called\n");
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
402 }
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
403 if((!rgb2rgb_fnc || !HAS_DGA()) && !lvo_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
404 #ifdef CONFIG_VIDIX
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
405 && !vidix_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
406 #endif
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
407 ) __vbeCopyData(data);
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
408 return 0;
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
409 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
410
2953
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
411 #define SUBDEV_NODGA 0x00000001UL
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
412 #define SUBDEV_FORCEDGA 0x00000002UL
4362
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
413 static uint32_t subdev_flags = 0xFFFFFFFEUL;
2953
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
414 static uint32_t parseSubDevice(const char *sd)
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
415 {
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
416 uint32_t flags;
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
417 flags = 0;
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
418 if(strcmp(sd,"nodga") == 0) { flags |= SUBDEV_NODGA; flags &= ~(SUBDEV_FORCEDGA); }
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
419 else
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
420 if(strcmp(sd,"dga") == 0) { flags &= ~(SUBDEV_NODGA); flags |= SUBDEV_FORCEDGA; }
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
421 else
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
422 if(memcmp(sd,"lvo:",4) == 0) lvo_name = &sd[4]; /* lvo_name will be valid within init() */
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
423 #ifdef CONFIG_VIDIX
4030
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
424 else
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
425 if(memcmp(sd,"vidix",5) == 0) vidix_name = &sd[5]; /* vidix_name will be valid within init() */
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
426 #endif
4030
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
427 else { printf("vo_vesa: Unknown subdevice: '%s'\n", sd); return -1; }
2953
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
428 return flags;
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
429 }
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
430
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
431 static uint32_t query_format(uint32_t format)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
432 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
433 uint32_t retval;
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
434 if(verbose > 2)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
435 printf("vo_vesa: query_format was called: %x (%s)\n",format,vo_format_name(format));
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
436 switch(format)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
437 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
438 case IMGFMT_YV12:
2637
8101229be3a5 code cleanup
nick
parents: 2636
diff changeset
439 #if 0 /* Should be tested better */
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
440 case IMGFMT_I420:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
441 case IMGFMT_IYUV:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
442 #endif
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
443 case IMGFMT_RGB8:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
444 case IMGFMT_RGB15:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
445 case IMGFMT_RGB16:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
446 case IMGFMT_RGB24:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
447 case IMGFMT_RGB32:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
448 case IMGFMT_BGR8:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
449 case IMGFMT_BGR15:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
450 case IMGFMT_BGR16:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
451 case IMGFMT_BGR24:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
452 case IMGFMT_BGR32:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
453 retval = 1; break;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
454 default:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
455 if(verbose)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
456 printf("vo_vesa: unknown format: %x = %s\n",format,vo_format_name(format));
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
457 retval = 0;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
458 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
459 return retval;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
460 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
461
2686
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
462 static void paintBkGnd( void )
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
463 {
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
464 int x_res = video_mode_info.XResolution;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
465 int y_res = video_mode_info.YResolution;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
466 int x, y;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
467
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
468 for (y = 0; y < y_res; ++y)
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
469 {
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
470 for (x = 0; x < x_res; ++x)
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
471 {
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
472 int r, g, b;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
473 if ((x & 16) ^ (y & 16))
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
474 {
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
475 r = x * 255 / x_res;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
476 g = y * 255 / y_res;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
477 b = 255 - x * 255 / x_res;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
478 }
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
479 else
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
480 {
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
481 r = 255 - x * 255 / x_res;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
482 g = y * 255 / y_res;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
483 b = 255 - y * 255 / y_res;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
484 }
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
485 __vbeSetPixel(x, y, r, g, b);
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
486 }
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
487 }
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
488 }
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
489
2914
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
490 static void clear_screen( void )
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
491 {
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
492 int x_res = video_mode_info.XResolution;
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
493 int y_res = video_mode_info.YResolution;
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
494 int x, y;
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
495
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
496 for (y = 0; y < y_res; ++y)
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
497 for (x = 0; x < x_res; ++x)
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
498 __vbeSetPixel(x, y, 0, 0, 0);
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
499 }
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
500
2293
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
501 static char *model2str(unsigned char type)
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
502 {
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
503 char *retval;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
504 switch(type)
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
505 {
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
506 case memText: retval = "Text"; break;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
507 case memCGA: retval="CGA"; break;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
508 case memHercules: retval="Hercules"; break;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
509 case memPL: retval="Planar"; break;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
510 case memPK: retval="Packed pixel"; break;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
511 case mem256: retval="256"; break;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
512 case memRGB: retval="Direct color RGB"; break;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
513 case memYUV: retval="Direct color YUV"; break;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
514 default: retval="Unknown"; break;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
515 }
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
516 return retval;
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
517 }
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
518
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
519 unsigned fillMultiBuffer( unsigned long vsize, unsigned nbuffs )
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
520 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
521 unsigned long screen_size, offset;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
522 unsigned total,i;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
523 screen_size = video_mode_info.XResolution*video_mode_info.YResolution*((video_mode_info.BitsPerPixel+7)/8);
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
524 if(screen_size%64) screen_size=((screen_size/64)*64)+64;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
525 total = vsize / screen_size;
2918
a4646faefabd No comments
nick
parents: 2914
diff changeset
526 if(verbose) printf("vo_vesa: Can use up to %u video buffers\n",total);
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
527 i = 0;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
528 offset = 0;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
529 total = min(total,nbuffs);
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
530 while(i < total) { multi_buff[i++] = offset; offset += screen_size; }
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
531 if(!i)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
532 printf("vo_vesa: Your have too small size of video memory for this mode:\n"
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
533 "vo_vesa: Requires: %08lX exists: %08lX\n", screen_size, vsize);
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
534 return i;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
535 }
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
536
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
537
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
538 /* fullscreen:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
539 * bit 0 (0x01) means fullscreen (-fs)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
540 * bit 1 (0x02) means mode switching (-vm)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
541 * bit 2 (0x04) enables software scaling (-zoom)
2335
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
542 * bit 3 (0x08) enables flipping (-flip) (NK: and for what?)
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
543 */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
544 static uint32_t
2329
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
545 init(uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format)
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
546 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
547 struct VbeInfoBlock vib;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
548 struct VesaModeInfoBlock vmib;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
549 size_t i,num_modes;
4362
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
550 uint32_t w,h;
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
551 unsigned short *mode_ptr,win_seg;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
552 unsigned bpp,best_x = UINT_MAX,best_y=UINT_MAX,best_mode_idx = UINT_MAX;
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
553 int err,fs_mode,yuv_fmt;
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
554 image_width = width;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
555 image_height = height;
2336
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
556 fs_mode = 0;
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
557 rgb2rgb_fnc = NULL;
4362
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
558 if(subdev_flags == 0xFFFFFFFEUL)
2971
56faed773768 Added preinit of lvo stuff
nick
parents: 2966
diff changeset
559 {
4362
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
560 printf("vo_vesa: detected internal fatal error: init is called before preinit\n");
2971
56faed773768 Added preinit of lvo stuff
nick
parents: 2966
diff changeset
561 return -1;
4362
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
562 }
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
563 if(subdev_flags == -1) return -1;
2329
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
564 if(flags & 0x8)
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
565 {
2329
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
566 printf("vo_vesa: switch -flip is not supported\n");
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
567 }
2329
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
568 if(flags & 0x04) vesa_zoom = 1;
2336
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
569 if(flags & 0x01)
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
570 {
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
571 if(vesa_zoom) vesa_zoom = 2;
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
572 else fs_mode = 1;
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
573 }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
574 if((err=vbeInit()) != VBE_OK) { PRINT_VBE_ERR("vbeInit",err); return -1; }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
575 memcpy(vib.VESASignature,"VBE2",4);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
576 if((err=vbeGetControllerInfo(&vib)) != VBE_OK)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
577 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
578 PRINT_VBE_ERR("vbeGetControllerInfo",err);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
579 printf("vo_vesa: possible reason: No VBE2 BIOS found\n");
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
580 return -1;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
581 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
582 /* Print general info here */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
583 printf("vo_vesa: Found VESA VBE BIOS Version %x.%x Revision: %x\n",
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
584 (int)(vib.VESAVersion >> 8) & 0xff,
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
585 (int)(vib.VESAVersion & 0xff),
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
586 (int)(vib.OemSoftwareRev & 0xffff));
2255
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
587 printf("vo_vesa: Video memory: %u Kb\n",vib.TotalMemory*64);
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
588 printf("vo_vesa: VESA Capabilities: %s %s %s %s %s\n"
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
589 ,vib.Capabilities & VBE_DAC_8BIT ? "8-bit DAC," : "6-bit DAC,"
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
590 ,vib.Capabilities & VBE_NONVGA_CRTC ? "non-VGA CRTC,":"VGA CRTC,"
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
591 ,vib.Capabilities & VBE_SNOWED_RAMDAC ? "snowed RAMDAC,":"normal RAMDAC,"
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
592 ,vib.Capabilities & VBE_STEREOSCOPIC ? "stereoscopic,":"no stereoscopic,"
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
593 ,vib.Capabilities & VBE_STEREO_EVC ? "Stereo EVC":"no stereo");
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
594 printf("vo_vesa: !!! Below will be printed OEM info. !!!\n");
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
595 printf("vo_vesa: You should watch 5 OEM related lines below else you've broken vm86\n");
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
596 printf("vo_vesa: OEM info: %s\n",vib.OemStringPtr);
2255
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
597 printf("vo_vesa: OEM Revision: %x\n",vib.OemSoftwareRev);
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
598 printf("vo_vesa: OEM vendor: %s\n",vib.OemVendorNamePtr);
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
599 printf("vo_vesa: OEM Product Name: %s\n",vib.OemProductNamePtr);
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
600 printf("vo_vesa: OEM Product Rev: %s\n",vib.OemProductRevPtr);
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
601 printf("vo_vesa: Hint: To get workable TV-Out you should have plugged tv-connector in\n"
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
602 "vo_vesa: before booting PC since VESA BIOS initializes itself only during POST\n");
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
603 /* Find best mode here */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
604 num_modes = 0;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
605 mode_ptr = vib.VideoModePtr;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
606 while(*mode_ptr++ != 0xffff) num_modes++;
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
607 yuv_fmt = 0;
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
608 switch(format)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
609 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
610 case IMGFMT_BGR8:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
611 case IMGFMT_RGB8: bpp = 8; break;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
612 case IMGFMT_BGR15:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
613 case IMGFMT_RGB15: bpp = 15; break;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
614 case IMGFMT_YV12:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
615 case IMGFMT_I420:
2553
db0d4caf5e47 Cosmetic
nick
parents: 2537
diff changeset
616 case IMGFMT_IYUV: yuv_fmt = 1;
db0d4caf5e47 Cosmetic
nick
parents: 2537
diff changeset
617 default:
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
618 case IMGFMT_BGR16:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
619 case IMGFMT_RGB16: bpp = 16; break;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
620 case IMGFMT_BGR24:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
621 case IMGFMT_RGB24: bpp = 24; break;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
622 case IMGFMT_BGR32:
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
623 case IMGFMT_RGB32: bpp = 32; break;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
624 }
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
625 image_bpp = bpp;
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
626 if(vo_dbpp) bpp = vo_dbpp;
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
627 if(yuv_fmt) yuv2rgb_init(bpp, MODE_RGB);
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
628 switch(bpp)
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
629 {
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
630 case 15: draw_alpha_fnc = draw_alpha_15; break;
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
631 case 16: draw_alpha_fnc = draw_alpha_16; break;
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
632 case 24: draw_alpha_fnc = draw_alpha_24; break;
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
633 case 32: draw_alpha_fnc = draw_alpha_32; break;
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
634 default: draw_alpha_fnc = draw_alpha_null; break;
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
635 }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
636 if(verbose)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
637 {
2304
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
638 printf("vo_vesa: Requested mode: %ux%u@%u (%s)\n",width,height,bpp,vo_format_name(format));
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
639 printf("vo_vesa: Total modes found: %u\n",num_modes);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
640 mode_ptr = vib.VideoModePtr;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
641 printf("vo_vesa: Mode list:");
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
642 for(i = 0;i < num_modes;i++)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
643 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
644 printf(" %04X",mode_ptr[i]);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
645 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
646 printf("\nvo_vesa: Modes in detail:\n");
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
647 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
648 mode_ptr = vib.VideoModePtr;
2335
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
649 if(vesa_zoom)
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
650 {
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
651 image_width = d_width;
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
652 image_height= d_height;
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
653 }
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
654 if(vo_screenwidth) w = vo_screenwidth;
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
655 else w = max(image_width,width);
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
656 if(vo_screenheight) h = vo_screenheight;
26fdd1a317ad Again changed logic:
nick
parents: 2333
diff changeset
657 else h = max(image_height,height);
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
658 for(i=0;i < num_modes;i++)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
659 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
660 if((err=vbeGetModeInfo(mode_ptr[i],&vmib)) != VBE_OK)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
661 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
662 PRINT_VBE_ERR("vbeGetModeInfo",err);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
663 return -1;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
664 }
2329
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
665 if(vmib.XResolution >= w &&
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
666 vmib.YResolution >= h &&
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
667 (vmib.ModeAttributes & MOVIE_MODE) == MOVIE_MODE &&
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
668 vmib.BitsPerPixel == bpp &&
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
669 vmib.MemoryModel == memRGB)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
670 {
2293
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
671 if(vmib.XResolution <= best_x &&
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
672 vmib.YResolution <= best_y)
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
673 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
674 best_x = vmib.XResolution;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
675 best_y = vmib.YResolution;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
676 best_mode_idx = i;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
677 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
678 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
679 if(verbose)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
680 {
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
681 printf("vo_vesa: Mode (%03u): mode=%04X %ux%u@%u attr=%04X\n"
2293
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
682 "vo_vesa: #planes=%u model=%u(%s) #pages=%u\n"
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
683 "vo_vesa: winA=%X(attr=%u) winB=%X(attr=%u) winSize=%u winGran=%u\n"
2446
6fb598bd7ede Suppressing warnings
nick
parents: 2410
diff changeset
684 "vo_vesa: direct_color=%u DGA_phys_addr=%08lX\n"
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
685 ,i,mode_ptr[i],vmib.XResolution,vmib.YResolution,vmib.BitsPerPixel,vmib.ModeAttributes
2293
638cd37032da Better resolution detection
nick
parents: 2255
diff changeset
686 ,vmib.NumberOfPlanes,vmib.MemoryModel,model2str(vmib.MemoryModel),vmib.NumberOfImagePages
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
687 ,vmib.WinASegment,vmib.WinAAttributes,vmib.WinBSegment,vmib.WinBAttributes,vmib.WinSize,vmib.WinGranularity
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
688 ,vmib.DirectColorModeInfo,vmib.PhysBasePtr);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
689 if(vmib.MemoryModel == 6 || vmib.MemoryModel == 7)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
690 printf("vo_vesa: direct_color_info = %u:%u:%u:%u\n"
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
691 ,vmib.RedMaskSize,vmib.GreenMaskSize,vmib.BlueMaskSize,vmib.RsvdMaskSize);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
692 fflush(stdout);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
693 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
694 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
695 if(best_mode_idx != UINT_MAX)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
696 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
697 video_mode = vib.VideoModePtr[best_mode_idx];
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
698 fflush(stdout);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
699 if((err=vbeGetMode(&init_mode)) != VBE_OK)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
700 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
701 PRINT_VBE_ERR("vbeGetMode",err);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
702 return -1;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
703 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
704 if(verbose) printf("vo_vesa: Initial video mode: %x\n",init_mode);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
705 if((err=vbeGetModeInfo(video_mode,&video_mode_info)) != VBE_OK)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
706 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
707 PRINT_VBE_ERR("vbeGetModeInfo",err);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
708 return -1;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
709 }
2329
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
710 printf("vo_vesa: Using VESA mode (%u) = %x [%ux%u@%u]\n"
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
711 ,best_mode_idx,video_mode,video_mode_info.XResolution
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
712 ,video_mode_info.YResolution,video_mode_info.BitsPerPixel);
4362
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
713 if(subdev_flags & SUBDEV_NODGA) video_mode_info.PhysBasePtr = 0;
2336
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
714 if( vesa_zoom || fs_mode )
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
715 {
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
716 if(format==IMGFMT_YV12 || lvo_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
717 #ifdef CONFIG_VIDIX
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
718 || vidix_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
719 #endif
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
720 )
2304
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
721 {
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
722 /* software scale */
2329
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
723 if(vesa_zoom > 1)
2689
6a5b6b16d85c Use standard aspect code
nick
parents: 2688
diff changeset
724 {
6a5b6b16d85c Use standard aspect code
nick
parents: 2688
diff changeset
725 aspect_save_orig(width,height);
6a5b6b16d85c Use standard aspect code
nick
parents: 2688
diff changeset
726 aspect_save_prescale(d_width,d_height);
6a5b6b16d85c Use standard aspect code
nick
parents: 2688
diff changeset
727 aspect_save_screenres(video_mode_info.XResolution,video_mode_info.YResolution);
6a5b6b16d85c Use standard aspect code
nick
parents: 2688
diff changeset
728 aspect(&image_width,&image_height,A_ZOOM);
6a5b6b16d85c Use standard aspect code
nick
parents: 2688
diff changeset
729 }
2336
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
730 else
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
731 if(fs_mode)
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
732 {
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
733 image_width = video_mode_info.XResolution;
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
734 image_height = video_mode_info.YResolution;
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
735 vesa_zoom = 1;
b2e0b131c1a7 Again changed logic:
nick
parents: 2335
diff changeset
736 }
3209
0b172eb639f1 swscaler cleanup
michael
parents: 3202
diff changeset
737 scale_srcW=width;
0b172eb639f1 swscaler cleanup
michael
parents: 3202
diff changeset
738 scale_srcH=height;
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
739 if(!lvo_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
740 #ifdef CONFIG_VIDIX
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
741 && !vidix_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
742 #endif
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
743 ) SwScale_Init();
2304
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
744 if(verbose) printf("vo_vesa: Using SCALE\n");
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
745 }
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
746 else
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
747 {
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
748 printf("vo_vesa: Can't apply zooming to non YV12 formats\n");
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
749 return -1;
0769b2fb3ce2 Fixed zooming bug
nick
parents: 2298
diff changeset
750 }
2298
674acdf0aa43 SwScaling support
nick
parents: 2296
diff changeset
751 }
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
752 if(format != IMGFMT_YV12 && image_bpp != video_mode_info.BitsPerPixel && !lvo_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
753 #ifdef CONFIG_VIDIX
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
754 && !vidix_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
755 #endif
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
756 )
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
757 {
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
758 if(image_bpp == 24 && video_mode_info.BitsPerPixel == 32) rgb2rgb_fnc = rgb24to32;
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
759 else
2505
2aaa11d22f91 vo_vesa: more rgb2rgb support
nick
parents: 2504
diff changeset
760 if(image_bpp == 32 && video_mode_info.BitsPerPixel == 24) rgb2rgb_fnc = rgb32to24;
2aaa11d22f91 vo_vesa: more rgb2rgb support
nick
parents: 2504
diff changeset
761 else
2712
7732745d5f3f rgb32to16, rgb32to15 support
nick
parents: 2692
diff changeset
762 if(image_bpp == 32 && video_mode_info.BitsPerPixel == 16) rgb2rgb_fnc = rgb32to16;
7732745d5f3f rgb32to16, rgb32to15 support
nick
parents: 2692
diff changeset
763 else
7732745d5f3f rgb32to16, rgb32to15 support
nick
parents: 2692
diff changeset
764 if(image_bpp == 32 && video_mode_info.BitsPerPixel == 15) rgb2rgb_fnc = rgb32to15;
7732745d5f3f rgb32to16, rgb32to15 support
nick
parents: 2692
diff changeset
765 else
2718
9c5e64493742 Well - old algorithms and new stuff rgb24to16(15)
nick
parents: 2712
diff changeset
766 if(image_bpp == 24 && video_mode_info.BitsPerPixel == 16) rgb2rgb_fnc = rgb24to16;
9c5e64493742 Well - old algorithms and new stuff rgb24to16(15)
nick
parents: 2712
diff changeset
767 else
9c5e64493742 Well - old algorithms and new stuff rgb24to16(15)
nick
parents: 2712
diff changeset
768 if(image_bpp == 24 && video_mode_info.BitsPerPixel == 15) rgb2rgb_fnc = rgb24to15;
9c5e64493742 Well - old algorithms and new stuff rgb24to16(15)
nick
parents: 2712
diff changeset
769 else
2506
501752469c39 vo_vesa: more rgb2rgb support
nick
parents: 2505
diff changeset
770 if(image_bpp == 15 && video_mode_info.BitsPerPixel == 16) rgb2rgb_fnc = rgb15to16;
501752469c39 vo_vesa: more rgb2rgb support
nick
parents: 2505
diff changeset
771 else
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
772 {
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
773 printf("vo_vesa: Can't convert %u to %u\n",image_bpp,video_mode_info.BitsPerPixel);
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
774 return -1;
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
775 }
2554
db9d31c4bf4c print 'sw convertor usage' without verbosing
nick
parents: 2553
diff changeset
776 printf("vo_vesa: using %u-bpp to %u-bpp sw convertor\n",image_bpp,video_mode_info.BitsPerPixel);
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
777 }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
778 if((video_mode_info.WinAAttributes & FRAME_MODE) == FRAME_MODE)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
779 win.idx = 0; /* frame A */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
780 else
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
781 if((video_mode_info.WinBAttributes & FRAME_MODE) == FRAME_MODE)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
782 win.idx = 1; /* frame B */
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
783 else win.idx = -2;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
784 /* Try use DGA instead */
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
785 if(video_mode_info.PhysBasePtr && vib.TotalMemory && (video_mode_info.ModeAttributes & MODE_ATTR_LINEAR))
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
786 {
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
787 void *lfb;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
788 unsigned long vsize;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
789 vsize = vib.TotalMemory*64*1024;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
790 lfb = vbeMapVideoBuffer(video_mode_info.PhysBasePtr,vsize);
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
791 if(lfb == NULL)
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
792 printf("vo_vesa: Can't use DGA. Force bank switching mode. :(\n");
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
793 else
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
794 {
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
795 video_base = win.ptr = lfb;
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
796 win.low = 0UL;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
797 win.high = vsize;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
798 win.idx = -1; /* HAS_DGA() is on */
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
799 video_mode |= VESA_MODE_USE_LINEAR;
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
800 printf("vo_vesa: Using DGA (physical resources: %08lXh, %08lXh)"
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
801 ,video_mode_info.PhysBasePtr
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
802 ,vsize);
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
803 if(verbose) printf(" at %08lXh",(unsigned long)lfb);
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
804 printf("\n");
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
805 if(!(multi_size = fillMultiBuffer(vsize,2))) return -1;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
806 if(vo_doublebuffering && multi_size < 2)
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
807 printf("vo_vesa: Can't use double buffering: not enough video memory\n");
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
808 }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
809 }
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
810 if(win.idx == -2)
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
811 {
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
812 printf("vo_vesa: Can't find neither DGA nor relocatable window's frame.\n");
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
813 return -1;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
814 }
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
815 if(!HAS_DGA())
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
816 {
4362
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
817 if(subdev_flags & SUBDEV_FORCEDGA)
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
818 {
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
819 printf("vo_vesa: you've forced DGA. Exiting\n");
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
820 return -1;
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
821 }
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
822 if(!(win_seg = win.idx == 0 ? video_mode_info.WinASegment:video_mode_info.WinBSegment))
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
823 {
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
824 printf("vo_vesa: Can't find valid window address\n");
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
825 return -1;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
826 }
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
827 win.ptr = PhysToVirtSO(win_seg,0);
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
828 win.low = 0L;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
829 win.high= video_mode_info.WinSize*1024;
2649
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
830 printf("vo_vesa: Using bank switching mode (physical resources: %08lXh, %08lXh)\n"
d05fc32b7984 What's new:
nick
parents: 2637
diff changeset
831 ,(unsigned long)win.ptr,(unsigned long)win.high);
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
832 }
2329
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
833 if(video_mode_info.XResolution > image_width)
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
834 x_offset = (video_mode_info.XResolution - image_width) / 2;
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
835 else x_offset = 0;
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
836 if(video_mode_info.YResolution > image_height)
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
837 y_offset = (video_mode_info.YResolution - image_height) / 2;
fc52a0a1626f Support of: -x -y -bpp
nick
parents: 2328
diff changeset
838 else y_offset = 0;
2305
82c17b134946 Fixed half-image bug and added computing of correct aspect during zooming
nick
parents: 2304
diff changeset
839 if(verbose)
82c17b134946 Fixed half-image bug and added computing of correct aspect during zooming
nick
parents: 2304
diff changeset
840 printf("vo_vesa: image: %ux%u screen = %ux%u x_offset = %u y_offset = %u\n"
82c17b134946 Fixed half-image bug and added computing of correct aspect during zooming
nick
parents: 2304
diff changeset
841 ,image_width,image_height
82c17b134946 Fixed half-image bug and added computing of correct aspect during zooming
nick
parents: 2304
diff changeset
842 ,video_mode_info.XResolution,video_mode_info.YResolution
82c17b134946 Fixed half-image bug and added computing of correct aspect during zooming
nick
parents: 2304
diff changeset
843 ,x_offset,y_offset);
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
844 if(HAS_DGA())
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
845 {
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
846 dga_buffer = win.ptr; /* Trickly ;) */
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
847 cpy_blk_fnc = __vbeCopyBlockFast;
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
848 }
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
849 else
2610
65cb69a90a9f vo_vesa: DGA support
nick
parents: 2554
diff changeset
850 {
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
851 cpy_blk_fnc = __vbeCopyBlock;
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
852 if((yuv_fmt || rgb2rgb_fnc) && !lvo_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
853 #ifdef CONFIG_VIDIX
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
854 && !vidix_name
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
855 #endif
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
856 )
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
857 {
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
858 if(!(dga_buffer = memalign(64,video_mode_info.XResolution*video_mode_info.YResolution*video_mode_info.BitsPerPixel)))
2610
65cb69a90a9f vo_vesa: DGA support
nick
parents: 2554
diff changeset
859 {
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
860 printf("vo_vesa: Can't allocate temporary buffer\n");
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
861 return -1;
2610
65cb69a90a9f vo_vesa: DGA support
nick
parents: 2554
diff changeset
862 }
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
863 if(verbose) printf("vo_vesa: dga emulator was allocated = %p\n",dga_buffer);
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
864 }
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
865 }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
866 if((err=vbeSaveState(&init_state)) != VBE_OK)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
867 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
868 PRINT_VBE_ERR("vbeSaveState",err);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
869 return -1;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
870 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
871 if((err=vbeSetMode(video_mode,NULL)) != VBE_OK)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
872 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
873 PRINT_VBE_ERR("vbeSetMode",err);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
874 return -1;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
875 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
876 /* Now we are in video mode!!!*/
2337
e6d8e9a54afa OSD support
nick
parents: 2336
diff changeset
877 /* Below 'return -1' is impossible */
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
878 if(verbose)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
879 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
880 printf("vo_vesa: Graphics mode was activated\n");
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
881 fflush(stdout);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
882 }
2869
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
883 if(lvo_name)
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
884 {
2971
56faed773768 Added preinit of lvo stuff
nick
parents: 2966
diff changeset
885 if(vlvo_init(width,height,x_offset,y_offset,image_width,image_height,format,video_mode_info.BitsPerPixel) != 0)
2869
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
886 {
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
887 printf("vo_vesa: Can't initialize Linux Video Overlay\n");
2953
b0cf2b649d3c Fixed incorretc terminating of lvo stuff and improving of query_format
nick
parents: 2918
diff changeset
888 lvo_name = NULL;
2869
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
889 vesa_term();
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
890 return -1;
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
891 }
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
892 else printf("vo_vesa: Using video overlay: %s\n",lvo_name);
107d9e9e5bd1 New video output technique Linux Video Overlay:
nick
parents: 2775
diff changeset
893 }
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
894 #ifdef CONFIG_VIDIX
4030
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
895 else
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
896 if(vidix_name)
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
897 {
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
898 if(vidix_init(width,height,x_offset,y_offset,image_width,
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
899 image_height,format,video_mode_info.BitsPerPixel,
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
900 video_mode_info.XResolution,video_mode_info.YResolution) != 0)
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
901 {
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
902 printf("vo_vesa: Can't initialize VIDIX driver\n");
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
903 vidix_name = NULL;
4083
00c1bba6ca14 Minor bugs and new vidix stuff support
nick
parents: 4030
diff changeset
904 vidix_term();
4030
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
905 return -1;
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
906 }
4083
00c1bba6ca14 Minor bugs and new vidix stuff support
nick
parents: 4030
diff changeset
907 else printf("vo_vesa: Using VIDIX\n");
4198
7e2bf04c9a7c added vidix_start() and vidix_stop() for better runtime-resize support ;)
alex
parents: 4089
diff changeset
908 vidix_start();
4030
922241968c63 Embedding vidix
nick
parents: 4002
diff changeset
909 }
4089
e1c6178de089 Configurable VIDIX usage
nick
parents: 4083
diff changeset
910 #endif
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
911 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
912 else
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
913 {
2255
98c2bfc87825 More hints. Use save-restore mechanism
nick
parents: 2244
diff changeset
914 printf("vo_vesa: Can't find mode for: %ux%u@%u\n",width,height,bpp);
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
915 return -1;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
916 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
917 if(verbose)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
918 {
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
919 printf("vo_vesa: VESA initialization complete\n");
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
920 fflush(stdout);
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
921 }
2914
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
922 /* Clear screen for stupid BIOSes */
1ccec8cd9310 Screen clearing instead of stupid BIOSes
nick
parents: 2872
diff changeset
923 clear_screen();
2688
e9f6634c6374 Code cleanup
nick
parents: 2686
diff changeset
924 if(HAS_DGA() && vo_doublebuffering)
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
925 {
2686
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
926 for(i=0;i<MAX_BUFFERS;i++)
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
927 {
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
928 win.ptr = dga_buffer = video_base + multi_buff[i];
4002
6ce744b637ad paint background on -v -v
nick
parents: 3209
diff changeset
929 if(verbose>1) paintBkGnd();
2686
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
930 }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
931 }
2686
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
932 else
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
933 {
4002
6ce744b637ad paint background on -v -v
nick
parents: 3209
diff changeset
934 if(verbose>1) paintBkGnd();
2686
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
935 {
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
936 int x;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
937 x = (video_mode_info.XResolution/video_mode_info.XCharSize)/2-strlen(title)/2;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
938 if(x < 0) x = 0;
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
939 vbeWriteString(x,0,7,title);
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
940 }
2633
fe5ab8c660de Qualitative speedup decoding when video card supports DGA!
nick
parents: 2610
diff changeset
941 }
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
942 return 0;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
943 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
944
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
945 static const vo_info_t*
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
946 get_info(void)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
947 {
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
948 if(verbose > 2)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
949 printf("vo_vesa: get_info was called\n");
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
950 return &vo_info;
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
951 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
952
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
953 static void
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
954 uninit(void)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
955 {
2686
44ff6b5c7cea Double buffering support
nick
parents: 2676
diff changeset
956 vesa_term();
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
957 if(verbose > 2)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
958 printf("vo_vesa: uninit was called\n");
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
959 }
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
960
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
961
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
962 static void check_events(void)
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
963 {
2504
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
964 if(verbose > 2)
13e1c5ab417a vo_vesa: rgb2rgb support
nick
parents: 2446
diff changeset
965 printf("vo_vesa: check_events was called\n");
2244
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
966 /* Nothing to do */
4e464b527f5a vo_vesa support
nick
parents:
diff changeset
967 }
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4198
diff changeset
968
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4198
diff changeset
969 static uint32_t preinit(const char *arg)
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4198
diff changeset
970 {
4362
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
971 int pre_init_err = 0;
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
972 if(verbose>1) printf("vo_vesa: preinit(%s) was called\n",arg);
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
973 if(verbose > 2)
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
974 printf("vo_vesa: subdevice %s is being initialized\n",arg);
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
975 subdev_flags = 0;
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
976 if(arg) subdev_flags = parseSubDevice(arg);
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
977 if(lvo_name) pre_init_err = vlvo_preinit(lvo_name);
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
978 #ifdef CONFIG_VIDIX
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
979 else if(vidix_name) pre_init_err = vidix_preinit(vidix_name,&video_out_vesa);
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
980 #endif
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
981 if(verbose > 2)
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
982 printf("vo_subdevice: initialization returns: %i\n",pre_init_err);
7ef67ffa9274 preinit usage
nick
parents: 4352
diff changeset
983 return pre_init_err;
4352
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4198
diff changeset
984 }
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4198
diff changeset
985
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4198
diff changeset
986 static void query_vaa(vo_vaa_t *vaa)
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4198
diff changeset
987 {
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4198
diff changeset
988 memset(vaa,0,sizeof(vo_vaa_t));
ed5b85b713a3 Extensions for video accelerated architecture
nick
parents: 4198
diff changeset
989 }