aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drmP.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/drm/drmP.h')
-rw-r--r--include/drm/drmP.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index e336e3901876..4e58137c1882 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -135,6 +135,7 @@ struct dma_buf_attachment;
135#define DRM_UT_PRIME 0x08 135#define DRM_UT_PRIME 0x08
136#define DRM_UT_ATOMIC 0x10 136#define DRM_UT_ATOMIC 0x10
137#define DRM_UT_VBL 0x20 137#define DRM_UT_VBL 0x20
138#define DRM_UT_STATE 0x40
138 139
139extern __printf(6, 7) 140extern __printf(6, 7)
140void drm_dev_printk(const struct device *dev, const char *level, 141void drm_dev_printk(const struct device *dev, const char *level,
@@ -306,6 +307,27 @@ void drm_printk(const char *level, unsigned int category,
306#define DRM_DEBUG_PRIME_RATELIMITED(fmt, args...) \ 307#define DRM_DEBUG_PRIME_RATELIMITED(fmt, args...) \
307 DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##args) 308 DRM_DEV_DEBUG_PRIME_RATELIMITED(NULL, fmt, ##args)
308 309
310/* Format strings and argument splitters to simplify printing
311 * various "complex" objects
312 */
313#define DRM_MODE_FMT "%d:\"%s\" %d %d %d %d %d %d %d %d %d %d 0x%x 0x%x"
314#define DRM_MODE_ARG(m) \
315 (m)->base.id, (m)->name, (m)->vrefresh, (m)->clock, \
316 (m)->hdisplay, (m)->hsync_start, (m)->hsync_end, (m)->htotal, \
317 (m)->vdisplay, (m)->vsync_start, (m)->vsync_end, (m)->vtotal, \
318 (m)->type, (m)->flags
319
320#define DRM_RECT_FMT "%dx%d%+d%+d"
321#define DRM_RECT_ARG(r) drm_rect_width(r), drm_rect_height(r), (r)->x1, (r)->y1
322
323/* for rect's in fixed-point format: */
324#define DRM_RECT_FP_FMT "%d.%06ux%d.%06u%+d.%06u%+d.%06u"
325#define DRM_RECT_FP_ARG(r) \
326 drm_rect_width(r) >> 16, ((drm_rect_width(r) & 0xffff) * 15625) >> 10, \
327 drm_rect_height(r) >> 16, ((drm_rect_height(r) & 0xffff) * 15625) >> 10, \
328 (r)->x1 >> 16, (((r)->x1 & 0xffff) * 15625) >> 10, \
329 (r)->y1 >> 16, (((r)->y1 & 0xffff) * 15625) >> 10
330
309/*@}*/ 331/*@}*/
310 332
311/***********************************************************************/ 333/***********************************************************************/
@@ -941,8 +963,13 @@ static inline bool drm_is_primary_client(const struct drm_file *file_priv)
941extern int drm_ioctl_permit(u32 flags, struct drm_file *file_priv); 963extern int drm_ioctl_permit(u32 flags, struct drm_file *file_priv);
942extern long drm_ioctl(struct file *filp, 964extern long drm_ioctl(struct file *filp,
943 unsigned int cmd, unsigned long arg); 965 unsigned int cmd, unsigned long arg);
966#ifdef CONFIG_COMPAT
944extern long drm_compat_ioctl(struct file *filp, 967extern long drm_compat_ioctl(struct file *filp,
945 unsigned int cmd, unsigned long arg); 968 unsigned int cmd, unsigned long arg);
969#else
970/* Let drm_compat_ioctl be assigned to .compat_ioctl unconditionally */
971#define drm_compat_ioctl NULL
972#endif
946extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags); 973extern bool drm_ioctl_flags(unsigned int nr, unsigned int *flags);
947 974
948/* File Operations (drm_fops.c) */ 975/* File Operations (drm_fops.c) */