summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspang@chromium.org <spang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-02 21:01:41 +0000
committerspang@chromium.org <spang@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-02 21:01:41 +0000
commit8811093dd3446ca8b2a94602a78d1e76adfaed9d (patch)
tree733f846a7da5521582881bb3518504717fe553f3
parentcb2b21ac2fd91eb96e027ac5d7c7e9e3a85747b3 (diff)
downloadchromium_src-8811093dd3446ca8b2a94602a78d1e76adfaed9d.zip
chromium_src-8811093dd3446ca8b2a94602a78d1e76adfaed9d.tar.gz
chromium_src-8811093dd3446ca8b2a94602a78d1e76adfaed9d.tar.bz2
ozone: gbm: Fix libglapi linkage errors under gbm
This works around missing linkage between mesa's DRI drivers (e.g. i965_dri.so) and libglapi.so.0. This causes problems under gbm. TEST=chrome --ozone-platform=gbm on link_freon BUG=377497 NOTRY=true Review URL: https://codereview.chromium.org/310673002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@274327 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ui/ozone/platform/dri/ozone_platform_gbm.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/ozone/platform/dri/ozone_platform_gbm.cc b/ui/ozone/platform/dri/ozone_platform_gbm.cc
index 75f0551..56c1744 100644
--- a/ui/ozone/platform/dri/ozone_platform_gbm.cc
+++ b/ui/ozone/platform/dri/ozone_platform_gbm.cc
@@ -4,6 +4,7 @@
#include "ui/ozone/platform/dri/ozone_platform_gbm.h"
+#include <dlfcn.h>
#include <stdlib.h>
#include <gbm.h>
@@ -32,9 +33,12 @@ class GbmSurfaceGenerator : public ScanoutSurfaceGenerator {
public:
GbmSurfaceGenerator(DriWrapper* dri)
: dri_(dri),
+ glapi_lib_(dlopen("libglapi.so.0", RTLD_LAZY | RTLD_GLOBAL)),
device_(gbm_create_device(dri_->get_fd())) {}
virtual ~GbmSurfaceGenerator() {
gbm_device_destroy(device_);
+ if (glapi_lib_)
+ dlclose(glapi_lib_);
}
gbm_device* device() const { return device_; }
@@ -46,6 +50,9 @@ class GbmSurfaceGenerator : public ScanoutSurfaceGenerator {
private:
DriWrapper* dri_; // Not owned.
+ // HACK: gbm drivers have broken linkage
+ void *glapi_lib_;
+
gbm_device* device_;
DISALLOW_COPY_AND_ASSIGN(GbmSurfaceGenerator);