History

drm: Reject unknown legacy bpp and depth for drm_mode_addfb ioctl

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}

Chris Wilson committed 8 years ago

Commit 70109351 parent 6960e6d3 files · +36 −11Browse files

Showing the changes to include/uapi/drm (1 of 3 files). Show all

Unified · Split

include/uapi/drm/drm_fourcc.h+3−0
@@ -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

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t