7bb779efd779fb7f9becca6e1868b3ad9413b2e1
[platform/upstream/libdrm.git] / linux-core / drm_crtc.h
1 /*
2  * Copyright © 2006 Keith Packard
3  * Copyright © 2007 Intel Corporation
4  *   Jesse Barnes <jesse.barnes@intel.com>
5  */
6 #ifndef __DRM_CRTC_H__
7 #define __DRM_CRTC_H__
8
9 #include <linux/i2c.h>
10 #include <linux/spinlock.h>
11 #include <linux/types.h>
12 #include <linux/idr.h>
13
14 #include <linux/fb.h>
15
16 struct drm_device;
17 struct drm_mode_set;
18
19 /*
20  * Note on terminology:  here, for brevity and convenience, we refer to output
21  * control chips as 'CRTCs'.  They can control any type of output, VGA, LVDS,
22  * DVI, etc.  And 'screen' refers to the whole of the visible display, which
23  * may span multiple monitors (and therefore multiple CRTC and output
24  * structures).
25  */
26
27 enum drm_mode_status {
28     MODE_OK     = 0,    /* Mode OK */
29     MODE_HSYNC,         /* hsync out of range */
30     MODE_VSYNC,         /* vsync out of range */
31     MODE_H_ILLEGAL,     /* mode has illegal horizontal timings */
32     MODE_V_ILLEGAL,     /* mode has illegal horizontal timings */
33     MODE_BAD_WIDTH,     /* requires an unsupported linepitch */
34     MODE_NOMODE,        /* no mode with a maching name */
35     MODE_NO_INTERLACE,  /* interlaced mode not supported */
36     MODE_NO_DBLESCAN,   /* doublescan mode not supported */
37     MODE_NO_VSCAN,      /* multiscan mode not supported */
38     MODE_MEM,           /* insufficient video memory */
39     MODE_VIRTUAL_X,     /* mode width too large for specified virtual size */
40     MODE_VIRTUAL_Y,     /* mode height too large for specified virtual size */
41     MODE_MEM_VIRT,      /* insufficient video memory given virtual size */
42     MODE_NOCLOCK,       /* no fixed clock available */
43     MODE_CLOCK_HIGH,    /* clock required is too high */
44     MODE_CLOCK_LOW,     /* clock required is too low */
45     MODE_CLOCK_RANGE,   /* clock/mode isn't in a ClockRange */
46     MODE_BAD_HVALUE,    /* horizontal timing was out of range */
47     MODE_BAD_VVALUE,    /* vertical timing was out of range */
48     MODE_BAD_VSCAN,     /* VScan value out of range */
49     MODE_HSYNC_NARROW,  /* horizontal sync too narrow */
50     MODE_HSYNC_WIDE,    /* horizontal sync too wide */
51     MODE_HBLANK_NARROW, /* horizontal blanking too narrow */
52     MODE_HBLANK_WIDE,   /* horizontal blanking too wide */
53     MODE_VSYNC_NARROW,  /* vertical sync too narrow */
54     MODE_VSYNC_WIDE,    /* vertical sync too wide */
55     MODE_VBLANK_NARROW, /* vertical blanking too narrow */
56     MODE_VBLANK_WIDE,   /* vertical blanking too wide */
57     MODE_PANEL,         /* exceeds panel dimensions */
58     MODE_INTERLACE_WIDTH, /* width too large for interlaced mode */
59     MODE_ONE_WIDTH,     /* only one width is supported */
60     MODE_ONE_HEIGHT,    /* only one height is supported */
61     MODE_ONE_SIZE,      /* only one resolution is supported */
62     MODE_NO_REDUCED,    /* monitor doesn't accept reduced blanking */
63     MODE_UNVERIFIED = -3, /* mode needs to reverified */
64     MODE_BAD = -2,      /* unspecified reason */
65     MODE_ERROR  = -1    /* error condition */
66 };
67
68 #define DRM_MODE_TYPE_CLOCK_CRTC_C (DRM_MODE_TYPE_CLOCK_C | \
69                                     DRM_MODE_TYPE_CRTC_C)
70
71 #define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \
72         .name = nm, .status = 0, .type = (t), .clock = (c), \
73         .hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
74         .htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
75         .vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
76         .vscan = (vs), .flags = (f), .vrefresh = 0
77
78 struct drm_display_mode {
79         /* Header */
80         struct list_head head;
81         char name[DRM_DISPLAY_MODE_LEN];
82         int mode_id;
83         int output_count;
84         enum drm_mode_status status;
85         int type;
86
87         /* Proposed mode values */
88         int clock;
89         int hdisplay;
90         int hsync_start;
91         int hsync_end;
92         int htotal;
93         int hskew;
94         int vdisplay;
95         int vsync_start;
96         int vsync_end;
97         int vtotal;
98         int vscan;
99         unsigned int flags;
100
101         /* Actual mode we give to hw */
102         int clock_index;
103         int synth_clock;
104         int crtc_hdisplay;
105         int crtc_hblank_start;
106         int crtc_hblank_end;
107         int crtc_hsync_start;
108         int crtc_hsync_end;
109         int crtc_htotal;
110         int crtc_hskew;
111         int crtc_vdisplay;
112         int crtc_vblank_start;
113         int crtc_vblank_end;
114         int crtc_vsync_start;
115         int crtc_vsync_end;
116         int crtc_vtotal;
117         int crtc_hadjusted;
118         int crtc_vadjusted;
119
120         /* Driver private mode info */
121         int private_size;
122         int *private;
123         int private_flags;
124
125         int vrefresh;
126         float hsync;
127 };
128
129 /* Video mode flags */
130 #define V_PHSYNC        (1<<0)
131 #define V_NHSYNC        (1<<1)
132 #define V_PVSYNC        (1<<2)
133 #define V_NVSYNC        (1<<3)
134 #define V_INTERLACE     (1<<4)
135 #define V_DBLSCAN       (1<<5)
136 #define V_CSYNC         (1<<6)
137 #define V_PCSYNC        (1<<7)
138 #define V_NCSYNC        (1<<8)
139 #define V_HSKEW         (1<<9) /* hskew provided */
140 #define V_BCAST         (1<<10)
141 #define V_PIXMUX        (1<<11)
142 #define V_DBLCLK        (1<<12)
143 #define V_CLKDIV2       (1<<13)
144
145 #define CRTC_INTERLACE_HALVE_V 0x1 /* halve V values for interlacing */
146
147 #define DPMSModeOn 0
148 #define DPMSModeStandby 1
149 #define DPMSModeSuspend 2
150 #define DPMSModeOff 3
151
152 #define ConnectorUnknown 0
153 #define ConnectorVGA 1
154 #define ConnectorDVII 2
155 #define ConnectorDVID 3
156 #define ConnectorDVIA 4
157 #define ConnectorComposite 5
158 #define ConnectorSVIDEO 6
159 #define ConnectorLVDS 7
160 #define ConnectorComponent 8
161 #define Connector9PinDIN 9
162 #define ConnectorDisplayPort 10
163 #define ConnectorHDMIA 11
164 #define ConnectorHDMIB 12
165
166 enum drm_output_status {
167         output_status_connected = 1,
168         output_status_disconnected = 2,
169         output_status_unknown = 3,
170 };
171
172 enum subpixel_order {
173         SubPixelUnknown = 0,
174         SubPixelHorizontalRGB,
175         SubPixelHorizontalBGR,
176         SubPixelVerticalRGB,
177         SubPixelVerticalBGR,
178         SubPixelNone,
179 };
180
181 /*
182  * Describes a given display (e.g. CRT or flat panel) and its limitations.
183  */
184 struct drm_display_info {
185         char name[DRM_DISPLAY_INFO_LEN];
186         /* Input info */
187         bool serration_vsync;
188         bool sync_on_green;
189         bool composite_sync;
190         bool separate_syncs;
191         bool blank_to_black;
192         unsigned char video_level;
193         bool digital;
194         /* Physical size */
195         unsigned int width_mm;
196         unsigned int height_mm;
197
198         /* Display parameters */
199         unsigned char gamma; /* FIXME: storage format */
200         bool gtf_supported;
201         bool standard_color;
202         enum {
203                 monochrome = 0,
204                 rgb,
205                 other,
206                 unknown,
207         } display_type;
208         bool active_off_supported;
209         bool suspend_supported;
210         bool standby_supported;
211
212         /* Color info FIXME: storage format */
213         unsigned short redx, redy;
214         unsigned short greenx, greeny;
215         unsigned short bluex, bluey;
216         unsigned short whitex, whitey;
217
218         /* Clock limits FIXME: storage format */
219         unsigned int min_vfreq, max_vfreq;
220         unsigned int min_hfreq, max_hfreq;
221         unsigned int pixel_clock;
222
223         /* White point indices FIXME: storage format */
224         unsigned int wpx1, wpy1;
225         unsigned int wpgamma1;
226         unsigned int wpx2, wpy2;
227         unsigned int wpgamma2;
228
229         enum subpixel_order subpixel_order;
230
231         /* Preferred mode (if any) */
232         struct drm_display_mode *preferred_mode;
233         char *raw_edid; /* if any */
234 };
235
236 struct drm_framebuffer {
237         struct drm_device *dev;
238         struct list_head head;
239         int id; /* idr assigned */
240         unsigned int pitch;
241         unsigned int width;
242         unsigned int height;
243         /* depth can be 15 or 16 */
244         unsigned int depth;
245         int bits_per_pixel;
246         int flags;
247         struct drm_buffer_object *bo;
248         void *fbdev;
249         u32 pseudo_palette[17];
250         struct drm_bo_kmap_obj kmap;
251         struct list_head filp_head;
252 };
253
254 struct drm_property_blob {
255         struct list_head head;
256         unsigned int length;
257         unsigned int id;
258         void *data;
259 };
260
261 struct drm_property_enum {
262         uint64_t value;
263         struct list_head head;
264         char name[DRM_PROP_NAME_LEN];
265 };
266
267 struct drm_property {
268         struct list_head head;
269         int id; /* idr assigned */
270         uint32_t flags;
271         char name[DRM_PROP_NAME_LEN];
272         uint32_t num_values;
273         uint64_t *values;
274
275         struct list_head enum_blob_list;
276 };
277
278 struct drm_crtc;
279 struct drm_output;
280 struct drm_encoder;
281
282 /**
283  * drm_crtc_funcs - control CRTCs for a given device
284  * @dpms: control display power levels
285  * @save: save CRTC state
286  * @resore: restore CRTC state
287  * @lock: lock the CRTC
288  * @unlock: unlock the CRTC
289  * @shadow_allocate: allocate shadow pixmap
290  * @shadow_create: create shadow pixmap for rotation support
291  * @shadow_destroy: free shadow pixmap
292  * @mode_fixup: fixup proposed mode
293  * @mode_set: set the desired mode on the CRTC
294  * @gamma_set: specify color ramp for CRTC
295  * @destroy: deinit and free object.
296  *
297  * The drm_crtc_funcs structure is the central CRTC management structure
298  * in the DRM.  Each CRTC controls one or more outputs (note that the name
299  * CRTC is simply historical, a CRTC may control LVDS, VGA, DVI, TV out, etc.
300  * outputs, not just CRTs).
301  *
302  * Each driver is responsible for filling out this structure at startup time,
303  * in addition to providing other modesetting features, like i2c and DDC
304  * bus accessors.
305  */
306 struct drm_crtc_funcs {
307         /*
308          * Control power levels on the CRTC.  If the mode passed in is
309          * unsupported, the provider must use the next lowest power level.
310          */
311         void (*dpms)(struct drm_crtc *crtc, int mode);
312
313         /* Save CRTC state */
314         void (*save)(struct drm_crtc *crtc); /* suspend? */
315         /* Restore CRTC state */
316         void (*restore)(struct drm_crtc *crtc); /* resume? */
317
318         /* cursor controls */
319         int (*cursor_set)(struct drm_crtc *crtc, struct drm_buffer_object *bo,
320                           uint32_t width, uint32_t height);
321         int (*cursor_move)(struct drm_crtc *crtc, int x, int y);
322
323         /* Set gamma on the CRTC */
324         void (*gamma_set)(struct drm_crtc *crtc, u16 r, u16 g, u16 b,
325                           int regno);
326         /* Object destroy routine */
327         void (*destroy)(struct drm_crtc *crtc);
328
329         int (*set_config)(struct drm_mode_set *set);
330 };
331
332 /**
333  * drm_crtc - central CRTC control structure
334  * @enabled: is this CRTC enabled?
335  * @x: x position on screen
336  * @y: y position on screen
337  * @desired_mode: new desired mode
338  * @desired_x: desired x for desired_mode
339  * @desired_y: desired y for desired_mode
340  * @funcs: CRTC control functions
341  *
342  * Each CRTC may have one or more outputs associated with it.  This structure
343  * allows the CRTC to be controlled.
344  */
345 struct drm_crtc {
346         struct drm_device *dev;
347         struct list_head head;
348
349         int id; /* idr assigned */
350
351         /* framebuffer the output is currently bound to */
352         struct drm_framebuffer *fb;
353
354         bool enabled;
355
356         struct drm_display_mode mode;
357
358         int x, y;
359         struct drm_display_mode *desired_mode;
360         int desired_x, desired_y;
361         const struct drm_crtc_funcs *funcs;
362
363         /* if you are using the helper */
364         void *helper_private;
365 };
366
367 /**
368  * drm_output_funcs - control outputs on a given device
369  * @init: setup this output
370  * @dpms: set power state (see drm_crtc_funcs above)
371  * @save: save output state
372  * @restore: restore output state
373  * @mode_valid: is this mode valid on the given output?
374  * @mode_fixup: try to fixup proposed mode for this output
375  * @mode_set: set this mode
376  * @detect: is this output active?
377  * @get_modes: get mode list for this output
378  * @set_property: property for this output may need update
379  * @destroy: make object go away
380  *
381  * Each CRTC may have one or more outputs attached to it.  The functions
382  * below allow the core DRM code to control outputs, enumerate available modes,
383  * etc.
384  */
385 struct drm_output_funcs {
386         void (*dpms)(struct drm_output *output, int mode);
387         void (*save)(struct drm_output *output);
388         void (*restore)(struct drm_output *output);
389         enum drm_output_status (*detect)(struct drm_output *output);
390         int (*get_modes)(struct drm_output *output);
391         bool (*set_property)(struct drm_output *output, struct drm_property *property,
392                              uint64_t val);
393         void (*destroy)(struct drm_output *output);
394         int (*mode_valid)(struct drm_output *output,
395                           struct drm_display_mode *mode);
396
397 };
398
399 struct drm_encoder_funcs {
400         void (*destroy)(struct drm_encoder *encoder);
401 };
402
403 #define DRM_OUTPUT_MAX_UMODES 16
404 #define DRM_OUTPUT_MAX_PROPERTY 16
405 #define DRM_OUTPUT_LEN 32
406
407 /**
408  * drm_encoder - central DRM encoder structure 
409  */
410 struct drm_encoder {
411         struct drm_device *dev;
412         struct list_head head;
413
414         int id;
415         int encoder_type;
416         uint32_t possible_crtcs;
417         uint32_t possible_clones;
418
419         const struct drm_encoder_funcs *funcs;
420 };
421
422 /**
423  * drm_output - central DRM output control structure
424  * @crtc: CRTC this output is currently connected to, NULL if none
425  * @possible_crtcs: bitmap of CRTCS this output could be attached to
426  * @possible_clones: bitmap of possible outputs this output could clone
427  * @interlace_allowed: can this output handle interlaced modes?
428  * @doublescan_allowed: can this output handle doublescan?
429  * @available_modes: modes available on this output (from get_modes() + user)
430  * @initial_x: initial x position for this output
431  * @initial_y: initial y position for this output
432  * @status: output connected?
433  * @funcs: output control functions
434  *
435  * Each output may be connected to one or more CRTCs, or may be clonable by
436  * another output if they can share a CRTC.  Each output also has a specific
437  * position in the broader display (referred to as a 'screen' though it could
438  * span multiple monitors).
439  */
440 struct drm_output {
441         struct drm_device *dev;
442         struct device kdev;
443         struct device_attribute *attr;
444         struct list_head head;
445         struct drm_crtc *crtc;
446         int id; /* idr assigned */
447
448         int output_type;
449         int output_type_id;
450         unsigned long possible_crtcs;
451         unsigned long possible_clones;
452         bool interlace_allowed;
453         bool doublescan_allowed;
454         struct list_head modes; /* list of modes on this output */
455
456         int initial_x, initial_y;
457         enum drm_output_status status;
458
459         /* these are modes added by probing with DDC or the BIOS */
460         struct list_head probed_modes;
461         
462         struct drm_display_info display_info;
463         const struct drm_output_funcs *funcs;
464
465         struct list_head user_modes;
466         struct drm_property_blob *edid_blob_ptr;
467         u32 property_ids[DRM_OUTPUT_MAX_PROPERTY];
468         uint64_t property_values[DRM_OUTPUT_MAX_PROPERTY];
469
470         void *helper_private;
471 };
472
473 /**
474  * struct drm_mode_set
475  *
476  * Represents a single crtc the outputs that it drives with what mode
477  * and from which framebuffer it scans out from.
478  *
479  * This is used to set modes.
480  */
481 struct drm_mode_set
482 {
483         struct drm_framebuffer *fb;
484         struct drm_crtc *crtc;
485         struct drm_display_mode *mode;
486
487         uint32_t x;
488         uint32_t y;
489
490         struct drm_output **outputs;
491         size_t num_outputs;
492 };
493
494 /**
495  * struct drm_mode_config_funcs - configure CRTCs for a given screen layout
496  * @resize: adjust CRTCs as necessary for the proposed layout
497  *
498  * Currently only a resize hook is available.  DRM will call back into the
499  * driver with a new screen width and height.  If the driver can't support
500  * the proposed size, it can return false.  Otherwise it should adjust
501  * the CRTC<->output mappings as needed and update its view of the screen.
502  */
503 struct drm_mode_config_funcs {
504         bool (*resize_fb)(struct drm_device *dev, struct drm_framebuffer *fb);
505 };
506
507 /**
508  * drm_mode_config - Mode configuration control structure
509  *
510  */
511 struct drm_mode_config {
512         struct mutex mutex; /* protects configuration and IDR */
513         struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, output, modes - just makes life easier */
514         /* this is limited to one for now */
515         int num_fb;
516         struct list_head fb_list;
517         int num_output;
518         struct list_head output_list;
519         int num_encoder;
520         struct list_head encoder_list;
521
522         int num_crtc;
523         struct list_head crtc_list;
524
525         struct list_head property_list;
526
527         int min_width, min_height;
528         int max_width, max_height;
529         struct drm_mode_config_funcs *funcs;
530         unsigned long fb_base;
531
532         /* pointers to standard properties */
533         struct list_head property_blob_list;
534         struct drm_property *edid_property;
535         struct drm_property *dpms_property;
536         struct drm_property *connector_type_property;
537         struct drm_property *connector_num_property;
538
539         /* TV properties */
540         struct drm_property *tv_mode_property;
541         struct drm_property *tv_left_margin_property;
542         struct drm_property *tv_right_margin_property;
543         struct drm_property *tv_top_margin_property;
544         struct drm_property *tv_bottom_margin_property;
545
546         /* hotplug */
547         uint32_t hotplug_counter;
548 };
549
550
551 extern void drm_crtc_init(struct drm_device *dev,
552                           struct drm_crtc *crtc,
553                           const struct drm_crtc_funcs *funcs);
554 extern void drm_crtc_cleanup(struct drm_crtc *crtc);
555
556 void drm_output_init(struct drm_device *dev,
557                      struct drm_output *output,
558                      const struct drm_output_funcs *funcs,
559                      int output_type);
560
561 void drm_output_cleanup(struct drm_output *output);
562
563 extern char *drm_get_output_name(struct drm_output *output);
564 extern char *drm_get_dpms_name(int val);
565 extern void drm_fb_release(struct file *filp);
566
567 extern struct edid *drm_get_edid(struct drm_output *output,
568                                  struct i2c_adapter *adapter);
569 extern int drm_add_edid_modes(struct drm_output *output, struct edid *edid);
570 extern void drm_mode_probed_add(struct drm_output *output, struct drm_display_mode *mode);
571 extern void drm_mode_remove(struct drm_output *output, struct drm_display_mode *mode);
572 extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
573                                                    struct drm_display_mode *mode);
574 extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode);
575 extern void drm_mode_config_init(struct drm_device *dev);
576 extern void drm_mode_config_cleanup(struct drm_device *dev);
577 extern void drm_mode_set_name(struct drm_display_mode *mode);
578 extern bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2);
579 extern void drm_disable_unused_functions(struct drm_device *dev);
580
581 /* for us by fb module */
582 extern int drm_mode_attachmode_crtc(struct drm_device *dev,
583                                     struct drm_crtc *crtc,
584                                     struct drm_display_mode *mode);
585 extern int drm_mode_detachmode_crtc(struct drm_device *dev, struct drm_display_mode *mode);
586
587 extern struct drm_display_mode *drm_mode_create(struct drm_device *dev);
588 extern void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
589 extern void drm_mode_list_concat(struct list_head *head,
590                                  struct list_head *new);
591 extern void drm_mode_validate_size(struct drm_device *dev,
592                                    struct list_head *mode_list,
593                                    int maxX, int maxY, int maxPitch);
594 extern void drm_mode_prune_invalid(struct drm_device *dev,
595                                    struct list_head *mode_list, bool verbose);
596 extern void drm_mode_sort(struct list_head *mode_list);
597 extern int drm_mode_vrefresh(struct drm_display_mode *mode);
598 extern void drm_mode_set_crtcinfo(struct drm_display_mode *p,
599                                   int adjust_flags);
600 extern void drm_mode_output_list_update(struct drm_output *output);
601 extern int drm_mode_output_update_edid_property(struct drm_output *output,
602                                                 struct edid *edid);
603 extern int drm_output_property_set_value(struct drm_output *output,
604                                          struct drm_property *property,
605                                          uint64_t value);
606 extern int drm_output_property_get_value(struct drm_output *output,
607                                          struct drm_property *property,
608                                          uint64_t *value);
609 extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev);
610 extern void drm_framebuffer_set_object(struct drm_device *dev,
611                                        unsigned long handle);
612 extern struct drm_framebuffer *drm_framebuffer_create(struct drm_device *dev);
613 extern void drm_framebuffer_destroy(struct drm_framebuffer *fb);
614 extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
615 extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
616 extern void drm_crtc_probe_output_modes(struct drm_device *dev, int maxX, int maxY);
617 extern bool drm_crtc_in_use(struct drm_crtc *crtc);
618
619 extern int drm_output_attach_property(struct drm_output *output,
620                                       struct drm_property *property, uint64_t init_val);
621 extern struct drm_property *drm_property_create(struct drm_device *dev, int flags,
622                                                 const char *name, int num_values);
623 extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
624 extern int drm_property_add_enum(struct drm_property *property, int index, 
625                                  uint64_t value, const char *name);
626 extern bool drm_create_tv_properties(struct drm_device *dev, int num_formats,
627                                      char *formats[]);
628
629 /* IOCTLs */
630 extern int drm_mode_getresources(struct drm_device *dev,
631                                  void *data, struct drm_file *file_priv);
632
633 extern int drm_mode_getcrtc(struct drm_device *dev,
634                             void *data, struct drm_file *file_priv);
635 extern int drm_mode_getoutput(struct drm_device *dev,
636                               void *data, struct drm_file *file_priv);
637 extern int drm_mode_setcrtc(struct drm_device *dev,
638                             void *data, struct drm_file *file_priv);
639 extern int drm_mode_cursor_ioctl(struct drm_device *dev,
640                                 void *data, struct drm_file *file_priv);
641 extern int drm_mode_addfb(struct drm_device *dev,
642                           void *data, struct drm_file *file_priv);
643 extern int drm_mode_rmfb(struct drm_device *dev,
644                          void *data, struct drm_file *file_priv);
645 extern int drm_mode_getfb(struct drm_device *dev,
646                           void *data, struct drm_file *file_priv);
647 extern int drm_mode_addmode_ioctl(struct drm_device *dev,
648                                   void *data, struct drm_file *file_priv);
649 extern int drm_mode_rmmode_ioctl(struct drm_device *dev,
650                                  void *data, struct drm_file *file_priv);
651 extern int drm_mode_attachmode_ioctl(struct drm_device *dev,
652                                      void *data, struct drm_file *file_priv);
653 extern int drm_mode_detachmode_ioctl(struct drm_device *dev,
654                                      void *data, struct drm_file *file_priv);
655
656 extern int drm_mode_getproperty_ioctl(struct drm_device *dev,
657                                       void *data, struct drm_file *file_priv);
658 extern int drm_mode_getblob_ioctl(struct drm_device *dev,
659                                   void *data, struct drm_file *file_priv);
660 extern int drm_mode_output_property_set_ioctl(struct drm_device *dev,
661                                               void *data, struct drm_file *file_priv);
662 extern int drm_mode_hotplug_ioctl(struct drm_device *dev,
663                                   void *data, struct drm_file *file_priv);
664 extern int drm_mode_replacefb(struct drm_device *dev,
665                               void *data, struct drm_file *file_priv);
666 #endif /* __DRM_CRTC_H__ */
667