Change information
Commit message:
[agy][ozone/drm] Validate protected NativePixmap
GbmSurfaceFactory::CreateNativePixmapFromHandle() may substitute a
previously registered protected NativePixmap for the supplied handle,
but did not check that the substituted pixmap's size and format match
what the caller requested. The caller (OzoneImageBackingFactory) builds
the resulting backing with the requested geometry, so a mismatch would
bind an inconsistent size/format to the underlying dmabuf when later
imported into Vulkan or EGL.
Reject the import when the substituted protected pixmap does not match
the requested size or format, and add unit coverage for the
protected-pixmap delegate path.
Fixed: 501762862
Test: ozone_unittests --gtest_filter=GbmSurfaceFactoryTest.*
Change-Id: I611686a36ed834eed3c7842dbafdafdb7bc8b75d
Cr-Commit-Position: refs/heads/main@{#1665803}
Files:
- M ui/ozone/platform/drm/BUILD.gn
- M ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
- A ui/ozone/platform/drm/gpu/gbm_surface_factory_unittest.cc
Change size: M
Delta: 3 files changed, 100 insertions(+), 1 deletion(-)
Branch: refs/heads/main
Submit Requirements:
Code-Review: +1 by Kramer Ge