summaryrefslogtreecommitdiff
path: root/src/sna/sna_driver.c
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 /src/sna/sna_driver.c
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>
Diffstat (limited to 'src/sna/sna_driver.c')
-rw-r--r--src/sna/sna_driver.c6
1 files changed, 6 insertions, 0 deletions
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;