scrn->driverVersion = INTEL_VERSION;
scrn->driverName = (char *)INTEL_DRIVER_NAME;
scrn->name = (char *)INTEL_NAME;
- scrn->driverPrivate = (void *)(match_data | 1);
+ scrn->driverPrivate = (void *)(match_data | (flags & XF86_ALLOCATE_GPU_SCREEN) | 2);
scrn->Probe = NULL;
if (xf86IsEntitySharable(entity_num))
ScrnInfoPtr scrn;
unsigned flags;
-#define SNA_NO_WAIT 0x1
-#define SNA_NO_FLIP 0x2
-#define SNA_NO_VSYNC 0x4
-#define SNA_TRIPLE_BUFFER 0x8
-#define SNA_TEAR_FREE 0x10
-#define SNA_FORCE_SHADOW 0x20
-#define SNA_FLUSH_GTT 0x40
-#define SNA_IS_HOSTED 0x80
-#define SNA_PERFORMANCE 0x100
-#define SNA_POWERSAVE 0x200
-#define SNA_REMOVE_OUTPUTS 0x400
+#define SNA_IS_SLAVED 0x1
+#define SNA_IS_HOSTED 0x2
+#define SNA_NO_WAIT 0x10
+#define SNA_NO_FLIP 0x20
+#define SNA_NO_VSYNC 0x40
+#define SNA_TRIPLE_BUFFER 0x80
+#define SNA_TEAR_FREE 0x100
+#define SNA_FORCE_SHADOW 0x200
+#define SNA_FLUSH_GTT 0x400
+#define SNA_PERFORMANCE 0x1000
+#define SNA_POWERSAVE 0x2000
+#define SNA_REMOVE_OUTPUTS 0x4000
#define SNA_HAS_FLIP 0x10000
#define SNA_HAS_ASYNC_FLIP 0x20000
#define SNA_LINEAR_FB 0x40000
{
ScrnInfoPtr scrn = sna->scrn;
xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(scrn);
- const int user_overrides[] = {
- OPTION_POSITION,
- OPTION_BELOW,
- OPTION_RIGHT_OF,
- OPTION_ABOVE,
- OPTION_LEFT_OF,
- OPTION_ROTATE,
- OPTION_PANNING,
- };
int width, height;
int i, j;
assert((sna->flags & SNA_IS_HOSTED) == 0);
- if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) {
- DBG(("%s: user requests reprobing\n", __FUNCTION__));
- return false;
- }
+ if ((sna->flags & SNA_IS_SLAVED) == 0) {
+ const int user_overrides[] = {
+ OPTION_POSITION,
+ OPTION_BELOW,
+ OPTION_RIGHT_OF,
+ OPTION_ABOVE,
+ OPTION_LEFT_OF,
+ OPTION_ROTATE,
+ OPTION_PANNING,
+ };
+ if (xf86ReturnOptValBool(sna->Options, OPTION_REPROBE, FALSE)) {
+ DBG(("%s: user requests reprobing\n", __FUNCTION__));
+ return false;
+ }
- /* First scan through all outputs and look for user overrides */
- for (i = 0; i < sna->mode.num_real_output; i++) {
- xf86OutputPtr output = config->output[i];
+ /* First scan through all outputs and look for user overrides */
+ for (i = 0; i < sna->mode.num_real_output; i++) {
+ xf86OutputPtr output = config->output[i];
- for (j = 0; j < ARRAY_SIZE(user_overrides); j++) {
- if (xf86GetOptValString(output->options, user_overrides[j])) {
- DBG(("%s: user placement [%d] for %s\n",
- __FUNCTION__,
- user_overrides[j],
- output->name));
- return false;
+ for (j = 0; j < ARRAY_SIZE(user_overrides); j++) {
+ if (xf86GetOptValString(output->options, user_overrides[j])) {
+ DBG(("%s: user placement [%d] for %s\n",
+ __FUNCTION__,
+ user_overrides[j],
+ output->name));
+ return false;
+ }
}
}
}
crtc_id = (uintptr_t)output->crtc;
output->crtc = NULL;
+ if (sna->flags & SNA_IS_SLAVED)
+ continue;
if (crtc_id == 0) {
DBG(("%s: not using output %s, disconnected\n",
}
width = height = 0;
- for (i = 0; i < config->num_crtc; i++) {
+ for (i = 0; i < sna->mode.num_real_crtc; i++) {
xf86CrtcPtr crtc = config->crtc[i];
int w, h;
* As a result, we want to set up that server initialization once rather
* that doing it per generation.
*/
-static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
+static Bool sna_pre_init(ScrnInfoPtr scrn, int probe)
{
struct sna *sna;
char buf[1024];
int fd;
DBG(("%s flags=%x, numEntities=%d\n",
- __FUNCTION__, flags, scrn->numEntities));
+ __FUNCTION__, probe, scrn->numEntities));
if (scrn->numEntities != 1)
return FALSE;
)
return FALSE;
- if (flags & PROBE_DETECT)
+ if (probe & PROBE_DETECT)
return TRUE;
sna_selftest();
- if (((uintptr_t)scrn->driverPrivate) & 1) {
+ probe = 0;
+ if (((uintptr_t)scrn->driverPrivate) & 3) {
if (posix_memalign((void **)&sna, 4096, sizeof(*sna)))
return FALSE;
memset(sna, 0, sizeof(*sna)); /* should be unnecessary */
- sna->info = (void *)((uintptr_t)scrn->driverPrivate & ~1);
+ probe = (uintptr_t)scrn->driverPrivate & 1;
+ sna->info = (void *)((uintptr_t)scrn->driverPrivate & ~3);
scrn->driverPrivate = sna;
sna->cpu_features = sna_cpu_detect();
sna = to_sna(scrn);
sna->scrn = scrn;
sna->pEnt = pEnt;
- sna->flags = 0;
+ sna->flags = probe;
scrn->displayWidth = 640; /* default it */
return TRUE;
cleanup:
- scrn->driverPrivate = (void *)((uintptr_t)sna->info | 1);
+ scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2);
free(sna);
return FALSE;
}
if ((uintptr_t)sna & 1)
return;
- scrn->driverPrivate = (void *)((uintptr_t)sna->info | 1);
+ scrn->driverPrivate = (void *)((uintptr_t)sna->info | (sna->flags & SNA_IS_SLAVED) | 2);
sna_mode_fini(sna);
sna_acpi_fini(sna);
if (flags & PROBE_DETECT)
return TRUE;
- if (((uintptr_t)scrn->driverPrivate) & 1) {
+ if (((uintptr_t)scrn->driverPrivate) & 3) {
intel = xnfcalloc(sizeof(*intel), 1);
if (intel == NULL)
return FALSE;
- intel->info = (void *)((uintptr_t)scrn->driverPrivate & ~1);
+ intel->info = (void *)((uintptr_t)scrn->driverPrivate & ~3);
scrn->driverPrivate = intel;
}
intel = intel_get_screen_private(scrn);
SCRN_INFO_PTR(arg);
intel_screen_private *intel = intel_get_screen_private(scrn);
- if (intel && !((uintptr_t)intel & 1)) {
+ if (intel && !((uintptr_t)intel & 3)) {
intel_mode_fini(intel);
intel_bufmgr_fini(intel);
intel_put_device(scrn);