Commit 76904d16 authored by Eliot Courtney's avatar Eliot Courtney Committed by Commit Bot

ozone/drm: Disable AFBC for modeset buffers

AFBC for modeset buffers doesn't work correctly, as we can't fill them
with valid AFBC contents. For now, don't use AFBC for modeset buffers.
Remove this after we make ozone/drm capable of creating valid AFBC
modeset buffers (tracked by crbug.com/852675).

Bug: 852675, 853328, b/109782243
Test: External monitor works on Kevin

Change-Id: I902f2615aa78e34251381f87e25c5e76f39b94b5
Reviewed-on: https://chromium-review.googlesource.com/1100666
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
Cr-Commit-Position: refs/heads/master@{#568024}
parent 67dc1b41
......@@ -2,4 +2,6 @@ include_rules = [
"-ui/ozone/platform/drm",
"+ui/ozone/platform/drm/common",
"+ui/ozone/platform/drm/gpu",
# TODO remove this once AFBC works for modesetting buffers.
"+third_party/libdrm/src/include/drm/drm_fourcc.h",
]
......@@ -11,6 +11,7 @@
#include "base/logging.h"
#include "base/trace_event/trace_event.h"
#include "third_party/libdrm/src/include/drm/drm_fourcc.h"
#include "third_party/skia/include/core/SkCanvas.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/size.h"
......@@ -162,6 +163,23 @@ std::vector<uint64_t> HardwareDisplayController::GetFormatModifiers(
return modifiers;
}
std::vector<uint64_t>
HardwareDisplayController::GetFormatModifiersForModesetting(
uint32_t fourcc_format) {
const auto& modifiers = GetFormatModifiers(fourcc_format);
std::vector<uint64_t> filtered_modifiers;
for (auto modifier : modifiers) {
// AFBC for modeset buffers doesn't work correctly, as we can't fill it with
// a valid AFBC buffer. For now, don't use AFBC for modeset buffers.
// TODO: Use AFBC for modeset buffers if it is available.
// See https://crbug.com/852675.
if (modifier != DRM_FORMAT_MOD_CHROMEOS_ROCKCHIP_AFBC) {
filtered_modifiers.push_back(modifier);
}
}
return filtered_modifiers;
}
bool HardwareDisplayController::SetCursor(
const scoped_refptr<ScanoutBuffer>& buffer) {
bool status = true;
......
......@@ -127,6 +127,14 @@ class HardwareDisplayController {
// controller.
std::vector<uint64_t> GetFormatModifiers(uint32_t fourcc_format);
// Return the supported modifiers for |fourcc_format| for this
// controller to be used for modeset buffers. Currently, this only exists
// because we can't provide valid AFBC buffers during modeset.
// See https://crbug.com/852675
// TODO: Remove this.
std::vector<uint64_t> GetFormatModifiersForModesetting(
uint32_t fourcc_format);
// Set the hardware cursor to show the contents of |surface|.
bool SetCursor(const scoped_refptr<ScanoutBuffer>& buffer);
......
......@@ -352,7 +352,8 @@ OverlayPlane ScreenManager::GetModesetBuffer(
gfx::BufferFormat format = display::DisplaySnapshot::PrimaryFormat();
uint32_t fourcc_format = ui::GetFourCCFormatForOpaqueFramebuffer(format);
const auto& modifiers = controller->GetFormatModifiers(fourcc_format);
const auto& modifiers =
controller->GetFormatModifiersForModesetting(fourcc_format);
if (window) {
const OverlayPlane* primary = window->GetLastModesetBuffer();
const DrmDevice* drm = controller->GetAllocationDrmDevice().get();
......
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