Renaming ozone platform gbm to drm
Currently the build flag for the ozone platform DRM is actually ozone_platform_gbm. This change renames this flag to ozone_platform_drm in a backwards compatible way. This change will also require changes to third_party in order to support the deprecation of the old flag. (see https://crbug.com/1122010) The final act of this rename will be to remove the old flag. (See https://crbug.com/1122010) R=brucedawson@chromium.org, penghuang@chromium.org, rjkroege@chromium.org Bug: 1116466 Change-Id: I481edf07290eb27b011aede08de40e4210a52834 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2373181 Reviewed-by: Michael Spang <spang@chromium.org> Reviewed-by: Daniele Castagna <dcastagna@chromium.org> Reviewed-by: Peng Huang <penghuang@chromium.org> Commit-Queue: Peter McNeeley <petermcneeley@chromium.org> Auto-Submit: Peter McNeeley <petermcneeley@chromium.org> Cr-Commit-Position: refs/heads/master@{#807263}
This commit is contained in:

committed by
Commit Bot

parent
ac816f8f75
commit
4ea922e75c
components/exo/wayland
docs
media/gpu/vaapi
ui
@ -232,7 +232,7 @@ source_set("unit_tests") {
|
||||
}
|
||||
|
||||
config("client_support_config") {
|
||||
if (ozone_platform_gbm) {
|
||||
if (ozone_platform_drm) {
|
||||
defines = [ "USE_GBM" ]
|
||||
if (enable_vulkan) {
|
||||
defines += [ "USE_VULKAN" ]
|
||||
@ -269,7 +269,7 @@ source_set("client_support") {
|
||||
"//third_party/wayland-protocols:vsync_feedback_protocol",
|
||||
]
|
||||
|
||||
if (ozone_platform_gbm) {
|
||||
if (ozone_platform_drm) {
|
||||
configs += [ "//ui/gl:gl_config" ]
|
||||
deps += [
|
||||
"//build/config/linux/libdrm",
|
||||
@ -296,7 +296,7 @@ executable("wayland_rects_client") {
|
||||
"//ui/gl",
|
||||
]
|
||||
|
||||
if (ozone_platform_gbm) {
|
||||
if (ozone_platform_drm) {
|
||||
configs += [ "//ui/gl:gl_config" ]
|
||||
defines = [ "USE_GBM" ]
|
||||
deps += [
|
||||
@ -325,7 +325,7 @@ source_set("simple") {
|
||||
"//ui/gl",
|
||||
]
|
||||
|
||||
if (ozone_platform_gbm) {
|
||||
if (ozone_platform_drm) {
|
||||
configs += [ "//ui/gl:gl_config" ]
|
||||
}
|
||||
}
|
||||
@ -348,7 +348,7 @@ source_set("fullscreen_shell") {
|
||||
"//ui/gl",
|
||||
]
|
||||
|
||||
if (ozone_platform_gbm) {
|
||||
if (ozone_platform_drm) {
|
||||
configs += [ "//ui/gl:gl_config" ]
|
||||
}
|
||||
}
|
||||
@ -386,7 +386,7 @@ executable("wayland_subsurface_client") {
|
||||
"//ui/gl",
|
||||
]
|
||||
|
||||
if (ozone_platform_gbm) {
|
||||
if (ozone_platform_drm) {
|
||||
configs += [ "//ui/gl:gl_config" ]
|
||||
}
|
||||
}
|
||||
@ -407,7 +407,7 @@ source_set("blur") {
|
||||
"//ui/gl",
|
||||
]
|
||||
|
||||
if (ozone_platform_gbm) {
|
||||
if (ozone_platform_drm) {
|
||||
configs += [ "//ui/gl:gl_config" ]
|
||||
}
|
||||
}
|
||||
@ -512,7 +512,7 @@ test("wayland_client_perftests") {
|
||||
}
|
||||
}
|
||||
|
||||
if (ozone_platform_gbm) {
|
||||
if (ozone_platform_drm) {
|
||||
executable("wayland_yuv_client") {
|
||||
sources = [ "clients/yuv.cc" ]
|
||||
|
||||
|
@ -33,12 +33,13 @@ Googlers should checkout chromium source code as described here:
|
||||
[Building Chromium on a corporate Linux
|
||||
workstation](https://companydoc.corp.google.com/company/teams/chrome/build_instructions.md?cl=head)
|
||||
|
||||
We want to build on linux on top of Ozone with gbm platform. The
|
||||
following instructions builds chromium targets along with minigbm
|
||||
that lives in the chromium tree `src/third_party/minigbm`. Currently,
|
||||
there is no builder for this configuration so while this worked
|
||||
(mostly) when this document was written, some experimentation may
|
||||
be necessary.
|
||||
We want to build on linux on top of Ozone with the DRM
|
||||
(Direct Render Manager) platform which is backed by GBM
|
||||
(Generic Buffer Management). The following instructions builds
|
||||
chromium targets along with minigbm that lives in the chromium
|
||||
tree `src/third_party/minigbm`. Currently, there is no builder for
|
||||
this configuration so while this worked (mostly) when this document
|
||||
was written, some experimentation may be necessary.
|
||||
|
||||
Set the gn args for your output dir target `out/Nouveau` with:
|
||||
|
||||
@ -48,8 +49,8 @@ Add the following arguments:
|
||||
dcheck_always_on = true
|
||||
use_ozone = true
|
||||
target_os = "chromeos"
|
||||
ozone_platform_gbm = true
|
||||
ozone_platform = "gbm"
|
||||
ozone_platform_drm = true
|
||||
ozone_platform = "drm"
|
||||
use_system_minigbm = false
|
||||
target_sysroot = "//build/linux/debian_jessie_amd64-sysroot"
|
||||
is_debug = false
|
||||
@ -78,7 +79,7 @@ $ sudo usermod -a -G plugdev $USER
|
||||
$ sudo usermod -a -G video $USER
|
||||
$ sudo usermod -a -G audio $USER
|
||||
$ newgrp video
|
||||
$ negrrp plugdev
|
||||
$ newgrp plugdev
|
||||
$ newgrp audio
|
||||
$ # Stop pulseaudio if running:
|
||||
$ pactl exit
|
||||
@ -87,7 +88,7 @@ $ pactl exit
|
||||
Run chrome: (Set `CHROMIUM_SRC` to the directory containing your Chrome checkout.)
|
||||
|
||||
```
|
||||
$ sudo chvt 8; EGL_PLATFORM=surfaceless $CHROMIUM_SRC/out/Nouveau/chrome --ozone-platform=gbm --force-system-compositor-mode --login-profile=user --user-data-dir=$HOME/.config/google-chrome-gbm --use-gl=egl --enable-wayland-server --login-manager --ash-constrain-pointer-to-root --default-tile-width=512 --default-tile-height=512 --system-developer-mode --crosh-command=/bin/bash
|
||||
$ sudo chvt 8; EGL_PLATFORM=surfaceless $CHROMIUM_SRC/out/Nouveau/chrome --ozone-platform=drm --force-system-compositor-mode --login-profile=user --user-data-dir=$HOME/.config/google-chrome-gbm --use-gl=egl --enable-wayland-server --login-manager --ash-constrain-pointer-to-root --default-tile-width=512 --default-tile-height=512 --system-developer-mode --crosh-command=/bin/bash
|
||||
```
|
||||
|
||||
Login to Chrome settings should synchronize.
|
||||
|
@ -184,8 +184,8 @@ Or run for example the Wayland platform:
|
||||
|
||||
You can turn properly implemented ozone platforms on and off by setting the
|
||||
corresponding flags in your GN configuration. For example
|
||||
`ozone_platform_headless=false ozone_platform_gbm=false` will turn off the
|
||||
headless and DRM/GBM platforms.
|
||||
`ozone_platform_headless=false ozone_platform_drm=false` will turn off the
|
||||
headless and DRM (GBM) platforms.
|
||||
This will result in a smaller binary and faster builds. To turn ALL platforms
|
||||
off by default, set `ozone_auto_platforms=false`.
|
||||
|
||||
@ -198,16 +198,16 @@ by default.
|
||||
## Running with Ozone
|
||||
|
||||
Specify the platform you want to use at runtime using the `--ozone-platform`
|
||||
flag. For example, to run `content_shell` with the GBM platform:
|
||||
flag. For example, to run `content_shell` with the DRM (GBM) platform:
|
||||
|
||||
``` shell
|
||||
content_shell --ozone-platform=gbm
|
||||
content_shell --ozone-platform=drm
|
||||
```
|
||||
|
||||
Caveats:
|
||||
|
||||
* `content_shell` always runs at 800x600 resolution.
|
||||
* For the GBM platform, you may need to terminate your X server (or any other
|
||||
* For the DRM (GBM) platform, you may need to terminate your X server (or any other
|
||||
display server) prior to testing.
|
||||
* During development, you may need to configure
|
||||
[sandboxing](linux/sandboxing.md) or to disable it.
|
||||
|
@ -172,7 +172,7 @@ source_set("common") {
|
||||
"//ui/gfx:memory_buffer",
|
||||
"//ui/gl",
|
||||
]
|
||||
if (ozone_platform_gbm) {
|
||||
if (ozone_platform_drm) {
|
||||
deps += [ "//ui/ozone" ]
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
import("//build/config/ui.gni")
|
||||
import("//ui/ozone/ozone.gni")
|
||||
|
||||
assert(use_x11 || ozone_platform_gbm || ozone_platform_wayland)
|
||||
assert(use_x11 || ozone_platform_drm || ozone_platform_wayland)
|
||||
|
||||
source_set("drm") {
|
||||
sources = [
|
||||
|
@ -31,8 +31,8 @@ if (ozone_platform_headless) {
|
||||
ozone_platform_deps += [ "platform/headless" ]
|
||||
}
|
||||
|
||||
if (ozone_platform_gbm) {
|
||||
ozone_platforms += [ "gbm" ]
|
||||
if (ozone_platform_drm) {
|
||||
ozone_platforms += [ "drm" ]
|
||||
ozone_platform_deps += [ "platform/drm:gbm" ]
|
||||
ozone_platform_test_deps += [ "platform/drm:gbm_unittests" ]
|
||||
}
|
||||
|
@ -14,6 +14,10 @@ declare_args() {
|
||||
|
||||
# Select platforms automatically. Turn this off for manual control.
|
||||
ozone_auto_platforms = use_ozone
|
||||
|
||||
# TODO(petermcneeley): Backwards compatiblity support for VM images.
|
||||
# Remove when deprecated. (https://crbug.com/1122009)
|
||||
ozone_platform_gbm = -1
|
||||
}
|
||||
|
||||
declare_args() {
|
||||
@ -24,8 +28,8 @@ declare_args() {
|
||||
# Compile the 'cast' platform.
|
||||
ozone_platform_cast = false
|
||||
|
||||
# Compile the 'gbm' platform.
|
||||
ozone_platform_gbm = false
|
||||
# Compile the 'drm' platform.
|
||||
ozone_platform_drm = false
|
||||
|
||||
# Compile the 'headless' platform.
|
||||
ozone_platform_headless = false
|
||||
@ -64,7 +68,7 @@ declare_args() {
|
||||
}
|
||||
} else if (is_chromeos) {
|
||||
ozone_platform = "x11"
|
||||
ozone_platform_gbm = true
|
||||
ozone_platform_drm = true
|
||||
ozone_platform_x11 = true
|
||||
|
||||
# Enable the Ozone Wayland platform for ChromiumOS codesearch-gen bots
|
||||
@ -84,6 +88,12 @@ declare_args() {
|
||||
ozone_platform_scenic = true
|
||||
}
|
||||
}
|
||||
|
||||
# TODO(petermcneeley): Backwards compatiblity support for VM images.
|
||||
# Remove when deprecated. (https://crbug.com/1122009)
|
||||
if (ozone_platform_gbm != -1) {
|
||||
ozone_platform_drm = ozone_platform_gbm
|
||||
}
|
||||
}
|
||||
|
||||
import(ozone_extra_path)
|
||||
@ -94,9 +104,20 @@ _ozone_extra_directory = get_path_info(ozone_extra_path, "dir")
|
||||
ozone_external_platform_visibility = [ "$_ozone_extra_directory/*" ]
|
||||
|
||||
if (is_a_target_toolchain) {
|
||||
assert(use_ozone || !(ozone_platform_cast || ozone_platform_gbm ||
|
||||
assert(use_ozone || !(ozone_platform_cast || ozone_platform_drm ||
|
||||
ozone_platform_headless || ozone_platform_x11 ||
|
||||
ozone_platform_wayland || ozone_platform_windows ||
|
||||
ozone_platform_scenic),
|
||||
"Must set use_ozone to select ozone platforms")
|
||||
}
|
||||
|
||||
# TODO(petermcneeley): Backwards compatiblity support for VM images.
|
||||
# Remove when deprecated. (https://crbug.com/1122009)
|
||||
|
||||
assert(ozone_platform_gbm == -1 || ozone_platform_drm == ozone_platform_gbm)
|
||||
|
||||
ozone_platform_gbm = ozone_platform_drm
|
||||
|
||||
if (ozone_platform == "gbm") {
|
||||
ozone_platform = "drm"
|
||||
}
|
||||
|
@ -17,8 +17,8 @@ declare_args() {
|
||||
|
||||
source_set("gbm") {
|
||||
sources = [
|
||||
"client_native_pixmap_factory_gbm.cc",
|
||||
"client_native_pixmap_factory_gbm.h",
|
||||
"client_native_pixmap_factory_drm.cc",
|
||||
"client_native_pixmap_factory_drm.h",
|
||||
"common/display_types.h",
|
||||
"common/drm_util.cc",
|
||||
"common/drm_util.h",
|
||||
@ -112,8 +112,8 @@ source_set("gbm") {
|
||||
"host/host_cursor_proxy.h",
|
||||
"host/host_drm_device.cc",
|
||||
"host/host_drm_device.h",
|
||||
"ozone_platform_gbm.cc",
|
||||
"ozone_platform_gbm.h",
|
||||
"ozone_platform_drm.cc",
|
||||
"ozone_platform_drm.h",
|
||||
]
|
||||
|
||||
deps = [
|
||||
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "ui/ozone/platform/drm/client_native_pixmap_factory_gbm.h"
|
||||
#include "ui/ozone/platform/drm/client_native_pixmap_factory_drm.h"
|
||||
|
||||
#include <utility>
|
||||
|
||||
@ -12,7 +12,7 @@
|
||||
|
||||
namespace ui {
|
||||
|
||||
gfx::ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm() {
|
||||
gfx::ClientNativePixmapFactory* CreateClientNativePixmapFactoryDrm() {
|
||||
return gfx::CreateClientNativePixmapFactoryDmabuf();
|
||||
}
|
||||
|
@ -2,8 +2,8 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef UI_OZONE_PLATFORM_DRM_CLIENT_NATIVE_PIXMAP_FACTORY_GBM_H_
|
||||
#define UI_OZONE_PLATFORM_DRM_CLIENT_NATIVE_PIXMAP_FACTORY_GBM_H_
|
||||
#ifndef UI_OZONE_PLATFORM_DRM_CLIENT_NATIVE_PIXMAP_FACTORY_DRM_H_
|
||||
#define UI_OZONE_PLATFORM_DRM_CLIENT_NATIVE_PIXMAP_FACTORY_DRM_H_
|
||||
|
||||
namespace gfx {
|
||||
class ClientNativePixmapFactory;
|
||||
@ -12,8 +12,8 @@ class ClientNativePixmapFactory;
|
||||
namespace ui {
|
||||
|
||||
// Constructor hook for use in constructor_list.cc
|
||||
gfx::ClientNativePixmapFactory* CreateClientNativePixmapFactoryGbm();
|
||||
gfx::ClientNativePixmapFactory* CreateClientNativePixmapFactoryDrm();
|
||||
|
||||
} // namespace ui
|
||||
|
||||
#endif // UI_OZONE_PLATFORM_DRM_CLIENT_NATIVE_PIXMAP_FACTORY_GBM_H_
|
||||
#endif // UI_OZONE_PLATFORM_DRM_CLIENT_NATIVE_PIXMAP_FACTORY_DRM_H_
|
@ -2,7 +2,7 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "ui/ozone/platform/drm/ozone_platform_gbm.h"
|
||||
#include "ui/ozone/platform/drm/ozone_platform_drm.h"
|
||||
|
||||
#include <gbm.h>
|
||||
#include <stdlib.h>
|
||||
@ -68,10 +68,10 @@ namespace ui {
|
||||
|
||||
namespace {
|
||||
|
||||
class OzonePlatformGbm : public OzonePlatform {
|
||||
class OzonePlatformDrm : public OzonePlatform {
|
||||
public:
|
||||
OzonePlatformGbm() = default;
|
||||
~OzonePlatformGbm() override = default;
|
||||
OzonePlatformDrm() = default;
|
||||
~OzonePlatformDrm() override = default;
|
||||
|
||||
// OzonePlatform:
|
||||
ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
|
||||
@ -91,7 +91,7 @@ class OzonePlatformGbm : public OzonePlatform {
|
||||
}
|
||||
|
||||
GpuPlatformSupportHost* GetGpuPlatformSupportHost() override {
|
||||
return drm_device_connector_.get();
|
||||
return drm_device_connector_.get();
|
||||
}
|
||||
|
||||
std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() override {
|
||||
@ -110,7 +110,7 @@ class OzonePlatformGbm : public OzonePlatform {
|
||||
// method after drm_thread is started.
|
||||
binders->Add<ozone::mojom::DrmDevice>(
|
||||
base::BindRepeating(
|
||||
&OzonePlatformGbm::CreateDrmDeviceReceiverOnGpuThread,
|
||||
&OzonePlatformDrm::CreateDrmDeviceReceiverOnGpuThread,
|
||||
weak_factory_.GetWeakPtr()),
|
||||
gpu_task_runner_);
|
||||
} else {
|
||||
@ -123,7 +123,7 @@ class OzonePlatformGbm : public OzonePlatform {
|
||||
// Binder callbacks should directly run on DRM thread.
|
||||
binders->Add<ozone::mojom::DrmDevice>(
|
||||
base::BindRepeating(
|
||||
&OzonePlatformGbm::CreateDrmDeviceReceiverOnDrmThread,
|
||||
&OzonePlatformDrm::CreateDrmDeviceReceiverOnDrmThread,
|
||||
weak_factory_.GetWeakPtr()),
|
||||
drm_thread_proxy_->GetDrmThreadTaskRunner());
|
||||
}
|
||||
@ -295,7 +295,7 @@ class OzonePlatformGbm : public OzonePlatform {
|
||||
DrainReceiverRequests();
|
||||
} else {
|
||||
auto safe_receiver_request_drainer = CreateSafeOnceCallback(
|
||||
base::BindOnce(&OzonePlatformGbm::DrainReceiverRequests,
|
||||
base::BindOnce(&OzonePlatformDrm::DrainReceiverRequests,
|
||||
weak_factory_.GetWeakPtr()));
|
||||
drm_thread_proxy_->StartDrmThread(
|
||||
std::move(safe_receiver_request_drainer));
|
||||
@ -336,15 +336,15 @@ class OzonePlatformGbm : public OzonePlatform {
|
||||
std::unique_ptr<DrmDisplayHostManager> display_manager_;
|
||||
InitializedHostProperties host_properties_;
|
||||
|
||||
base::WeakPtrFactory<OzonePlatformGbm> weak_factory_{this};
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(OzonePlatformGbm);
|
||||
base::WeakPtrFactory<OzonePlatformDrm> weak_factory_{this};
|
||||
OzonePlatformDrm(const OzonePlatformDrm&) = delete;
|
||||
OzonePlatformDrm& operator=(const OzonePlatformDrm&) = delete;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
||||
OzonePlatform* CreateOzonePlatformGbm() {
|
||||
return new OzonePlatformGbm;
|
||||
OzonePlatform* CreateOzonePlatformDrm() {
|
||||
return new OzonePlatformDrm;
|
||||
}
|
||||
|
||||
} // namespace ui
|
@ -2,16 +2,16 @@
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#ifndef UI_OZONE_PLATFORM_DRM_OZONE_PLATFORM_GBM_H_
|
||||
#define UI_OZONE_PLATFORM_DRM_OZONE_PLATFORM_GBM_H_
|
||||
#ifndef UI_OZONE_PLATFORM_DRM_OZONE_PLATFORM_DRM_H_
|
||||
#define UI_OZONE_PLATFORM_DRM_OZONE_PLATFORM_DRM_H_
|
||||
|
||||
namespace ui {
|
||||
|
||||
class OzonePlatform;
|
||||
|
||||
// Constructor hook for use in ozone_platform_list.cc
|
||||
OzonePlatform* CreateOzonePlatformGbm();
|
||||
OzonePlatform* CreateOzonePlatformDrm();
|
||||
|
||||
} // namespace ui
|
||||
|
||||
#endif // UI_OZONE_PLATFORM_DRM_OZONE_PLATFORM_GBM_H_
|
||||
#endif // UI_OZONE_PLATFORM_DRM_OZONE_PLATFORM_DRM_H_
|
Reference in New Issue
Block a user