2008-05-28 14:33:07 +02:00
|
|
|
/*
|
|
|
|
* Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
|
2011-09-29 13:34:17 +02:00
|
|
|
* Copyright 2011 Dave Airlie
|
2008-05-28 14:33:07 +02:00
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
|
|
* copy of this software and associated documentation files (the
|
|
|
|
* "Software"), to deal in the Software without restriction, including
|
|
|
|
* without limitation the rights to use, copy, modify, merge, publish,
|
|
|
|
* distribute, sub license, and/or sell copies of the Software, and to
|
|
|
|
* permit persons to whom the Software is furnished to do so, subject to
|
|
|
|
* the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice (including the
|
|
|
|
* next paragraph) shall be included in all copies or substantial portions
|
|
|
|
* of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
|
|
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
|
|
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
|
|
* IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
|
|
|
|
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
|
|
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
*
|
2011-09-29 13:34:17 +02:00
|
|
|
* Original Author: Alan Hourihane <alanh@tungstengraphics.com>
|
|
|
|
* Rewrite: Dave Airlie <airlied@redhat.com>
|
2008-05-28 14:33:07 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
2011-09-29 15:13:58 +02:00
|
|
|
#include <unistd.h>
|
2011-09-29 13:28:59 +02:00
|
|
|
#include <fcntl.h>
|
2008-05-28 14:33:07 +02:00
|
|
|
#include "xf86.h"
|
|
|
|
#include "xf86_OSproc.h"
|
|
|
|
#include "compiler.h"
|
|
|
|
#include "xf86PciInfo.h"
|
|
|
|
#include "xf86Pci.h"
|
|
|
|
#include "mipointer.h"
|
|
|
|
#include "micmap.h"
|
|
|
|
#include <X11/extensions/randr.h>
|
|
|
|
#include "fb.h"
|
|
|
|
#include "edid.h"
|
|
|
|
#include "xf86i2c.h"
|
|
|
|
#include "xf86Crtc.h"
|
|
|
|
#include "miscstruct.h"
|
|
|
|
#include "dixstruct.h"
|
2011-09-29 16:55:36 +02:00
|
|
|
#include "shadow.h"
|
2008-05-28 14:33:07 +02:00
|
|
|
#include "xf86xv.h"
|
|
|
|
#include <X11/extensions/Xv.h>
|
|
|
|
#include <xorg-server.h>
|
|
|
|
#if XSERVER_LIBPCIACCESS
|
|
|
|
#include <pciaccess.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "driver.h"
|
|
|
|
|
|
|
|
static void AdjustFrame(int scrnIndex, int x, int y, int flags);
|
|
|
|
static Bool CloseScreen(int scrnIndex, ScreenPtr pScreen);
|
|
|
|
static Bool EnterVT(int scrnIndex, int flags);
|
|
|
|
static void Identify(int flags);
|
|
|
|
static const OptionInfoRec *AvailableOptions(int chipid, int busid);
|
2008-05-28 16:55:36 +02:00
|
|
|
static ModeStatus ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose,
|
|
|
|
int flags);
|
2008-05-28 14:33:07 +02:00
|
|
|
static void FreeScreen(int scrnIndex, int flags);
|
|
|
|
static void LeaveVT(int scrnIndex, int flags);
|
|
|
|
static Bool SwitchMode(int scrnIndex, DisplayModePtr mode, int flags);
|
2008-05-28 16:55:36 +02:00
|
|
|
static Bool ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc,
|
|
|
|
char **argv);
|
2008-05-28 14:33:07 +02:00
|
|
|
static Bool PreInit(ScrnInfoPtr pScrn, int flags);
|
2008-05-28 16:55:36 +02:00
|
|
|
|
2008-05-28 14:33:07 +02:00
|
|
|
static Bool Probe(DriverPtr drv, int flags);
|
2011-09-29 13:28:59 +02:00
|
|
|
static Bool ms_pci_probe(DriverPtr driver,
|
|
|
|
int entity_num, struct pci_device *device,
|
|
|
|
intptr_t match_data);
|
|
|
|
|
|
|
|
#ifdef XSERVER_LIBPCIACCESS
|
|
|
|
static const struct pci_id_match ms_device_match[] = {
|
|
|
|
{
|
|
|
|
PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY, PCI_MATCH_ANY,
|
|
|
|
0x00030000, 0x00ffffff, 0
|
|
|
|
},
|
|
|
|
|
|
|
|
{ 0, 0, 0 },
|
2008-05-28 14:33:07 +02:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
_X_EXPORT DriverRec modesetting = {
|
2008-05-28 16:55:36 +02:00
|
|
|
1,
|
|
|
|
"modesetting",
|
|
|
|
Identify,
|
|
|
|
Probe,
|
|
|
|
AvailableOptions,
|
|
|
|
NULL,
|
|
|
|
0,
|
|
|
|
NULL,
|
2011-09-29 13:28:59 +02:00
|
|
|
ms_device_match,
|
|
|
|
ms_pci_probe,
|
2008-05-28 14:33:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
static SymTabRec Chipsets[] = {
|
2011-09-29 13:28:59 +02:00
|
|
|
{0, "kms" },
|
2008-05-28 16:55:36 +02:00
|
|
|
{-1, NULL}
|
2008-05-28 14:33:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
OPTION_SW_CURSOR,
|
2011-09-29 13:28:59 +02:00
|
|
|
OPTION_DEVICE_PATH,
|
2011-09-29 16:55:36 +02:00
|
|
|
OPTION_SHADOW_FB,
|
2008-05-28 14:33:07 +02:00
|
|
|
} modesettingOpts;
|
|
|
|
|
|
|
|
static const OptionInfoRec Options[] = {
|
2008-05-28 16:55:36 +02:00
|
|
|
{OPTION_SW_CURSOR, "SWcursor", OPTV_BOOLEAN, {0}, FALSE},
|
2011-09-29 13:28:59 +02:00
|
|
|
{OPTION_DEVICE_PATH, "kmsdev", OPTV_STRING, {0}, FALSE },
|
2011-09-29 16:55:36 +02:00
|
|
|
{OPTION_SHADOW_FB, "ShadowFB", OPTV_BOOLEAN, {0}, FALSE },
|
2008-05-28 16:55:36 +02:00
|
|
|
{-1, NULL, OPTV_NONE, {0}, FALSE}
|
2008-05-28 14:33:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
int modesettingEntityIndex = -1;
|
|
|
|
|
|
|
|
static MODULESETUPPROTO(Setup);
|
|
|
|
|
|
|
|
static XF86ModuleVersionInfo VersRec = {
|
2008-05-28 16:55:36 +02:00
|
|
|
"modesetting",
|
|
|
|
MODULEVENDORSTRING,
|
|
|
|
MODINFOSTRING1,
|
|
|
|
MODINFOSTRING2,
|
|
|
|
XORG_VERSION_CURRENT,
|
|
|
|
PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
|
|
|
|
ABI_CLASS_VIDEODRV,
|
|
|
|
ABI_VIDEODRV_VERSION,
|
|
|
|
MOD_CLASS_VIDEODRV,
|
|
|
|
{0, 0, 0, 0}
|
2008-05-28 14:33:07 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
_X_EXPORT XF86ModuleData modesettingModuleData = { &VersRec, Setup, NULL };
|
|
|
|
|
|
|
|
static pointer
|
|
|
|
Setup(pointer module, pointer opts, int *errmaj, int *errmin)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
static Bool setupDone = 0;
|
|
|
|
|
|
|
|
/* This module should be loaded only once, but check to be sure.
|
|
|
|
*/
|
|
|
|
if (!setupDone) {
|
|
|
|
setupDone = 1;
|
|
|
|
xf86AddDriver(&modesetting, module, HaveDriverFuncs);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* The return value must be non-NULL on success even though there
|
|
|
|
* is no TearDownProc.
|
|
|
|
*/
|
|
|
|
return (pointer) 1;
|
|
|
|
} else {
|
|
|
|
if (errmaj)
|
|
|
|
*errmaj = LDR_ONCEONLY;
|
|
|
|
return NULL;
|
|
|
|
}
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
Identify(int flags)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
xf86PrintChipsets("modesetting", "Driver for Modesetting Kernel Drivers",
|
|
|
|
Chipsets);
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
2011-09-29 13:28:59 +02:00
|
|
|
static Bool probe_hw(char *dev)
|
|
|
|
{
|
|
|
|
int fd;
|
|
|
|
if (dev)
|
|
|
|
fd = open(dev, O_RDWR, 0);
|
|
|
|
else {
|
|
|
|
dev = getenv("KMSDEVICE");
|
|
|
|
if ((NULL == dev) || ((fd = open(dev, O_RDWR, 0)) == -1)) {
|
|
|
|
dev = "/dev/dri/card0";
|
|
|
|
fd = open(dev,O_RDWR, 0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (fd == -1) {
|
|
|
|
xf86DrvMsg(-1, X_ERROR,"open %s: %s\n", dev, strerror(errno));
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
close(fd);
|
|
|
|
return TRUE;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2008-05-28 14:33:07 +02:00
|
|
|
static const OptionInfoRec *
|
|
|
|
AvailableOptions(int chipid, int busid)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
return Options;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#if XSERVER_LIBPCIACCESS
|
|
|
|
static Bool
|
2011-09-29 13:28:59 +02:00
|
|
|
ms_pci_probe(DriverPtr driver,
|
|
|
|
int entity_num, struct pci_device *dev, intptr_t match_data)
|
2008-05-28 14:33:07 +02:00
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
ScrnInfoPtr scrn = NULL;
|
|
|
|
|
2011-09-29 13:28:59 +02:00
|
|
|
scrn = xf86ConfigPciEntity(scrn, 0, entity_num, NULL,
|
2008-05-28 16:55:36 +02:00
|
|
|
NULL, NULL, NULL, NULL, NULL);
|
2011-09-29 13:28:59 +02:00
|
|
|
if (scrn) {
|
|
|
|
char *devpath;
|
|
|
|
GDevPtr devSection = xf86GetDevFromEntity(scrn->entityList[0],
|
|
|
|
scrn->entityInstanceList[0]);
|
|
|
|
|
|
|
|
devpath = xf86FindOptionValue(devSection->options, "kmsdev");
|
|
|
|
if (probe_hw(devpath)) {
|
|
|
|
scrn->driverVersion = 1;
|
|
|
|
scrn->driverName = "modesetting";
|
|
|
|
scrn->name = "modeset";
|
|
|
|
scrn->Probe = NULL;
|
2008-05-28 16:55:36 +02:00
|
|
|
scrn->PreInit = PreInit;
|
|
|
|
scrn->ScreenInit = ScreenInit;
|
|
|
|
scrn->SwitchMode = SwitchMode;
|
|
|
|
scrn->AdjustFrame = AdjustFrame;
|
|
|
|
scrn->EnterVT = EnterVT;
|
|
|
|
scrn->LeaveVT = LeaveVT;
|
|
|
|
scrn->FreeScreen = FreeScreen;
|
|
|
|
scrn->ValidMode = ValidMode;
|
2011-09-29 13:28:59 +02:00
|
|
|
|
|
|
|
xf86DrvMsg(scrn->scrnIndex, X_CONFIG,
|
|
|
|
"claimed PCI slot %d@%d:%d:%d\n",
|
|
|
|
dev->bus, dev->domain, dev->dev, dev->func);
|
|
|
|
xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
|
|
|
"using %s\n", devpath ? devpath : "default device");
|
|
|
|
} else
|
|
|
|
scrn = NULL;
|
2008-05-28 16:55:36 +02:00
|
|
|
}
|
|
|
|
return scrn != NULL;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
2011-09-29 13:28:59 +02:00
|
|
|
#endif
|
|
|
|
|
2008-05-28 14:33:07 +02:00
|
|
|
static Bool
|
|
|
|
Probe(DriverPtr drv, int flags)
|
|
|
|
{
|
2011-09-29 15:13:58 +02:00
|
|
|
int i, numDevSections;
|
2008-05-28 16:55:36 +02:00
|
|
|
GDevPtr *devSections;
|
|
|
|
Bool foundScreen = FALSE;
|
2011-09-29 13:28:59 +02:00
|
|
|
char *dev;
|
2011-09-29 15:13:58 +02:00
|
|
|
ScrnInfoPtr scrn = NULL;
|
2011-09-29 13:28:59 +02:00
|
|
|
|
|
|
|
/* For now, just bail out for PROBE_DETECT. */
|
|
|
|
if (flags & PROBE_DETECT)
|
|
|
|
return FALSE;
|
2008-05-28 16:55:36 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Find the config file Device sections that match this
|
|
|
|
* driver, and return if there are none.
|
|
|
|
*/
|
|
|
|
if ((numDevSections = xf86MatchDevice("modesetting", &devSections)) <= 0) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-09-29 13:28:59 +02:00
|
|
|
for (i = 0; i < numDevSections; i++) {
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 13:28:59 +02:00
|
|
|
dev = xf86FindOptionValue(devSections[i]->options,"kmsdev");
|
|
|
|
if (devSections[i]->busID) {
|
|
|
|
if (probe_hw(dev)) {
|
|
|
|
int entity;
|
|
|
|
entity = xf86ClaimFbSlot(drv, 0, devSections[i], TRUE);
|
|
|
|
scrn = xf86ConfigFbEntity(scrn, 0, entity,
|
2011-09-29 15:13:58 +02:00
|
|
|
NULL, NULL, NULL, NULL);
|
2008-05-28 16:55:36 +02:00
|
|
|
}
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 13:28:59 +02:00
|
|
|
if (scrn)
|
2008-05-28 16:55:36 +02:00
|
|
|
foundScreen = TRUE;
|
2011-09-29 13:28:59 +02:00
|
|
|
scrn->driverVersion = 1;
|
|
|
|
scrn->driverName = "modesetting";
|
|
|
|
scrn->name = "modesetting";
|
|
|
|
scrn->Probe = Probe;
|
|
|
|
scrn->PreInit = PreInit;
|
|
|
|
scrn->ScreenInit = ScreenInit;
|
|
|
|
scrn->SwitchMode = SwitchMode;
|
|
|
|
scrn->AdjustFrame = AdjustFrame;
|
|
|
|
scrn->EnterVT = EnterVT;
|
|
|
|
scrn->LeaveVT = LeaveVT;
|
|
|
|
scrn->FreeScreen = FreeScreen;
|
|
|
|
scrn->ValidMode = ValidMode;
|
|
|
|
|
|
|
|
xf86DrvMsg(scrn->scrnIndex, X_INFO,
|
|
|
|
"using %s\n", dev ? dev : "default device");
|
2008-05-28 16:55:36 +02:00
|
|
|
}
|
|
|
|
}
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 12:49:26 +02:00
|
|
|
free(devSections);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
return foundScreen;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
GetRec(ScrnInfoPtr pScrn)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
if (pScrn->driverPrivate)
|
|
|
|
return TRUE;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
pScrn->driverPrivate = xnfcalloc(sizeof(modesettingRec), 1);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
return TRUE;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
2011-09-29 13:38:26 +02:00
|
|
|
static void dispatch_dirty(ScreenPtr pScreen)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
|
|
|
|
modesettingPtr ms = modesettingPTR(scrn);
|
|
|
|
RegionPtr dirty = DamageRegion(ms->damage);
|
|
|
|
unsigned num_cliprects = REGION_NUM_RECTS(dirty);
|
|
|
|
|
|
|
|
if (num_cliprects) {
|
|
|
|
drmModeClip *clip = alloca(num_cliprects * sizeof(drmModeClip));
|
|
|
|
BoxPtr rect = REGION_RECTS(dirty);
|
|
|
|
int i, ret;
|
|
|
|
|
|
|
|
/* XXX no need for copy? */
|
|
|
|
for (i = 0; i < num_cliprects; i++, rect++) {
|
|
|
|
clip[i].x1 = rect->x1;
|
|
|
|
clip[i].y1 = rect->y1;
|
|
|
|
clip[i].x2 = rect->x2;
|
|
|
|
clip[i].y2 = rect->y2;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* TODO query connector property to see if this is needed */
|
|
|
|
ret = drmModeDirtyFB(ms->fd, ms->fb_id, clip, num_cliprects);
|
|
|
|
if (ret) {
|
|
|
|
if (ret == -EINVAL) {
|
|
|
|
ms->dirty_enabled = FALSE;
|
|
|
|
DamageUnregister(&pScreen->GetScreenPixmap(pScreen)->drawable, ms->damage);
|
|
|
|
DamageDestroy(ms->damage);
|
|
|
|
ms->damage = NULL;
|
|
|
|
xf86DrvMsg(scrn->scrnIndex, X_INFO, "Disabling kernel dirty updates, not required.\n");
|
|
|
|
return;
|
|
|
|
} else
|
|
|
|
ErrorF("%s: failed to send dirty (%i, %s)\n",
|
|
|
|
__func__, ret, strerror(-ret));
|
|
|
|
}
|
|
|
|
|
|
|
|
DamageEmpty(ms->damage);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void msBlockHandler(int i, pointer blockData, pointer pTimeout,
|
|
|
|
pointer pReadmask)
|
|
|
|
{
|
|
|
|
ScreenPtr pScreen = screenInfo.screens[i];
|
|
|
|
modesettingPtr ms = modesettingPTR(xf86Screens[pScreen->myNum]);
|
|
|
|
|
|
|
|
pScreen->BlockHandler = ms->BlockHandler;
|
|
|
|
pScreen->BlockHandler(i, blockData, pTimeout, pReadmask);
|
|
|
|
pScreen->BlockHandler = msBlockHandler;
|
|
|
|
if (ms->dirty_enabled)
|
|
|
|
dispatch_dirty(pScreen);
|
|
|
|
}
|
|
|
|
|
2008-05-28 14:33:07 +02:00
|
|
|
static void
|
|
|
|
FreeRec(ScrnInfoPtr pScrn)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
if (!pScrn)
|
|
|
|
return;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
if (!pScrn->driverPrivate)
|
|
|
|
return;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 12:49:26 +02:00
|
|
|
free(pScrn->driverPrivate);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
pScrn->driverPrivate = NULL;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
PreInit(ScrnInfoPtr pScrn, int flags)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
modesettingPtr ms;
|
|
|
|
rgb defaultWeight = { 0, 0, 0 };
|
|
|
|
EntityInfoPtr pEnt;
|
|
|
|
EntPtr msEnt = NULL;
|
|
|
|
char *BusID;
|
|
|
|
|
|
|
|
if (pScrn->numEntities != 1)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
pEnt = xf86GetEntityInfo(pScrn->entityList[0]);
|
|
|
|
|
|
|
|
if (flags & PROBE_DETECT) {
|
2011-09-29 12:49:26 +02:00
|
|
|
return FALSE;
|
2008-05-28 16:55:36 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Allocate driverPrivate */
|
|
|
|
if (!GetRec(pScrn))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
ms = modesettingPTR(pScrn);
|
|
|
|
ms->SaveGeneration = -1;
|
|
|
|
ms->pEnt = pEnt;
|
|
|
|
|
|
|
|
pScrn->displayWidth = 640; /* default it */
|
|
|
|
|
|
|
|
if (ms->pEnt->location.type != BUS_PCI)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
ms->PciInfo = xf86GetPciInfoForEntity(ms->pEnt->index);
|
|
|
|
|
|
|
|
/* Allocate an entity private if necessary */
|
|
|
|
if (xf86IsEntityShared(pScrn->entityList[0])) {
|
|
|
|
msEnt = xf86GetEntityPrivate(pScrn->entityList[0],
|
|
|
|
modesettingEntityIndex)->ptr;
|
|
|
|
ms->entityPrivate = msEnt;
|
|
|
|
} else
|
|
|
|
ms->entityPrivate = NULL;
|
|
|
|
|
|
|
|
if (xf86IsEntityShared(pScrn->entityList[0])) {
|
|
|
|
if (xf86IsPrimInitDone(pScrn->entityList[0])) {
|
|
|
|
/* do something */
|
|
|
|
} else {
|
|
|
|
xf86SetPrimInitDone(pScrn->entityList[0]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-09-29 12:49:26 +02:00
|
|
|
BusID = malloc(64);
|
2008-05-28 16:55:36 +02:00
|
|
|
sprintf(BusID, "PCI:%d:%d:%d",
|
2008-05-28 14:33:07 +02:00
|
|
|
#if XSERVER_LIBPCIACCESS
|
2008-05-28 16:55:36 +02:00
|
|
|
((ms->PciInfo->domain << 8) | ms->PciInfo->bus),
|
|
|
|
ms->PciInfo->dev, ms->PciInfo->func
|
2008-05-28 14:33:07 +02:00
|
|
|
#else
|
2008-05-28 16:55:36 +02:00
|
|
|
((pciConfigPtr) ms->PciInfo->thisCard)->busnum,
|
|
|
|
((pciConfigPtr) ms->PciInfo->thisCard)->devnum,
|
|
|
|
((pciConfigPtr) ms->PciInfo->thisCard)->funcnum
|
2008-05-28 14:33:07 +02:00
|
|
|
#endif
|
2008-05-28 16:55:36 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
ms->fd = drmOpen(NULL, BusID);
|
|
|
|
if (ms->fd < 0)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
pScrn->monitor = pScrn->confScreen->monitor;
|
|
|
|
pScrn->progClock = TRUE;
|
|
|
|
pScrn->rgbBits = 8;
|
|
|
|
|
2008-06-26 23:27:44 +02:00
|
|
|
if (!xf86SetDepthBpp
|
|
|
|
(pScrn, 0, 0, 0,
|
|
|
|
PreferConvert24to32 | SupportConvert24to32 | Support32bppFb))
|
2008-05-28 16:55:36 +02:00
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
switch (pScrn->depth) {
|
|
|
|
case 15:
|
|
|
|
case 16:
|
|
|
|
case 24:
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
|
|
|
"Given depth (%d) is not supported by the driver\n",
|
|
|
|
pScrn->depth);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
xf86PrintDepthBpp(pScrn);
|
|
|
|
|
|
|
|
if (!xf86SetWeight(pScrn, defaultWeight, defaultWeight))
|
|
|
|
return FALSE;
|
|
|
|
if (!xf86SetDefaultVisual(pScrn, -1))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
/* Process the options */
|
|
|
|
xf86CollectOptions(pScrn, NULL);
|
2011-09-29 12:49:26 +02:00
|
|
|
if (!(ms->Options = malloc(sizeof(Options))))
|
2008-05-28 16:55:36 +02:00
|
|
|
return FALSE;
|
|
|
|
memcpy(ms->Options, Options, sizeof(Options));
|
|
|
|
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, ms->Options);
|
|
|
|
|
|
|
|
if (xf86ReturnOptValBool(ms->Options, OPTION_SW_CURSOR, FALSE)) {
|
|
|
|
ms->SWCursor = TRUE;
|
|
|
|
}
|
|
|
|
|
2011-09-29 16:55:36 +02:00
|
|
|
ms->shadow_enable = xf86ReturnOptValBool(ms->Options, OPTION_SHADOW_FB, TRUE);
|
|
|
|
|
2011-09-29 12:49:26 +02:00
|
|
|
ms->drmmode.fd = ms->fd;
|
|
|
|
if (drmmode_pre_init(pScrn, &ms->drmmode, pScrn->bitsPerPixel / 8) == FALSE) {
|
|
|
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "KMS setup failed\n");
|
|
|
|
goto fail;
|
2008-05-28 16:55:36 +02:00
|
|
|
}
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
/*
|
|
|
|
* If the driver can do gamma correction, it should call xf86SetGamma() here.
|
|
|
|
*/
|
|
|
|
{
|
|
|
|
Gamma zeros = { 0.0, 0.0, 0.0 };
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
if (!xf86SetGamma(pScrn, zeros)) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
if (pScrn->modes == NULL) {
|
|
|
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "No modes.\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
pScrn->currentMode = pScrn->modes;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
/* Set display resolution */
|
|
|
|
xf86SetDpi(pScrn, 0, 0);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
/* Load the required sub modules */
|
|
|
|
if (!xf86LoadSubModule(pScrn, "fb")) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 16:55:36 +02:00
|
|
|
if (ms->shadow_enable) {
|
|
|
|
if (!xf86LoadSubModule(pScrn, "shadow")) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
return TRUE;
|
2011-09-29 12:49:26 +02:00
|
|
|
fail:
|
|
|
|
return FALSE;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
2011-09-29 16:55:36 +02:00
|
|
|
static void *
|
|
|
|
msShadowWindow(ScreenPtr screen, CARD32 row, CARD32 offset, int mode,
|
|
|
|
CARD32 *size, void *closure)
|
|
|
|
{
|
|
|
|
ScrnInfoPtr pScrn = xf86Screens[screen->myNum];
|
|
|
|
modesettingPtr ms = modesettingPTR(pScrn);
|
|
|
|
int stride;
|
|
|
|
|
|
|
|
stride = (pScrn->displayWidth * pScrn->bitsPerPixel) / 8;
|
|
|
|
*size = stride;
|
|
|
|
|
|
|
|
return ((uint8_t *)ms->drmmode.front_bo->ptr + row * stride + offset);
|
|
|
|
}
|
|
|
|
|
2008-05-28 14:33:07 +02:00
|
|
|
static Bool
|
|
|
|
CreateScreenResources(ScreenPtr pScreen)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
|
|
|
modesettingPtr ms = modesettingPTR(pScrn);
|
2008-06-26 23:27:44 +02:00
|
|
|
PixmapPtr rootPixmap;
|
2008-05-28 16:55:36 +02:00
|
|
|
Bool ret;
|
2011-09-29 12:49:26 +02:00
|
|
|
void *pixels;
|
2008-05-28 16:55:36 +02:00
|
|
|
pScreen->CreateScreenResources = ms->createScreenResources;
|
|
|
|
ret = pScreen->CreateScreenResources(pScreen);
|
|
|
|
pScreen->CreateScreenResources = CreateScreenResources;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 12:49:26 +02:00
|
|
|
if (!drmmode_set_desired_modes(pScrn, &ms->drmmode))
|
|
|
|
return FALSE;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 12:49:26 +02:00
|
|
|
drmmode_uevent_init(pScrn, &ms->drmmode);
|
2008-06-16 16:07:39 +02:00
|
|
|
|
2011-09-29 12:49:26 +02:00
|
|
|
drmmode_map_cursor_bos(pScrn, &ms->drmmode);
|
|
|
|
pixels = drmmode_map_front_bo(&ms->drmmode);
|
|
|
|
if (!pixels)
|
|
|
|
return FALSE;
|
2008-06-26 23:27:44 +02:00
|
|
|
|
2011-09-29 12:49:26 +02:00
|
|
|
rootPixmap = pScreen->GetScreenPixmap(pScreen);
|
2011-09-29 16:55:36 +02:00
|
|
|
|
|
|
|
if (ms->shadow_enable)
|
|
|
|
pixels = ms->shadow_fb;
|
|
|
|
|
2011-09-29 12:49:26 +02:00
|
|
|
if (!pScreen->ModifyPixmapHeader(rootPixmap, -1, -1, -1, -1, -1, pixels))
|
|
|
|
FatalError("Couldn't adjust screen pixmap\n");
|
2008-06-16 16:07:39 +02:00
|
|
|
|
2011-09-29 16:55:36 +02:00
|
|
|
if (ms->shadow_enable) {
|
|
|
|
if (!shadowAdd(pScreen, rootPixmap, shadowUpdatePackedWeak(),
|
|
|
|
msShadowWindow, 0, 0))
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2011-09-29 13:38:26 +02:00
|
|
|
ms->damage = DamageCreate(NULL, NULL, DamageReportNone, TRUE,
|
|
|
|
pScreen, rootPixmap);
|
|
|
|
|
|
|
|
if (ms->damage) {
|
|
|
|
DamageRegister(&rootPixmap->drawable, ms->damage);
|
|
|
|
ms->dirty_enabled = TRUE;
|
|
|
|
xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Damage tracking initialized\n");
|
|
|
|
} else {
|
|
|
|
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
|
|
|
|
"Failed to create screen damage record\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
2008-05-28 16:55:36 +02:00
|
|
|
return ret;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
2011-09-29 16:55:36 +02:00
|
|
|
static Bool
|
|
|
|
msShadowInit(ScreenPtr pScreen)
|
|
|
|
{
|
|
|
|
if (!shadowSetup(pScreen)) {
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
2008-05-28 14:33:07 +02:00
|
|
|
static Bool
|
|
|
|
ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
|
|
|
|
modesettingPtr ms = modesettingPTR(pScrn);
|
|
|
|
VisualPtr visual;
|
2011-09-29 15:05:43 +02:00
|
|
|
int ret;
|
2008-05-28 16:55:36 +02:00
|
|
|
|
2008-06-16 16:07:39 +02:00
|
|
|
pScrn->pScreen = pScreen;
|
|
|
|
|
2011-09-29 15:05:43 +02:00
|
|
|
ret = drmSetMaster(ms->fd);
|
|
|
|
if (ret) {
|
|
|
|
ErrorF("Unable to set master\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2008-06-26 23:27:44 +02:00
|
|
|
/* HW dependent - FIXME */
|
|
|
|
pScrn->displayWidth = pScrn->virtualX;
|
2011-09-29 12:49:26 +02:00
|
|
|
if (!drmmode_create_initial_bos(pScrn, &ms->drmmode))
|
|
|
|
return FALSE;
|
2008-05-28 16:55:36 +02:00
|
|
|
|
2011-09-29 16:55:36 +02:00
|
|
|
if (ms->shadow_enable) {
|
|
|
|
ms->shadow_fb = calloc(1, pScrn->displayWidth * pScrn->virtualY *
|
|
|
|
((pScrn->bitsPerPixel + 7) >> 3));
|
|
|
|
if (!ms->shadow_fb)
|
|
|
|
ms->shadow_enable = FALSE;
|
|
|
|
}
|
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
miClearVisualTypes();
|
|
|
|
|
|
|
|
if (!miSetVisualTypes(pScrn->depth,
|
|
|
|
miGetDefaultVisualMask(pScrn->depth),
|
|
|
|
pScrn->rgbBits, pScrn->defaultVisual))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (!miSetPixmapDepths())
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
pScrn->memPhysBase = 0;
|
|
|
|
pScrn->fbOffset = 0;
|
|
|
|
|
2008-06-26 23:27:44 +02:00
|
|
|
if (!fbScreenInit(pScreen, NULL,
|
2008-05-28 16:55:36 +02:00
|
|
|
pScrn->virtualX, pScrn->virtualY,
|
|
|
|
pScrn->xDpi, pScrn->yDpi,
|
|
|
|
pScrn->displayWidth, pScrn->bitsPerPixel))
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (pScrn->bitsPerPixel > 8) {
|
|
|
|
/* Fixup RGB ordering */
|
|
|
|
visual = pScreen->visuals + pScreen->numVisuals;
|
|
|
|
while (--visual >= pScreen->visuals) {
|
|
|
|
if ((visual->class | DynamicClass) == DirectColor) {
|
|
|
|
visual->offsetRed = pScrn->offset.red;
|
|
|
|
visual->offsetGreen = pScrn->offset.green;
|
|
|
|
visual->offsetBlue = pScrn->offset.blue;
|
|
|
|
visual->redMask = pScrn->mask.red;
|
|
|
|
visual->greenMask = pScrn->mask.green;
|
|
|
|
visual->blueMask = pScrn->mask.blue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fbPictureInit(pScreen, NULL, 0);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 16:55:36 +02:00
|
|
|
if (ms->shadow_enable && !msShadowInit(pScreen)) {
|
|
|
|
xf86DrvMsg(scrnIndex, X_ERROR,
|
|
|
|
"shadow fb init failed\n");
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
2008-06-16 16:07:39 +02:00
|
|
|
ms->createScreenResources = pScreen->CreateScreenResources;
|
|
|
|
pScreen->CreateScreenResources = CreateScreenResources;
|
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
xf86SetBlackWhitePixels(pScreen);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
miInitializeBackingStore(pScreen);
|
|
|
|
xf86SetBackingStore(pScreen);
|
|
|
|
xf86SetSilkenMouse(pScreen);
|
|
|
|
miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-06-16 16:07:39 +02:00
|
|
|
/* Need to extend HWcursor support to handle mask interleave */
|
|
|
|
if (!ms->SWCursor)
|
2008-06-26 23:27:44 +02:00
|
|
|
xf86_cursors_init(pScreen, 64, 64,
|
|
|
|
HARDWARE_CURSOR_SOURCE_MASK_INTERLEAVE_64 |
|
|
|
|
HARDWARE_CURSOR_ARGB);
|
2008-05-28 20:59:38 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
/* Must force it before EnterVT, so we are in control of VT and
|
|
|
|
* later memory should be bound when allocating, e.g rotate_mem */
|
|
|
|
pScrn->vtSema = TRUE;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
pScreen->SaveScreen = xf86SaveScreen;
|
|
|
|
ms->CloseScreen = pScreen->CloseScreen;
|
|
|
|
pScreen->CloseScreen = CloseScreen;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 13:38:26 +02:00
|
|
|
ms->BlockHandler = pScreen->BlockHandler;
|
|
|
|
pScreen->BlockHandler = msBlockHandler;
|
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
if (!xf86CrtcScreenInit(pScreen))
|
|
|
|
return FALSE;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
if (!miCreateDefColormap(pScreen))
|
|
|
|
return FALSE;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
xf86DPMSInit(pScreen, xf86DPMSSet, 0);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
if (serverGeneration == 1)
|
|
|
|
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-06-26 23:27:44 +02:00
|
|
|
return EnterVT(scrnIndex, 1);
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
AdjustFrame(int scrnIndex, int x, int y, int flags)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
|
|
|
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn);
|
|
|
|
xf86OutputPtr output = config->output[config->compat_output];
|
|
|
|
xf86CrtcPtr crtc = output->crtc;
|
|
|
|
|
|
|
|
if (crtc && crtc->enabled) {
|
|
|
|
crtc->funcs->mode_set(crtc, pScrn->currentMode, pScrn->currentMode, x,
|
|
|
|
y);
|
|
|
|
crtc->x = output->initial_x + x;
|
|
|
|
crtc->y = output->initial_y + y;
|
|
|
|
}
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
FreeScreen(int scrnIndex, int flags)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
FreeRec(xf86Screens[scrnIndex]);
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
LeaveVT(int scrnIndex, int flags)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-06-16 16:07:39 +02:00
|
|
|
pScrn->vtSema = FALSE;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This gets called when gaining control of the VT, and from ScreenInit().
|
|
|
|
*/
|
|
|
|
static Bool
|
|
|
|
EnterVT(int scrnIndex, int flags)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
|
|
|
modesettingPtr ms = modesettingPTR(pScrn);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 15:05:43 +02:00
|
|
|
pScrn->vtSema = TRUE;
|
|
|
|
|
|
|
|
if (!drmmode_set_desired_modes(pScrn, &ms->drmmode))
|
2008-05-28 16:55:36 +02:00
|
|
|
return FALSE;
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
return TRUE;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
SwitchMode(int scrnIndex, DisplayModePtr mode, int flags)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
return xf86SetSingleMode(pScrn, mode, RR_Rotate_0);
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
|
|
|
CloseScreen(int scrnIndex, ScreenPtr pScreen)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
|
|
|
|
modesettingPtr ms = modesettingPTR(pScrn);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2011-09-29 13:38:26 +02:00
|
|
|
if (ms->damage) {
|
|
|
|
DamageUnregister(&pScreen->GetScreenPixmap(pScreen)->drawable, ms->damage);
|
|
|
|
DamageDestroy(ms->damage);
|
|
|
|
ms->damage = NULL;
|
|
|
|
}
|
|
|
|
|
2011-09-29 16:55:36 +02:00
|
|
|
if (ms->shadow_enable) {
|
|
|
|
shadowRemove(pScreen, pScreen->GetScreenPixmap(pScreen));
|
|
|
|
free(ms->shadow_fb);
|
|
|
|
ms->shadow_fb = NULL;
|
|
|
|
}
|
2011-09-29 12:49:26 +02:00
|
|
|
drmmode_uevent_fini(pScrn, &ms->drmmode);
|
|
|
|
|
|
|
|
drmmode_free_bos(pScrn, &ms->drmmode);
|
|
|
|
|
2008-06-16 16:07:39 +02:00
|
|
|
if (pScrn->vtSema) {
|
2008-06-26 23:27:44 +02:00
|
|
|
LeaveVT(scrnIndex, 0);
|
2008-05-28 16:55:36 +02:00
|
|
|
}
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-06-16 16:07:39 +02:00
|
|
|
pScreen->CreateScreenResources = ms->createScreenResources;
|
2011-09-29 13:38:26 +02:00
|
|
|
pScreen->BlockHandler = ms->BlockHandler;
|
2011-09-29 15:05:43 +02:00
|
|
|
|
|
|
|
drmDropMaster(ms->fd);
|
2008-05-28 14:33:07 +02:00
|
|
|
|
2008-05-28 16:55:36 +02:00
|
|
|
pScrn->vtSema = FALSE;
|
|
|
|
pScreen->CloseScreen = ms->CloseScreen;
|
|
|
|
return (*pScreen->CloseScreen) (scrnIndex, pScreen);
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ModeStatus
|
|
|
|
ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags)
|
|
|
|
{
|
2008-05-28 16:55:36 +02:00
|
|
|
return MODE_OK;
|
2008-05-28 14:33:07 +02:00
|
|
|
}
|