1 /*****************************************************************************\
2 * Tseng Labs ET6000, ET6100 and ET6300 graphics driver for BeOS 5.
3 * Copyright (c) 2003-2004, Evgeniy Vladimirovich Bobkov.
4 \*****************************************************************************/
6 #include "GlobalData.h"
11 /*****************************************************************************/
13 * The code to actually configure the display.
15 static status_t
doSetDisplayMode(display_mode
*dm
) {
16 ET6000DisplayMode mode
;
18 mode
.magic
= ET6000_PRIVATE_DATA_MAGIC
;
20 mode
.pciConfigSpace
= si
->pciConfigSpace
;
22 return ioctl(fd
, ET6000_SET_DISPLAY_MODE
, &mode
, sizeof(mode
));
24 /*****************************************************************************/
26 * The exported mode setting routine. First validate the mode,
27 * then call our private routine to hammer the registers.
29 status_t
SET_DISPLAY_MODE(display_mode
*mode_to_set
) {
30 display_mode bounds
, target
;
34 /* ask for the specific mode */
35 target
= bounds
= *mode_to_set
;
36 if (PROPOSE_DISPLAY_MODE(&target
, &bounds
, &bounds
) != B_OK
) /* ==B_ERROR???/// */
39 result
= doSetDisplayMode(&target
);
42 switch (target
.space
) {
56 si
->fbc
.bytes_per_row
= target
.virtual_width
* bpp
;
58 si
->bytesPerPixel
= bpp
;
64 /*****************************************************************************/