Since this is handling user provided bpp and depth, we need to sanity check and propagate the EINVAL back rather than assume what the insane client intended and fill the logs with DRM_ERROR. v2: Check both bpp and depth match the builtin pixel format, and introduce a canonical DRM_FORMAT_INVALID to reserve 0 against any future fourcc. v3: Mark up DRM_FORMAT_C8 as being {bpp:8, depth:8}
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -71,6 +71,9 @@ extern "C" { · 70 unmodified lines | |||
| 71 | 71 | ||
| 72 | #define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */ | 72 | #define DRM_FORMAT_BIG_ENDIAN (1<<31) /* format is big endian instead of little endian */ |
| 73 | 73 | ||
| 74 | /* Reserve 0 for the invalid format specifier */ | ||
| 75 | #define DRM_FORMAT_INVALID 0 | ||
| 76 | |||
| 74 | /* color index */ | 77 | /* color index */ |
| 75 | #define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ | 78 | #define DRM_FORMAT_C8 fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ |
| 76 | 79 | ||