1
0
Fork 0

drm_hwcomposer: Remove cursor buffor validity check

This change removes a check in DrmPlane::IsValidForLayer which would
verify that the buffer size matches known accepted values from the
DRM_CAP_CURSOR or SIZE_HINTS properties. Those properties are required
to return valid buffer sizes for committing to the cursor plane, but
they are not meant to be exhaustive. As a result, this check was
returning false negatives, and forcing the cursor into client
composition unnecessarily. The intended usage is that these props
should be checked during buffer allocation, not during composition.
Instead, test commits are sufficient for detecting whether a buffer
is valid for the cursor plane, and triggering fallback logic as needed.

Change-Id: Iae14436a6f50e45a113a4d18de67e73810b2a83e
Signed-off-by: Andrew Wolfers <aswolfers@google.com>
This commit is contained in:
Andrew Wolfers 2025-06-20 14:10:45 +00:00
parent e5f755f842
commit f35210964c
2 changed files with 0 additions and 27 deletions

View file

@ -227,13 +227,6 @@ bool DrmPlane::IsValidForLayer(LayerData *layer) {
return false;
}
if (type_ == DRM_PLANE_TYPE_CURSOR &&
!IsBufferValidForCursorPlane(layer->bi.value())) {
ALOGV("Buffer size %dx%d is not supported by cursor plane %d",
layer->bi->width, layer->bi->height, GetId());
return false;
}
return true;
}
@ -410,21 +403,4 @@ auto DrmPlane::GetPlaneProperty(const char *prop_name, DrmProperty &property,
return true;
}
bool DrmPlane::HasCursorSizeConstraints() const {
return drm_->GetCapCursorSize().has_value() || !size_hints_.empty();
}
bool DrmPlane::IsBufferValidForCursorPlane(const BufferInfo &bi) const {
if (std::find_if(size_hints_.begin(), size_hints_.end(),
[&](const auto &hint) -> bool {
return bi.width == hint.width && bi.height == hint.height;
}) != size_hints_.end()) {
return true;
}
const auto &cap_size = drm_->GetCapCursorSize();
return cap_size.has_value() && bi.width == cap_size->first &&
bi.height == cap_size->second;
}
} // namespace android

View file

@ -66,8 +66,6 @@ class DrmPlane : public PipelineBindable<DrmPlane> {
return plane_->plane_id;
}
bool HasCursorSizeConstraints() const;
private:
DrmPlane(DrmDevice &dev, DrmModePlaneUnique plane)
: drm_(&dev), plane_(std::move(plane)){};
@ -79,7 +77,6 @@ class DrmPlane : public PipelineBindable<DrmPlane> {
auto Init() -> int;
auto GetPlaneProperty(const char *prop_name, DrmProperty &property,
Presence presence = Presence::kMandatory) -> bool;
bool IsBufferValidForCursorPlane(const BufferInfo &bi) const;
uint32_t type_{};