summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-26 11:43:28 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-08-26 11:43:28 +0100
commit51037706b068b52b7c8984527c209d295e1e3584 (patch)
treeb6475455e0cecb60b8d7a975448e39a98f316f42
parent8c5229cf8fc642f8b7e091c38bfd27032ee5e48c (diff)
sna: Fix attaching to a headless configuration
ADDFB fails with a headless config (as any fb size is invalid). Fortunately, with headless we can use any depth we like. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c5
-rw-r--r--src/sna/sna_display_fake.c4
-rw-r--r--src/sna/sna_driver.c6
3 files changed, 12 insertions, 3 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index ea0324b1..d162def4 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -5677,13 +5677,13 @@ bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
sna_cursor_pre_init(sna);
sna_backlight_pre_init(sna);
+
+ set_size_range(sna);
} else {
if (num_fake == 0)
num_fake = 1;
}
- set_size_range(sna);
-
if (!sna_mode_fake_init(sna, num_fake))
return false;
@@ -5740,6 +5740,7 @@ sna_mode_set_primary(struct sna *sna)
if (!xf86ReturnOptValBool(output->options, OPTION_PRIMARY, FALSE))
continue;
+ DBG(("%s: setting PrimaryOutput %s\n", __FUNCTION__, output->name));
rr->primaryOutput = output->randr_output;
RROutputChanged(rr->primaryOutput, 0);
rr->layoutChanged = TRUE;
diff --git a/src/sna/sna_display_fake.c b/src/sna/sna_display_fake.c
index b143d86b..4d74c38d 100644
--- a/src/sna/sna_display_fake.c
+++ b/src/sna/sna_display_fake.c
@@ -331,8 +331,10 @@ bool sna_mode_fake_init(struct sna *sna, int num_fake)
if (num_fake == 0)
return true;
- if (sna->mode.num_real_crtc == 0)
+ if (sna->mode.num_real_crtc == 0) {
xf86CrtcConfigInit(sna->scrn, &sna_mode_funcs);
+ xf86CrtcSetSizeRange(sna->scrn, 1, 1, INT16_MAX, INT16_MAX);
+ }
ret = true;
while (ret && num_fake--)
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 4b35fe96..66f72dc2 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -445,8 +445,14 @@ static Bool fb_supports_depth(int fd, int depth)
{
struct drm_i915_gem_create create;
struct drm_mode_fb_cmd fb;
+ struct drm_mode_card_res res;
Bool ret;
+ memset(&res, 0, sizeof(res));
+ (void)drmIoctl(fd, DRM_IOCTL_MODE_GETRESOURCES, &res);
+ if (res.count_crtcs == 0)
+ return TRUE;
+
VG_CLEAR(create);
create.handle = 0;
create.size = 4096;