diff options
author | Dave Airlie <airlied@redhat.com> | 2012-07-26 10:43:29 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-09-03 12:28:29 +1000 |
commit | d14ff42f2a205542df2ef723c6151d18db2bea8b (patch) | |
tree | 7033d942aa0d893e4fab7ffc71b44b28d28fcf34 /src | |
parent | 6705d8237aca90964449e4dbee97b4f62b87c28b (diff) |
intel: query kernel for caps to setup scrn capabilities.
This queries the kernel for prime support before advertising
the capabilities.
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/intel_driver.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/intel_driver.c b/src/intel_driver.c index 65fecfce..348d5dfb 100644 --- a/src/intel_driver.c +++ b/src/intel_driver.c @@ -432,6 +432,25 @@ static Bool can_accelerate_blt(struct intel_screen_private *intel) return TRUE; } +static void intel_setup_capabilities(ScrnInfoPtr scrn) +{ +#ifdef INTEL_PIXMAP_SHARING + intel_screen_private *intel = intel_get_screen_private(scrn); + uint64_t value; + int ret; + + scrn->capabilities = 0; + + ret = drmGetCap(intel->drmSubFD, DRM_CAP_PRIME, &value); + if (ret == 0) { + if (value & DRM_PRIME_CAP_EXPORT) + scrn->capabilities |= RR_Capability_SourceOutput | RR_Capability_SinkOffload; + if (value & DRM_PRIME_CAP_IMPORT) + scrn->capabilities |= RR_Capability_SinkOutput; + } +#endif +} + /** * This is called before ScreenInit to do any require probing of screen * configuration. @@ -524,6 +543,7 @@ static Bool I830PreInit(ScrnInfoPtr scrn, int flags) if (!I830GetEarlyOptions(scrn)) return FALSE; + intel_setup_capabilities(scrn); intel_check_chipset_option(scrn); intel_check_dri_option(scrn); |