forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Chrome OS's minigbm library to third_party
This library is used by Chrome on Chrome OS to allocate accelerated graphics buffers. The version avaiable on Ubuntu is too old, and as a result we can't run unit tests for the gbm platform code on developer workstations or on the waterfall. This adds the library to third_party and fixes up the build files to use either the OS copy (for Chrome OS release builds) or gardened copy (for testing on the waterfall) depending on the value of "use_system_minigbm". BUG=530712 TEST= GYP_DEFINES="use_ozone=1 chromeos=1 ozone_platform_gbm=1 use_system_minigbm=0" gclient runhooks ninja -C out/Release ozone_unittests ./out/Release/ozone_unittests gn gen out_gn_ozone --args='target_os="chromeos" use_ozone=true ozone_platform_gbm=true use_system_minigbm=false' ninja -C out_gn_ozone ozone_unittests ./out_gn_ozone/Release/ozone_unittests Review URL: https://codereview.chromium.org/1341473003 Cr-Commit-Position: refs/heads/master@{#348758}
- Loading branch information
Showing
10 changed files
with
170 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Copyright 2015 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
import("//build/config/linux/pkg_config.gni") | ||
|
||
assert(is_linux) | ||
|
||
declare_args() { | ||
# Controls whether the build should use the version of minigbm library | ||
# shipped with the system. In release builds of Chrome OS we use the | ||
# system version, but when building on dev workstations or the Chrome | ||
# waterfall we bundle it because Ubuntu doesn't ship a usable version. | ||
use_system_minigbm = false | ||
} | ||
|
||
if (!use_system_minigbm) { | ||
config("minigbm_config") { | ||
include_dirs = [ "src" ] | ||
} | ||
|
||
pkg_config("libdrm") { | ||
packages = [ "libdrm" ] | ||
} | ||
|
||
static_library("minigbm") { | ||
sources = [ | ||
"src/cirrus.c", | ||
"src/exynos.c", | ||
"src/gbm.c", | ||
"src/gma500.c", | ||
"src/helpers.c", | ||
"src/i915.c", | ||
"src/mediatek.c", | ||
"src/rockchip.c", | ||
"src/tegra.c", | ||
"src/udl.c", | ||
] | ||
|
||
configs -= [ "//build/config/compiler:chromium_code" ] | ||
configs += [ | ||
":libdrm", | ||
"//build/config/compiler:no_chromium_code", | ||
] | ||
|
||
public_configs = [ ":minigbm_config" ] | ||
} | ||
} | ||
|
||
if (use_system_minigbm) { | ||
pkg_config("libgbm") { | ||
packages = [ "gbm" ] | ||
} | ||
|
||
group("minigbm") { | ||
public_configs = [ ":libgbm" ] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2014 The Chromium OS Authors. All rights reserved. | ||
// | ||
// Redistribution and use in source and binary forms, with or without | ||
// modification, are permitted provided that the following conditions are | ||
// met: | ||
// | ||
// * Redistributions of source code must retain the above copyright | ||
// notice, this list of conditions and the following disclaimer. | ||
// * Redistributions in binary form must reproduce the above | ||
// copyright notice, this list of conditions and the following disclaimer | ||
// in the documentation and/or other materials provided with the | ||
// distribution. | ||
// * Neither the name of Google Inc. nor the names of its | ||
// contributors may be used to endorse or promote products derived from | ||
// this software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
marcheu@chromium.org | ||
spang@chromium.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Name: minigbm | ||
Short Name: minigbm | ||
URL: https://chromium.googlesource.com/chromiumos/platform/minigbm | ||
Version: 0 | ||
License: BSD | ||
License File: LICENSE | ||
Security Critical: yes | ||
|
||
Description: | ||
This contains the graphics buffer allocator library for Chrome OS. | ||
|
||
Local Modifications: | ||
None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Copyright 2015 The Chromium Authors. All rights reserved. | ||
# Use of this source code is governed by a BSD-style license that can be | ||
# found in the LICENSE file. | ||
|
||
{ | ||
'variables': { | ||
'use_system_minigbm%': 0, | ||
}, | ||
'conditions': [ | ||
['use_system_minigbm==0', { | ||
'targets': [ | ||
{ | ||
'target_name': 'minigbm', | ||
'type': 'static_library', | ||
'dependencies' : [ | ||
'../../build/linux/system.gyp:libdrm', | ||
], | ||
'sources': [ | ||
'src/cirrus.c', | ||
'src/exynos.c', | ||
'src/gbm.c', | ||
'src/gma500.c', | ||
'src/helpers.c', | ||
'src/i915.c', | ||
'src/mediatek.c', | ||
'src/rockchip.c', | ||
'src/tegra.c', | ||
'src/udl.c', | ||
], | ||
'include_dirs': [ | ||
'src', | ||
], | ||
'direct_dependent_settings': { | ||
'include_dirs': [ | ||
'src', | ||
], | ||
}, | ||
}, | ||
], | ||
}, { # 'use_system_minigbm!=0 | ||
'targets': [ | ||
{ | ||
'target_name': 'minigbm', | ||
'type': 'none', | ||
'direct_dependent_settings': { | ||
'cflags': [ | ||
'<!@(<(pkg-config) --cflags gbm)', | ||
], | ||
}, | ||
'link_settings': { | ||
'ldflags': [ | ||
'<!@(<(pkg-config) --libs-only-L --libs-only-other gbm)', | ||
], | ||
'libraries': [ | ||
'<!@(<(pkg-config) --libs-only-l gbm)', | ||
], | ||
}, | ||
}, | ||
], | ||
}], | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters