#include "dma_buf_utils.h"
#include "common/debug.h"
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <array>
namespace angle
{
GLenum DrmFourCCFormatToGLInternalFormat(int fourccFormat, bool *isYUV)
{ … }
#if defined(ANGLE_ENABLE_VULKAN)
std::vector<int> VkFormatToDrmFourCCFormat(VkFormat format)
{ … }
std::vector<VkFormat> DrmFourCCFormatToVkFormats(int fourccFormat)
{ … }
#endif
#if defined(ANGLE_PLATFORM_LINUX) && defined(ANGLE_USES_GBM)
# include <gbm.h>
int GLInternalFormatToGbmFourCCFormat(GLenum internalFormat)
{
switch (internalFormat)
{
case GL_R8:
return GBM_FORMAT_R8;
case GL_RGB8:
return GBM_FORMAT_GR88;
case GL_RGB565:
return GBM_FORMAT_RGB565;
case GL_RGBA8:
return GBM_FORMAT_ABGR8888;
case GL_BGRA8_EXT:
return GBM_FORMAT_ARGB8888;
case GL_BGRX8_ANGLEX:
return GBM_FORMAT_XRGB8888;
case GL_RGBX8_ANGLE:
return GBM_FORMAT_XBGR8888;
case GL_RGB10_A2:
return GBM_FORMAT_ABGR2101010;
default:
WARN() << "Unknown internalFormat: " << internalFormat << ". Treating as 0";
return 0;
}
}
#endif
}