Commit 87d2d208 authored by David Reveman's avatar David Reveman Committed by Commit Bot

Revert "Revert "exo: Remove support for wl_drm interface.""

This reverts commit 056af850.

Reason for revert: Should now be safe to remove this interface.

Original change's description:
> Revert "exo: Remove support for wl_drm interface."
> 
> This reverts commit 4c157e7a.
> 
> Reason for revert: Need to wait for Android uprev on CrOS before this can land.
> 
> Original change's description:
> > exo: Remove support for wl_drm interface.
> > 
> > linux-dmabuf protocol is preferred over wl_drm and the latter can now be
> > removed as ARC++ has switched to linux-dmabuf.
> > 
> > BUG=b/62900000
> > TEST=manual
> > 
> > Change-Id: Ibb28361b1055ef7f61e38530cf7640ec05ecd894
> > Reviewed-on: https://chromium-review.googlesource.com/549258
> > Reviewed-by: Antoine Labour <piman@chromium.org>
> > Commit-Queue: David Reveman <reveman@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#483087}
> 
> TBR=reveman@chromium.org,piman@chromium.org
> 
> # Not skipping CQ checks because original CL landed > 1 day ago.
> 
> Bug: b/62900000
> Change-Id: Ifd47be08a3d1d4164c05885dcfaa4a85d5d0149f
> Reviewed-on: https://chromium-review.googlesource.com/558104
> Reviewed-by: David Reveman <reveman@chromium.org>
> Commit-Queue: David Reveman <reveman@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#483865}

TBR=reveman@chromium.org,piman@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: b/62900000
Change-Id: Id49343d0f956eb29af8b04bc11bd3e3eb278b990
Reviewed-on: https://chromium-review.googlesource.com/687334Reviewed-by: default avatarDavid Reveman <reveman@chromium.org>
Reviewed-by: default avatarAntoine Labour <piman@chromium.org>
Commit-Queue: David Reveman <reveman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504737}
parent 4ec13d6a
...@@ -82,10 +82,7 @@ source_set("wayland") { ...@@ -82,10 +82,7 @@ source_set("wayland") {
] ]
if (use_ozone) { if (use_ozone) {
deps += [ deps += [ "//third_party/wayland-protocols:linux_dmabuf_protocol" ]
"//third_party/mesa:wayland_drm_protocol",
"//third_party/wayland-protocols:linux_dmabuf_protocol",
]
configs += [ ":libdrm" ] configs += [ ":libdrm" ]
if (is_chromeos) { if (is_chromeos) {
......
...@@ -94,7 +94,6 @@ ...@@ -94,7 +94,6 @@
#if defined(USE_OZONE) #if defined(USE_OZONE)
#include <drm_fourcc.h> #include <drm_fourcc.h>
#include <linux-dmabuf-unstable-v1-server-protocol.h> #include <linux-dmabuf-unstable-v1-server-protocol.h>
#include <wayland-drm-server-protocol.h>
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
#include "ui/base/ime/chromeos/ime_keyboard.h" #include "ui/base/ime/chromeos/ime_keyboard.h"
#include "ui/base/ime/chromeos/input_method_manager.h" #include "ui/base/ime/chromeos/input_method_manager.h"
...@@ -575,128 +574,6 @@ void bind_shm(wl_client* client, void* data, uint32_t version, uint32_t id) { ...@@ -575,128 +574,6 @@ void bind_shm(wl_client* client, void* data, uint32_t version, uint32_t id) {
#if defined(USE_OZONE) #if defined(USE_OZONE)
////////////////////////////////////////////////////////////////////////////////
// wl_drm_interface:
const struct drm_supported_format {
uint32_t drm_format;
gfx::BufferFormat buffer_format;
} drm_supported_formats[] = {
{WL_DRM_FORMAT_RGB565, gfx::BufferFormat::BGR_565},
{WL_DRM_FORMAT_XBGR8888, gfx::BufferFormat::RGBX_8888},
{WL_DRM_FORMAT_ABGR8888, gfx::BufferFormat::RGBA_8888},
{WL_DRM_FORMAT_XRGB8888, gfx::BufferFormat::BGRX_8888},
{WL_DRM_FORMAT_ARGB8888, gfx::BufferFormat::BGRA_8888},
{WL_DRM_FORMAT_NV12, gfx::BufferFormat::YUV_420_BIPLANAR},
{WL_DRM_FORMAT_YVU420, gfx::BufferFormat::YVU_420}};
void drm_authenticate(wl_client* client, wl_resource* resource, uint32_t id) {
wl_drm_send_authenticated(resource);
}
void drm_create_buffer(wl_client* client,
wl_resource* resource,
uint32_t id,
uint32_t name,
int32_t width,
int32_t height,
uint32_t stride,
uint32_t format) {
wl_resource_post_error(resource, WL_DRM_ERROR_INVALID_NAME,
"GEM names are not supported");
}
void drm_create_planar_buffer(wl_client* client,
wl_resource* resource,
uint32_t id,
uint32_t name,
int32_t width,
int32_t height,
uint32_t format,
int32_t offset0,
int32_t stride0,
int32_t offset1,
int32_t stride1,
int32_t offset2,
int32_t stride3) {
wl_resource_post_error(resource, WL_DRM_ERROR_INVALID_NAME,
"GEM names are not supported");
}
void drm_create_prime_buffer(wl_client* client,
wl_resource* resource,
uint32_t id,
int32_t name,
int32_t width,
int32_t height,
uint32_t format,
int32_t offset0,
int32_t stride0,
int32_t offset1,
int32_t stride1,
int32_t offset2,
int32_t stride2) {
const auto* supported_format =
std::find_if(drm_supported_formats,
drm_supported_formats + arraysize(drm_supported_formats),
[format](const drm_supported_format& supported_format) {
return supported_format.drm_format == format;
});
if (supported_format ==
(drm_supported_formats + arraysize(drm_supported_formats))) {
wl_resource_post_error(resource, WL_DRM_ERROR_INVALID_FORMAT,
"invalid format 0x%x", format);
return;
}
std::vector<gfx::NativePixmapPlane> planes;
planes.emplace_back(stride0, offset0, 0, 0);
planes.emplace_back(stride1, offset1, 0, 0);
planes.emplace_back(stride2, offset2, 0, 0);
std::vector<base::ScopedFD> fds;
size_t num_planes =
gfx::NumberOfPlanesForBufferFormat(supported_format->buffer_format);
planes.resize(num_planes);
fds.push_back(base::ScopedFD(name));
std::unique_ptr<Buffer> buffer =
GetUserDataAs<Display>(resource)->CreateLinuxDMABufBuffer(
gfx::Size(width, height), supported_format->buffer_format, planes,
std::move(fds));
if (!buffer) {
wl_resource_post_no_memory(resource);
return;
}
wl_resource* buffer_resource =
wl_resource_create(client, &wl_buffer_interface, 1, id);
buffer->set_release_callback(base::Bind(&HandleBufferReleaseCallback,
base::Unretained(buffer_resource)));
SetImplementation(buffer_resource, &buffer_implementation, std::move(buffer));
}
const struct wl_drm_interface drm_implementation = {
drm_authenticate, drm_create_buffer, drm_create_planar_buffer,
drm_create_prime_buffer};
const uint32_t drm_version = 2;
void bind_drm(wl_client* client, void* data, uint32_t version, uint32_t id) {
wl_resource* resource = wl_resource_create(
client, &wl_drm_interface, std::min(version, drm_version), id);
wl_resource_set_implementation(resource, &drm_implementation, data, nullptr);
if (version >= 2)
wl_drm_send_capabilities(resource, WL_DRM_CAPABILITY_PRIME);
for (const auto& supported_format : drm_supported_formats)
wl_drm_send_format(resource, supported_format.drm_format);
}
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// linux_buffer_params_interface: // linux_buffer_params_interface:
...@@ -4518,8 +4395,6 @@ Server::Server(Display* display) ...@@ -4518,8 +4395,6 @@ Server::Server(Display* display)
compositor_version, display_, bind_compositor); compositor_version, display_, bind_compositor);
wl_global_create(wl_display_.get(), &wl_shm_interface, 1, display_, bind_shm); wl_global_create(wl_display_.get(), &wl_shm_interface, 1, display_, bind_shm);
#if defined(USE_OZONE) #if defined(USE_OZONE)
wl_global_create(wl_display_.get(), &wl_drm_interface, drm_version, display_,
bind_drm);
wl_global_create(wl_display_.get(), &zwp_linux_dmabuf_v1_interface, 2, wl_global_create(wl_display_.get(), &zwp_linux_dmabuf_v1_interface, 2,
display_, bind_linux_dmabuf); display_, bind_linux_dmabuf);
#endif #endif
......
...@@ -774,26 +774,3 @@ loadable_module("osmesa") { ...@@ -774,26 +774,3 @@ loadable_module("osmesa") {
] ]
} }
} }
if (is_linux) {
config("wayland_drm_protocol_config") {
include_dirs = [ "$generated_src_dir/egl/wayland/wayland-drm" ]
}
static_library("wayland_drm_protocol") {
sources = [
"$generated_src_dir/egl/wayland/wayland-drm/wayland-drm-client-protocol.h",
"$generated_src_dir/egl/wayland/wayland-drm/wayland-drm-protocol.c",
"$generated_src_dir/egl/wayland/wayland-drm/wayland-drm-server-protocol.h",
]
deps = [
"//third_party/wayland:wayland_util",
]
configs -= [ "//build/config/compiler:chromium_code" ]
configs += [ "//build/config/compiler:no_chromium_code" ]
public_configs = [ ":wayland_drm_protocol_config" ]
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment