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_crtc.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_crtc.h')
-rw-r--r-- | include/drm/drm_crtc.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index e20867ed7c90..a2fbf3399682 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -29,9 +29,10 @@ | |||
29 | #include <linux/spinlock.h> | 29 | #include <linux/spinlock.h> |
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/idr.h> | 31 | #include <linux/idr.h> |
32 | |||
33 | #include <linux/fb.h> | 32 | #include <linux/fb.h> |
34 | 33 | ||
34 | #include <drm/drm_fourcc.h> | ||
35 | |||
35 | struct drm_device; | 36 | struct drm_device; |
36 | struct drm_mode_set; | 37 | struct drm_mode_set; |
37 | struct drm_framebuffer; | 38 | struct drm_framebuffer; |
@@ -246,6 +247,7 @@ struct drm_framebuffer { | |||
246 | unsigned int depth; | 247 | unsigned int depth; |
247 | int bits_per_pixel; | 248 | int bits_per_pixel; |
248 | int flags; | 249 | int flags; |
250 | uint32_t pixel_format; /* fourcc format */ | ||
249 | struct list_head filp_head; | 251 | struct list_head filp_head; |
250 | /* if you are using the helper */ | 252 | /* if you are using the helper */ |
251 | void *helper_private; | 253 | void *helper_private; |
@@ -619,7 +621,7 @@ struct drm_mode_set { | |||
619 | * struct drm_mode_config_funcs - configure CRTCs for a given screen layout | 621 | * struct drm_mode_config_funcs - configure CRTCs for a given screen layout |
620 | */ | 622 | */ |
621 | struct drm_mode_config_funcs { | 623 | struct drm_mode_config_funcs { |
622 | struct drm_framebuffer *(*fb_create)(struct drm_device *dev, struct drm_file *file_priv, struct drm_mode_fb_cmd *mode_cmd); | 624 | struct drm_framebuffer *(*fb_create)(struct drm_device *dev, struct drm_file *file_priv, struct drm_mode_fb_cmd2 *mode_cmd); |
623 | void (*output_poll_changed)(struct drm_device *dev); | 625 | void (*output_poll_changed)(struct drm_device *dev); |
624 | }; | 626 | }; |
625 | 627 | ||
@@ -837,6 +839,9 @@ extern int drm_mode_cursor_ioctl(struct drm_device *dev, | |||
837 | void *data, struct drm_file *file_priv); | 839 | void *data, struct drm_file *file_priv); |
838 | extern int drm_mode_addfb(struct drm_device *dev, | 840 | extern int drm_mode_addfb(struct drm_device *dev, |
839 | void *data, struct drm_file *file_priv); | 841 | void *data, struct drm_file *file_priv); |
842 | extern int drm_mode_addfb2(struct drm_device *dev, | ||
843 | void *data, struct drm_file *file_priv); | ||
844 | extern uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth); | ||
840 | extern int drm_mode_rmfb(struct drm_device *dev, | 845 | extern int drm_mode_rmfb(struct drm_device *dev, |
841 | void *data, struct drm_file *file_priv); | 846 | void *data, struct drm_file *file_priv); |
842 | extern int drm_mode_getfb(struct drm_device *dev, | 847 | extern int drm_mode_getfb(struct drm_device *dev, |