aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_crtc.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r--include/drm/drm_crtc.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index f32c5cd51f41..8f3dee097579 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -30,6 +30,7 @@
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/idr.h> 31#include <linux/idr.h>
32#include <linux/fb.h> 32#include <linux/fb.h>
33#include <linux/hdmi.h>
33#include <drm/drm_mode.h> 34#include <drm/drm_mode.h>
34 35
35#include <drm/drm_fourcc.h> 36#include <drm/drm_fourcc.h>
@@ -181,6 +182,7 @@ struct drm_display_mode {
181 182
182 int vrefresh; /* in Hz */ 183 int vrefresh; /* in Hz */
183 int hsync; /* in kHz */ 184 int hsync; /* in kHz */
185 enum hdmi_picture_aspect picture_aspect_ratio;
184}; 186};
185 187
186static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode) 188static inline bool drm_mode_is_stereo(const struct drm_display_mode *mode)
@@ -447,7 +449,7 @@ struct drm_crtc {
447 uint16_t *gamma_store; 449 uint16_t *gamma_store;
448 450
449 /* Constants needed for precise vblank and swap timestamping. */ 451 /* Constants needed for precise vblank and swap timestamping. */
450 s64 framedur_ns, linedur_ns, pixeldur_ns; 452 int framedur_ns, linedur_ns, pixeldur_ns;
451 453
452 /* if you are using the helper */ 454 /* if you are using the helper */
453 void *helper_private; 455 void *helper_private;
@@ -905,6 +907,9 @@ struct drm_mode_config {
905 907
906 /* whether async page flip is supported or not */ 908 /* whether async page flip is supported or not */
907 bool async_page_flip; 909 bool async_page_flip;
910
911 /* cursor size */
912 uint32_t cursor_width, cursor_height;
908}; 913};
909 914
910#define obj_to_crtc(x) container_of(x, struct drm_crtc, base) 915#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
@@ -929,6 +934,19 @@ extern int drm_crtc_init(struct drm_device *dev,
929 struct drm_crtc *crtc, 934 struct drm_crtc *crtc,
930 const struct drm_crtc_funcs *funcs); 935 const struct drm_crtc_funcs *funcs);
931extern void drm_crtc_cleanup(struct drm_crtc *crtc); 936extern void drm_crtc_cleanup(struct drm_crtc *crtc);
937extern unsigned int drm_crtc_index(struct drm_crtc *crtc);
938
939/**
940 * drm_crtc_mask - find the mask of a registered CRTC
941 * @crtc: CRTC to find mask for
942 *
943 * Given a registered CRTC, return the mask bit of that CRTC for an
944 * encoder's possible_crtcs field.
945 */
946static inline uint32_t drm_crtc_mask(struct drm_crtc *crtc)
947{
948 return 1 << drm_crtc_index(crtc);
949}
932 950
933extern void drm_connector_ida_init(void); 951extern void drm_connector_ida_init(void);
934extern void drm_connector_ida_destroy(void); 952extern void drm_connector_ida_destroy(void);
@@ -950,6 +968,19 @@ extern int drm_encoder_init(struct drm_device *dev,
950 const struct drm_encoder_funcs *funcs, 968 const struct drm_encoder_funcs *funcs,
951 int encoder_type); 969 int encoder_type);
952 970
971/**
972 * drm_encoder_crtc_ok - can a given crtc drive a given encoder?
973 * @encoder: encoder to test
974 * @crtc: crtc to test
975 *
976 * Return false if @encoder can't be driven by @crtc, true otherwise.
977 */
978static inline bool drm_encoder_crtc_ok(struct drm_encoder *encoder,
979 struct drm_crtc *crtc)
980{
981 return !!(encoder->possible_crtcs & drm_crtc_mask(crtc));
982}
983
953extern int drm_plane_init(struct drm_device *dev, 984extern int drm_plane_init(struct drm_device *dev,
954 struct drm_plane *plane, 985 struct drm_plane *plane,
955 unsigned long possible_crtcs, 986 unsigned long possible_crtcs,