diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2011-11-14 17:51:28 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2011-11-15 14:53:23 -0500 |
commit | 308e5bcbdb10452e8aba31aa21432fb67ee46d72 (patch) | |
tree | 5e4eebef07685c4047f54d1727fc9bcbace8889d /include/drm/drm_mode.h | |
parent | 8cf5c9177151537e73ff1816540e4ba24b174391 (diff) |
drm: add an fb creation ioctl that takes a pixel format v5
To properly support the various plane formats supported by different
hardware, the kernel must know the pixel format of a framebuffer object.
So add a new ioctl taking a format argument corresponding to a fourcc
name from the new drm_fourcc.h header file. Implement the fb creation
hooks in terms of the new mode_fb_cmd2 using helpers where the old
bpp/depth values are needed.
v2: create DRM specific fourcc header file for sharing with libdrm etc
v3: fix rebase failure and use DRM fourcc codes in intel_display.c and
update commit message
v4: make fb_cmd2 handle field into an array for multi-object formats
pull in Ville's fix for the memcpy in drm_plane_init
apply Ville's cleanup to zero out fb_cmd2 arg in drm_mode_addfb
v5: add 'flags' field for interlaced support (from Ville)
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Reviewed-by: Rob Clark <rob.clark@linaro.org>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drm_mode.h')
-rw-r--r-- | include/drm/drm_mode.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 44576a54dc3b..95d7aad5cad3 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h | |||
@@ -268,6 +268,33 @@ struct drm_mode_fb_cmd { | |||
268 | __u32 handle; | 268 | __u32 handle; |
269 | }; | 269 | }; |
270 | 270 | ||
271 | #define DRM_MODE_FB_INTERLACED (1<<0 /* for interlaced framebuffers */ | ||
272 | |||
273 | struct drm_mode_fb_cmd2 { | ||
274 | __u32 fb_id; | ||
275 | __u32 width, height; | ||
276 | __u32 pixel_format; /* fourcc code from drm_fourcc.h */ | ||
277 | __u32 flags; /* see above flags */ | ||
278 | |||
279 | /* | ||
280 | * In case of planar formats, this ioctl allows up to 4 | ||
281 | * buffer objects with offets and pitches per plane. | ||
282 | * The pitch and offset order is dictated by the fourcc, | ||
283 | * e.g. NV12 (http://fourcc.org/yuv.php#NV12) is described as: | ||
284 | * | ||
285 | * YUV 4:2:0 image with a plane of 8 bit Y samples | ||
286 | * followed by an interleaved U/V plane containing | ||
287 | * 8 bit 2x2 subsampled colour difference samples. | ||
288 | * | ||
289 | * So it would consist of Y as offset[0] and UV as | ||
290 | * offeset[1]. Note that offset[0] will generally | ||
291 | * be 0. | ||
292 | */ | ||
293 | __u32 handles[4]; | ||
294 | __u32 pitches[4]; /* pitch for each plane */ | ||
295 | __u32 offsets[4]; /* offset of each plane */ | ||
296 | }; | ||
297 | |||
271 | #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 | 298 | #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 |
272 | #define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 | 299 | #define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 |
273 | #define DRM_MODE_FB_DIRTY_FLAGS 0x03 | 300 | #define DRM_MODE_FB_DIRTY_FLAGS 0x03 |