Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
m1k1o
GitHub Repository: m1k1o/neko
Path: blob/master/utils/xorg-deps/xf86-video-dummy/v0.3.8/src/dummy_driver.c
1013 views
1
2
/*
3
* Copyright 2002, SuSE Linux AG, Author: Egbert Eich
4
*/
5
6
#ifdef HAVE_CONFIG_H
7
#include "config.h"
8
#endif
9
10
/* All drivers should typically include these */
11
#include "xf86.h"
12
#include "xf86_OSproc.h"
13
14
/* All drivers initialising the SW cursor need this */
15
#include "mipointer.h"
16
17
/* All drivers using the mi colormap manipulation need this */
18
#include "micmap.h"
19
20
/* identifying atom needed by magnifiers */
21
#include <X11/Xatom.h>
22
#include "property.h"
23
24
#include "xf86cmap.h"
25
26
#include "xf86fbman.h"
27
28
#include "fb.h"
29
30
#include "picturestr.h"
31
32
#ifdef XvExtension
33
#include "xf86xv.h"
34
#include <X11/extensions/Xv.h>
35
#endif
36
37
/*
38
* Driver data structures.
39
*/
40
#include "dummy.h"
41
42
/* These need to be checked */
43
#include <X11/X.h>
44
#include <X11/Xproto.h>
45
#include "scrnintstr.h"
46
#include "servermd.h"
47
#ifdef USE_DGA
48
#define _XF86DGA_SERVER_
49
#include <X11/extensions/xf86dgaproto.h>
50
#endif
51
52
/* Mandatory functions */
53
static const OptionInfoRec * DUMMYAvailableOptions(int chipid, int busid);
54
static void DUMMYIdentify(int flags);
55
static Bool DUMMYProbe(DriverPtr drv, int flags);
56
static Bool DUMMYPreInit(ScrnInfoPtr pScrn, int flags);
57
static Bool DUMMYScreenInit(SCREEN_INIT_ARGS_DECL);
58
static Bool DUMMYEnterVT(VT_FUNC_ARGS_DECL);
59
static void DUMMYLeaveVT(VT_FUNC_ARGS_DECL);
60
static Bool DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL);
61
static Bool DUMMYCreateWindow(WindowPtr pWin);
62
static void DUMMYFreeScreen(FREE_SCREEN_ARGS_DECL);
63
static ModeStatus DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode,
64
Bool verbose, int flags);
65
static Bool DUMMYSaveScreen(ScreenPtr pScreen, int mode);
66
67
/* Internally used functions */
68
static Bool dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op,
69
pointer ptr);
70
71
72
/* static void DUMMYDisplayPowerManagementSet(ScrnInfoPtr pScrn, */
73
/* int PowerManagementMode, int flags); */
74
75
#define DUMMY_VERSION 4000
76
#define DUMMY_NAME "DUMMY"
77
#define DUMMY_DRIVER_NAME "dummy"
78
79
#define DUMMY_MAJOR_VERSION PACKAGE_VERSION_MAJOR
80
#define DUMMY_MINOR_VERSION PACKAGE_VERSION_MINOR
81
#define DUMMY_PATCHLEVEL PACKAGE_VERSION_PATCHLEVEL
82
83
#define DUMMY_MAX_WIDTH 32767
84
#define DUMMY_MAX_HEIGHT 32767
85
86
/*
87
* This is intentionally screen-independent. It indicates the binding
88
* choice made in the first PreInit.
89
*/
90
static int pix24bpp = 0;
91
92
93
/*
94
* This contains the functions needed by the server after loading the driver
95
* module. It must be supplied, and gets passed back by the SetupProc
96
* function in the dynamic case. In the static case, a reference to this
97
* is compiled in, and this requires that the name of this DriverRec be
98
* an upper-case version of the driver name.
99
*/
100
101
_X_EXPORT DriverRec DUMMY = {
102
DUMMY_VERSION,
103
DUMMY_DRIVER_NAME,
104
DUMMYIdentify,
105
DUMMYProbe,
106
DUMMYAvailableOptions,
107
NULL,
108
0,
109
dummyDriverFunc
110
};
111
112
static SymTabRec DUMMYChipsets[] = {
113
{ DUMMY_CHIP, "dummy" },
114
{ -1, NULL }
115
};
116
117
typedef enum {
118
OPTION_SW_CURSOR
119
} DUMMYOpts;
120
121
static const OptionInfoRec DUMMYOptions[] = {
122
{ OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE },
123
{ -1, NULL, OPTV_NONE, {0}, FALSE }
124
};
125
126
#ifdef XFree86LOADER
127
128
static MODULESETUPPROTO(dummySetup);
129
130
static XF86ModuleVersionInfo dummyVersRec =
131
{
132
"dummy",
133
MODULEVENDORSTRING,
134
MODINFOSTRING1,
135
MODINFOSTRING2,
136
XORG_VERSION_CURRENT,
137
DUMMY_MAJOR_VERSION, DUMMY_MINOR_VERSION, DUMMY_PATCHLEVEL,
138
ABI_CLASS_VIDEODRV,
139
ABI_VIDEODRV_VERSION,
140
MOD_CLASS_VIDEODRV,
141
{0,0,0,0}
142
};
143
144
/*
145
* This is the module init data.
146
* Its name has to be the driver name followed by ModuleData
147
*/
148
_X_EXPORT XF86ModuleData dummyModuleData = { &dummyVersRec, dummySetup, NULL };
149
150
static pointer
151
dummySetup(pointer module, pointer opts, int *errmaj, int *errmin)
152
{
153
static Bool setupDone = FALSE;
154
155
if (!setupDone) {
156
setupDone = TRUE;
157
xf86AddDriver(&DUMMY, module, HaveDriverFuncs);
158
159
/*
160
* Modules that this driver always requires can be loaded here
161
* by calling LoadSubModule().
162
*/
163
164
/*
165
* The return value must be non-NULL on success even though there
166
* is no TearDownProc.
167
*/
168
return (pointer)1;
169
} else {
170
if (errmaj) *errmaj = LDR_ONCEONLY;
171
return NULL;
172
}
173
}
174
175
#endif /* XFree86LOADER */
176
177
static Bool
178
DUMMYGetRec(ScrnInfoPtr pScrn)
179
{
180
/*
181
* Allocate a DUMMYRec, and hook it into pScrn->driverPrivate.
182
* pScrn->driverPrivate is initialised to NULL, so we can check if
183
* the allocation has already been done.
184
*/
185
if (pScrn->driverPrivate != NULL)
186
return TRUE;
187
188
pScrn->driverPrivate = xnfcalloc(sizeof(DUMMYRec), 1);
189
190
if (pScrn->driverPrivate == NULL)
191
return FALSE;
192
return TRUE;
193
}
194
195
static void
196
DUMMYFreeRec(ScrnInfoPtr pScrn)
197
{
198
if (pScrn->driverPrivate == NULL)
199
return;
200
free(pScrn->driverPrivate);
201
pScrn->driverPrivate = NULL;
202
}
203
204
static const OptionInfoRec *
205
DUMMYAvailableOptions(int chipid, int busid)
206
{
207
return DUMMYOptions;
208
}
209
210
/* Mandatory */
211
static void
212
DUMMYIdentify(int flags)
213
{
214
xf86PrintChipsets(DUMMY_NAME, "Driver for Dummy chipsets",
215
DUMMYChipsets);
216
}
217
218
/* Mandatory */
219
static Bool
220
DUMMYProbe(DriverPtr drv, int flags)
221
{
222
Bool foundScreen = FALSE;
223
int numDevSections, numUsed;
224
GDevPtr *devSections;
225
int i;
226
227
if (flags & PROBE_DETECT)
228
return FALSE;
229
/*
230
* Find the config file Device sections that match this
231
* driver, and return if there are none.
232
*/
233
if ((numDevSections = xf86MatchDevice(DUMMY_DRIVER_NAME,
234
&devSections)) <= 0) {
235
return FALSE;
236
}
237
238
numUsed = numDevSections;
239
240
if (numUsed > 0) {
241
242
for (i = 0; i < numUsed; i++) {
243
ScrnInfoPtr pScrn = NULL;
244
int entityIndex =
245
xf86ClaimNoSlot(drv,DUMMY_CHIP,devSections[i],TRUE);
246
/* Allocate a ScrnInfoRec and claim the slot */
247
if ((pScrn = xf86AllocateScreen(drv,0 ))) {
248
xf86AddEntityToScreen(pScrn,entityIndex);
249
pScrn->driverVersion = DUMMY_VERSION;
250
pScrn->driverName = DUMMY_DRIVER_NAME;
251
pScrn->name = DUMMY_NAME;
252
pScrn->Probe = DUMMYProbe;
253
pScrn->PreInit = DUMMYPreInit;
254
pScrn->ScreenInit = DUMMYScreenInit;
255
pScrn->SwitchMode = DUMMYSwitchMode;
256
pScrn->AdjustFrame = DUMMYAdjustFrame;
257
pScrn->EnterVT = DUMMYEnterVT;
258
pScrn->LeaveVT = DUMMYLeaveVT;
259
pScrn->FreeScreen = DUMMYFreeScreen;
260
pScrn->ValidMode = DUMMYValidMode;
261
262
foundScreen = TRUE;
263
}
264
}
265
}
266
return foundScreen;
267
}
268
269
# define RETURN \
270
{ DUMMYFreeRec(pScrn);\
271
return FALSE;\
272
}
273
274
/* Mandatory */
275
Bool
276
DUMMYPreInit(ScrnInfoPtr pScrn, int flags)
277
{
278
ClockRangePtr clockRanges;
279
int i;
280
DUMMYPtr dPtr;
281
int maxClock = 300000;
282
GDevPtr device = xf86GetEntityInfo(pScrn->entityList[0])->device;
283
284
if (flags & PROBE_DETECT)
285
return TRUE;
286
287
/* Allocate the DummyRec driverPrivate */
288
if (!DUMMYGetRec(pScrn)) {
289
return FALSE;
290
}
291
292
dPtr = DUMMYPTR(pScrn);
293
294
pScrn->chipset = (char *)xf86TokenToString(DUMMYChipsets,
295
DUMMY_CHIP);
296
297
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Chipset is a DUMMY\n");
298
299
pScrn->monitor = pScrn->confScreen->monitor;
300
301
if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb))
302
return FALSE;
303
else {
304
/* Check that the returned depth is one we support */
305
switch (pScrn->depth) {
306
case 8:
307
case 15:
308
case 16:
309
case 24:
310
break;
311
default:
312
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
313
"Given depth (%d) is not supported by this driver\n",
314
pScrn->depth);
315
return FALSE;
316
}
317
}
318
319
xf86PrintDepthBpp(pScrn);
320
if (pScrn->depth == 8)
321
pScrn->rgbBits = 8;
322
323
/* Get the depth24 pixmap format */
324
if (pScrn->depth == 24 && pix24bpp == 0)
325
pix24bpp = xf86GetBppFromDepth(pScrn, 24);
326
327
/*
328
* This must happen after pScrn->display has been set because
329
* xf86SetWeight references it.
330
*/
331
if (pScrn->depth > 8) {
332
/* The defaults are OK for us */
333
rgb zeros = {0, 0, 0};
334
335
if (!xf86SetWeight(pScrn, zeros, zeros)) {
336
return FALSE;
337
} else {
338
/* XXX check that weight returned is supported */
339
;
340
}
341
}
342
343
if (!xf86SetDefaultVisual(pScrn, -1))
344
return FALSE;
345
346
if (pScrn->depth > 1) {
347
Gamma zeros = {0.0, 0.0, 0.0};
348
349
if (!xf86SetGamma(pScrn, zeros))
350
return FALSE;
351
}
352
353
xf86CollectOptions(pScrn, device->options);
354
/* Process the options */
355
if (!(dPtr->Options = malloc(sizeof(DUMMYOptions))))
356
return FALSE;
357
memcpy(dPtr->Options, DUMMYOptions, sizeof(DUMMYOptions));
358
359
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, dPtr->Options);
360
361
xf86GetOptValBool(dPtr->Options, OPTION_SW_CURSOR,&dPtr->swCursor);
362
363
if (device->videoRam != 0) {
364
pScrn->videoRam = device->videoRam;
365
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "VideoRAM: %d kByte\n",
366
pScrn->videoRam);
367
} else {
368
pScrn->videoRam = 4096;
369
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "VideoRAM: %d kByte\n",
370
pScrn->videoRam);
371
}
372
373
if (device->dacSpeeds[0] != 0) {
374
maxClock = device->dacSpeeds[0];
375
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Max Clock: %d kHz\n",
376
maxClock);
377
} else {
378
xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Max Clock: %d kHz\n",
379
maxClock);
380
}
381
382
pScrn->progClock = TRUE;
383
/*
384
* Setup the ClockRanges, which describe what clock ranges are available,
385
* and what sort of modes they can be used for.
386
*/
387
clockRanges = (ClockRangePtr)xnfcalloc(sizeof(ClockRange), 1);
388
clockRanges->next = NULL;
389
clockRanges->ClockMulFactor = 1;
390
clockRanges->minClock = 11000; /* guessed ยงยงยง */
391
clockRanges->maxClock = maxClock;
392
clockRanges->clockIndex = -1; /* programmable */
393
clockRanges->interlaceAllowed = TRUE;
394
clockRanges->doubleScanAllowed = TRUE;
395
396
/* Subtract memory for HW cursor */
397
398
399
{
400
int apertureSize = (pScrn->videoRam * 1024);
401
i = xf86ValidateModes(pScrn, pScrn->monitor->Modes,
402
pScrn->display->modes, clockRanges,
403
NULL, 256, DUMMY_MAX_WIDTH,
404
(8 * pScrn->bitsPerPixel),
405
128, DUMMY_MAX_HEIGHT, pScrn->display->virtualX,
406
pScrn->display->virtualY, apertureSize,
407
LOOKUP_BEST_REFRESH);
408
409
if (i == -1)
410
RETURN;
411
}
412
413
/* Prune the modes marked as invalid */
414
xf86PruneDriverModes(pScrn);
415
416
if (i == 0 || pScrn->modes == NULL) {
417
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No valid modes found\n");
418
RETURN;
419
}
420
421
/*
422
* Set the CRTC parameters for all of the modes based on the type
423
* of mode, and the chipset's interlace requirements.
424
*
425
* Calling this is required if the mode->Crtc* values are used by the
426
* driver and if the driver doesn't provide code to set them. They
427
* are not pre-initialised at all.
428
*/
429
xf86SetCrtcForModes(pScrn, 0);
430
431
/* Set the current mode to the first in the list */
432
pScrn->currentMode = pScrn->modes;
433
434
/* Print the list of modes being used */
435
xf86PrintModes(pScrn);
436
437
/* If monitor resolution is set on the command line, use it */
438
xf86SetDpi(pScrn, 0, 0);
439
440
if (xf86LoadSubModule(pScrn, "fb") == NULL) {
441
RETURN;
442
}
443
444
if (!dPtr->swCursor) {
445
if (!xf86LoadSubModule(pScrn, "ramdac"))
446
RETURN;
447
}
448
449
/* We have no contiguous physical fb in physical memory */
450
pScrn->memPhysBase = 0;
451
pScrn->fbOffset = 0;
452
453
return TRUE;
454
}
455
#undef RETURN
456
457
/* Mandatory */
458
static Bool
459
DUMMYEnterVT(VT_FUNC_ARGS_DECL)
460
{
461
return TRUE;
462
}
463
464
/* Mandatory */
465
static void
466
DUMMYLeaveVT(VT_FUNC_ARGS_DECL)
467
{
468
}
469
470
static void
471
DUMMYLoadPalette(
472
ScrnInfoPtr pScrn,
473
int numColors,
474
int *indices,
475
LOCO *colors,
476
VisualPtr pVisual
477
){
478
int i, index, shift, Gshift;
479
DUMMYPtr dPtr = DUMMYPTR(pScrn);
480
481
switch(pScrn->depth) {
482
case 15:
483
shift = Gshift = 1;
484
break;
485
case 16:
486
shift = 0;
487
Gshift = 0;
488
break;
489
default:
490
shift = Gshift = 0;
491
break;
492
}
493
494
for(i = 0; i < numColors; i++) {
495
index = indices[i];
496
dPtr->colors[index].red = colors[index].red << shift;
497
dPtr->colors[index].green = colors[index].green << Gshift;
498
dPtr->colors[index].blue = colors[index].blue << shift;
499
}
500
501
}
502
503
static ScrnInfoPtr DUMMYScrn; /* static-globalize it */
504
505
/* Mandatory */
506
static Bool
507
DUMMYScreenInit(SCREEN_INIT_ARGS_DECL)
508
{
509
ScrnInfoPtr pScrn;
510
DUMMYPtr dPtr;
511
int ret;
512
VisualPtr visual;
513
514
/*
515
* we need to get the ScrnInfoRec for this screen, so let's allocate
516
* one first thing
517
*/
518
pScrn = xf86ScreenToScrn(pScreen);
519
dPtr = DUMMYPTR(pScrn);
520
DUMMYScrn = pScrn;
521
522
523
if (!(dPtr->FBBase = malloc(pScrn->videoRam * 1024)))
524
return FALSE;
525
526
/*
527
* Reset visual list.
528
*/
529
miClearVisualTypes();
530
531
/* Setup the visuals we support. */
532
533
if (!miSetVisualTypes(pScrn->depth,
534
miGetDefaultVisualMask(pScrn->depth),
535
pScrn->rgbBits, pScrn->defaultVisual))
536
return FALSE;
537
538
if (!miSetPixmapDepths ()) return FALSE;
539
540
/*
541
* Call the framebuffer layer's ScreenInit function, and fill in other
542
* pScreen fields.
543
*/
544
ret = fbScreenInit(pScreen, dPtr->FBBase,
545
pScrn->virtualX, pScrn->virtualY,
546
pScrn->xDpi, pScrn->yDpi,
547
pScrn->displayWidth, pScrn->bitsPerPixel);
548
if (!ret)
549
return FALSE;
550
551
if (pScrn->depth > 8) {
552
/* Fixup RGB ordering */
553
visual = pScreen->visuals + pScreen->numVisuals;
554
while (--visual >= pScreen->visuals) {
555
if ((visual->class | DynamicClass) == DirectColor) {
556
visual->offsetRed = pScrn->offset.red;
557
visual->offsetGreen = pScrn->offset.green;
558
visual->offsetBlue = pScrn->offset.blue;
559
visual->redMask = pScrn->mask.red;
560
visual->greenMask = pScrn->mask.green;
561
visual->blueMask = pScrn->mask.blue;
562
}
563
}
564
}
565
566
/* must be after RGB ordering fixed */
567
fbPictureInit(pScreen, 0, 0);
568
569
xf86SetBlackWhitePixels(pScreen);
570
571
#ifdef USE_DGA
572
DUMMYDGAInit(pScreen);
573
#endif
574
575
if (dPtr->swCursor)
576
xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using Software Cursor.\n");
577
578
{
579
580
581
BoxRec AvailFBArea;
582
int lines = pScrn->videoRam * 1024 /
583
(pScrn->displayWidth * (pScrn->bitsPerPixel >> 3));
584
AvailFBArea.x1 = 0;
585
AvailFBArea.y1 = 0;
586
AvailFBArea.x2 = pScrn->displayWidth;
587
AvailFBArea.y2 = lines;
588
xf86InitFBManager(pScreen, &AvailFBArea);
589
590
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
591
"Using %i scanlines of offscreen memory \n"
592
, lines - pScrn->virtualY);
593
}
594
595
xf86SetBackingStore(pScreen);
596
xf86SetSilkenMouse(pScreen);
597
598
/* Initialise cursor functions */
599
miDCInitialize (pScreen, xf86GetPointerScreenFuncs());
600
601
602
if (!dPtr->swCursor) {
603
/* HW cursor functions */
604
if (!DUMMYCursorInit(pScreen)) {
605
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
606
"Hardware cursor initialization failed\n");
607
return FALSE;
608
}
609
}
610
611
/* Initialise default colourmap */
612
if(!miCreateDefColormap(pScreen))
613
return FALSE;
614
615
if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits,
616
DUMMYLoadPalette, NULL,
617
CMAP_PALETTED_TRUECOLOR
618
| CMAP_RELOAD_ON_MODE_SWITCH))
619
return FALSE;
620
621
/* DUMMYInitVideo(pScreen); */
622
623
pScreen->SaveScreen = DUMMYSaveScreen;
624
625
626
/* Wrap the current CloseScreen function */
627
dPtr->CloseScreen = pScreen->CloseScreen;
628
pScreen->CloseScreen = DUMMYCloseScreen;
629
630
/* Wrap the current CreateWindow function */
631
dPtr->CreateWindow = pScreen->CreateWindow;
632
pScreen->CreateWindow = DUMMYCreateWindow;
633
634
/* Report any unused options (only for the first generation) */
635
if (serverGeneration == 1) {
636
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
637
}
638
639
return TRUE;
640
}
641
642
/* Mandatory */
643
Bool
644
DUMMYSwitchMode(SWITCH_MODE_ARGS_DECL)
645
{
646
return TRUE;
647
}
648
649
/* Mandatory */
650
void
651
DUMMYAdjustFrame(ADJUST_FRAME_ARGS_DECL)
652
{
653
}
654
655
/* Mandatory */
656
static Bool
657
DUMMYCloseScreen(CLOSE_SCREEN_ARGS_DECL)
658
{
659
ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
660
DUMMYPtr dPtr = DUMMYPTR(pScrn);
661
662
if(pScrn->vtSema){
663
free(dPtr->FBBase);
664
}
665
666
if (dPtr->CursorInfo)
667
xf86DestroyCursorInfoRec(dPtr->CursorInfo);
668
669
pScrn->vtSema = FALSE;
670
pScreen->CloseScreen = dPtr->CloseScreen;
671
return (*pScreen->CloseScreen)(CLOSE_SCREEN_ARGS);
672
}
673
674
/* Optional */
675
static void
676
DUMMYFreeScreen(FREE_SCREEN_ARGS_DECL)
677
{
678
SCRN_INFO_PTR(arg);
679
DUMMYFreeRec(pScrn);
680
}
681
682
static Bool
683
DUMMYSaveScreen(ScreenPtr pScreen, int mode)
684
{
685
ScrnInfoPtr pScrn = NULL;
686
DUMMYPtr dPtr;
687
688
if (pScreen != NULL) {
689
pScrn = xf86ScreenToScrn(pScreen);
690
dPtr = DUMMYPTR(pScrn);
691
692
dPtr->screenSaver = xf86IsUnblank(mode);
693
}
694
return TRUE;
695
}
696
697
/* Optional */
698
static ModeStatus
699
DUMMYValidMode(SCRN_ARG_TYPE arg, DisplayModePtr mode, Bool verbose, int flags)
700
{
701
return(MODE_OK);
702
}
703
704
Atom VFB_PROP = 0;
705
#define VFB_PROP_NAME "VFB_IDENT"
706
707
static Bool
708
DUMMYCreateWindow(WindowPtr pWin)
709
{
710
ScreenPtr pScreen = pWin->drawable.pScreen;
711
DUMMYPtr dPtr = DUMMYPTR(DUMMYScrn);
712
WindowPtr pWinRoot;
713
int ret;
714
715
pScreen->CreateWindow = dPtr->CreateWindow;
716
ret = pScreen->CreateWindow(pWin);
717
dPtr->CreateWindow = pScreen->CreateWindow;
718
pScreen->CreateWindow = DUMMYCreateWindow;
719
720
if(ret != TRUE)
721
return(ret);
722
723
if(dPtr->prop == FALSE) {
724
#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 8
725
pWinRoot = WindowTable[DUMMYScrn->pScreen->myNum];
726
#else
727
pWinRoot = DUMMYScrn->pScreen->root;
728
#endif
729
if (! ValidAtom(VFB_PROP))
730
VFB_PROP = MakeAtom(VFB_PROP_NAME, strlen(VFB_PROP_NAME), 1);
731
732
ret = dixChangeWindowProperty(serverClient, pWinRoot, VFB_PROP,
733
XA_STRING, 8, PropModeReplace,
734
(int)4, (pointer)"TRUE", FALSE);
735
if( ret != Success)
736
ErrorF("Could not set VFB root window property");
737
dPtr->prop = TRUE;
738
739
return TRUE;
740
}
741
return TRUE;
742
}
743
744
#ifndef HW_SKIP_CONSOLE
745
#define HW_SKIP_CONSOLE 4
746
#endif
747
748
static Bool
749
dummyDriverFunc(ScrnInfoPtr pScrn, xorgDriverFuncOp op, pointer ptr)
750
{
751
CARD32 *flag;
752
753
switch (op) {
754
case GET_REQUIRED_HW_INTERFACES:
755
flag = (CARD32*)ptr;
756
(*flag) = HW_SKIP_CONSOLE;
757
return TRUE;
758
default:
759
return FALSE;
760
}
761
}
762
763