Hash :
9ded03b4
Author :
Date :
2022-12-20T07:09:36
Revert "Vulkan: Make available GLInternalFormatToGbmFourCCFormat" This reverts commit 402e7f7a634b1170d0feae52a44168731a7489f9. Reason for revert: Chromium android-binary-size build failed. Original change's description: > Vulkan: Make available GLInternalFormatToGbmFourCCFormat > > GLInternalFormatToGbmFourCCFormat() is not available on Linux > because of the guard with the wrong definition, ANGLE_USES_GBM. > This also fixes build errors that were occurred after enabling. > > Bug: angleproject:7829 > Change-Id: If7c7543270cc127945149927be0fc3ffdd49163b > Signed-off-by: Sungyong Choi <sywow.choi@samsung.com> > Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4022963 > Reviewed-by: Jamie Madill <jmadill@chromium.org> > Reviewed-by: Jeff Vigil <j.vigil@samsung.com> > Commit-Queue: mohan maiya <m.maiya@samsung.com> > Reviewed-by: mohan maiya <m.maiya@samsung.com> > Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Bug: angleproject:7901 Bug: angleproject:7829 Change-Id: I256d51f78ff0d3ced9920c3ea1d2bfceba43a1ee Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4113577 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Commit-Queue: Yuxin Hu <yuxinhu@google.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125
//
// Copyright The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
// DmaBufImageSiblingEGL.cpp: Defines the DmaBufImageSiblingEGL to wrap EGL images
// created from dma_buf objects
#include "libANGLE/renderer/gl/egl/DmaBufImageSiblingEGL.h"
#include "common/linux/dma_buf_utils.h"
namespace rx
{
DmaBufImageSiblingEGL::DmaBufImageSiblingEGL(const egl::AttributeMap &attribs)
: mAttribs(attribs), mFormat(GL_NONE), mYUV(false), mHasProtectedContent(false)
{
ASSERT(mAttribs.contains(EGL_WIDTH));
mSize.width = mAttribs.getAsInt(EGL_WIDTH);
ASSERT(mAttribs.contains(EGL_HEIGHT));
mSize.height = mAttribs.getAsInt(EGL_HEIGHT);
mSize.depth = 1;
mHasProtectedContent = false;
int fourCCFormat = mAttribs.getAsInt(EGL_LINUX_DRM_FOURCC_EXT);
GLenum internalFormat = angle::DrmFourCCFormatToGLInternalFormat(fourCCFormat, &mYUV);
// These ANGLE formats are used exclusively with the Vulkan backend.
if (internalFormat == GL_RGBX8_ANGLE || internalFormat == GL_BGRX8_ANGLEX)
{
internalFormat = GL_RGB8;
}
mFormat = gl::Format(internalFormat);
}
DmaBufImageSiblingEGL::~DmaBufImageSiblingEGL() {}
egl::Error DmaBufImageSiblingEGL::initialize(const egl::Display *display)
{
return egl::NoError();
}
gl::Format DmaBufImageSiblingEGL::getFormat() const
{
return mFormat;
}
bool DmaBufImageSiblingEGL::isRenderable(const gl::Context *context) const
{
return true;
}
bool DmaBufImageSiblingEGL::isTexturable(const gl::Context *context) const
{
return true;
}
bool DmaBufImageSiblingEGL::isYUV() const
{
return mYUV;
}
bool DmaBufImageSiblingEGL::hasProtectedContent() const
{
return mHasProtectedContent;
}
gl::Extents DmaBufImageSiblingEGL::getSize() const
{
return mSize;
}
size_t DmaBufImageSiblingEGL::getSamples() const
{
return 0;
}
EGLClientBuffer DmaBufImageSiblingEGL::getBuffer() const
{
return nullptr;
}
void DmaBufImageSiblingEGL::getImageCreationAttributes(std::vector<EGLint> *outAttributes) const
{
EGLenum kForwardedAttribs[] = {EGL_WIDTH,
EGL_HEIGHT,
EGL_PROTECTED_CONTENT_EXT,
EGL_LINUX_DRM_FOURCC_EXT,
EGL_DMA_BUF_PLANE0_FD_EXT,
EGL_DMA_BUF_PLANE0_OFFSET_EXT,
EGL_DMA_BUF_PLANE0_PITCH_EXT,
EGL_DMA_BUF_PLANE1_FD_EXT,
EGL_DMA_BUF_PLANE1_OFFSET_EXT,
EGL_DMA_BUF_PLANE1_PITCH_EXT,
EGL_DMA_BUF_PLANE2_FD_EXT,
EGL_DMA_BUF_PLANE2_OFFSET_EXT,
EGL_DMA_BUF_PLANE2_PITCH_EXT,
EGL_YUV_COLOR_SPACE_HINT_EXT,
EGL_SAMPLE_RANGE_HINT_EXT,
EGL_YUV_CHROMA_HORIZONTAL_SITING_HINT_EXT,
EGL_YUV_CHROMA_VERTICAL_SITING_HINT_EXT,
EGL_DMA_BUF_PLANE0_MODIFIER_LO_EXT,
EGL_DMA_BUF_PLANE0_MODIFIER_HI_EXT,
EGL_DMA_BUF_PLANE1_MODIFIER_LO_EXT,
EGL_DMA_BUF_PLANE1_MODIFIER_HI_EXT,
EGL_DMA_BUF_PLANE2_MODIFIER_LO_EXT,
EGL_DMA_BUF_PLANE2_MODIFIER_HI_EXT,
EGL_DMA_BUF_PLANE3_FD_EXT,
EGL_DMA_BUF_PLANE3_OFFSET_EXT,
EGL_DMA_BUF_PLANE3_PITCH_EXT,
EGL_DMA_BUF_PLANE3_MODIFIER_LO_EXT,
EGL_DMA_BUF_PLANE3_MODIFIER_HI_EXT};
for (EGLenum forwardedAttrib : kForwardedAttribs)
{
if (mAttribs.contains(forwardedAttrib))
{
outAttributes->push_back(forwardedAttrib);
outAttributes->push_back(mAttribs.getAsInt(forwardedAttrib));
}
}
}
} // namespace rx