drm: attach an encoder.
[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  * @dpms: set power state (see drm_crtc_funcs above)
370  * @save: save output state
371  * @restore: restore output state
372  * @mode_valid: is this mode valid on the given output?
373  * @mode_fixup: try to fixup proposed mode for this output
374  * @mode_set: set this mode
375  * @detect: is this output active?
376  * @get_modes: get mode list for this output
377  * @set_property: property for this output may need update
378  * @destroy: make object go away
379  *
380  * Each CRTC may have one or more outputs attached to it.  The functions
381  * below allow the core DRM code to control outputs, enumerate available modes,
382  * etc.
383  */
384 struct drm_output_funcs {
385         void (*dpms)(struct drm_output *output, int mode);
386         void (*save)(struct drm_output *output);
387         void (*restore)(struct drm_output *output);
388         enum drm_output_status (*detect)(struct drm_output *output);
389         int (*get_modes)(struct drm_output *output);
390         bool (*set_property)(struct drm_output *output, struct drm_property *property,
391                              uint64_t val);
392         void (*destroy)(struct drm_output *output);
393         int (*mode_valid)(struct drm_output *output,
394                           struct drm_display_mode *mode);
395
396 };
397
398 struct drm_encoder_funcs {
399         void (*destroy)(struct drm_encoder *encoder);
400 };
401
402 #define DRM_OUTPUT_MAX_UMODES 16
403 #define DRM_OUTPUT_MAX_PROPERTY 16
404 #define DRM_OUTPUT_LEN 32
405 #define DRM_OUTPUT_MAX_ENCODER 2
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         void *helper_private;
421 };
422
423 /**
424  * drm_output - central DRM output control structure
425  * @crtc: CRTC this output is currently connected to, NULL if none
426  * @possible_crtcs: bitmap of CRTCS this output could be attached to
427  * @possible_clones: bitmap of possible outputs this output could clone
428  * @interlace_allowed: can this output handle interlaced modes?
429  * @doublescan_allowed: can this output handle doublescan?
430  * @available_modes: modes available on this output (from get_modes() + user)
431  * @initial_x: initial x position for this output
432  * @initial_y: initial y position for this output
433  * @status: output connected?
434  * @funcs: output control functions
435  *
436  * Each output may be connected to one or more CRTCs, or may be clonable by
437  * another output if they can share a CRTC.  Each output also has a specific
438  * position in the broader display (referred to as a 'screen' though it could
439  * span multiple monitors).
440  */
441 struct drm_output {
442         struct drm_device *dev;
443         struct device kdev;
444         struct device_attribute *attr;
445         struct list_head head;
446         struct drm_crtc *crtc;
447         int id; /* idr assigned */
448
449         int output_type;
450         int output_type_id;
451         unsigned long possible_crtcs;
452         unsigned long possible_clones;
453         bool interlace_allowed;
454         bool doublescan_allowed;
455         struct list_head modes; /* list of modes on this output */
456
457         int initial_x, initial_y;
458         enum drm_output_status status;
459
460         /* these are modes added by probing with DDC or the BIOS */
461         struct list_head probed_modes;
462         
463         struct drm_display_info display_info;
464         const struct drm_output_funcs *funcs;
465
466         struct list_head user_modes;
467         struct drm_property_blob *edid_blob_ptr;
468         u32 property_ids[DRM_OUTPUT_MAX_PROPERTY];
469         uint64_t property_values[DRM_OUTPUT_MAX_PROPERTY];
470
471         void *helper_private;
472
473         u32 encoder_ids[DRM_OUTPUT_MAX_ENCODER];
474 };
475
476 /**
477  * struct drm_mode_set
478  *
479  * Represents a single crtc the outputs that it drives with what mode
480  * and from which framebuffer it scans out from.
481  *
482  * This is used to set modes.
483  */
484 struct drm_mode_set
485 {
486         struct drm_framebuffer *fb;
487         struct drm_crtc *crtc;
488         struct drm_display_mode *mode;
489
490         uint32_t x;
491         uint32_t y;
492
493         struct drm_output **outputs;
494         size_t num_outputs;
495 };
496
497 /**
498  * struct drm_mode_config_funcs - configure CRTCs for a given screen layout
499  * @resize: adjust CRTCs as necessary for the proposed layout
500  *
501  * Currently only a resize hook is available.  DRM will call back into the
502  * driver with a new screen width and height.  If the driver can't support
503  * the proposed size, it can return false.  Otherwise it should adjust
504  * the CRTC<->output mappings as needed and update its view of the screen.
505  */
506 struct drm_mode_config_funcs {
507         bool (*resize_fb)(struct drm_device *dev, struct drm_framebuffer *fb);
508 };
509
510 /**
511  * drm_mode_config - Mode configuration control structure
512  *
513  */
514 struct drm_mode_config {
515         struct mutex mutex; /* protects configuration and IDR */
516         struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, output, modes - just makes life easier */
517         /* this is limited to one for now */
518         int num_fb;
519         struct list_head fb_list;
520         int num_output;
521         struct list_head output_list;
522         int num_encoder;
523         struct list_head encoder_list;
524
525         int num_crtc;
526         struct list_head crtc_list;
527
528         struct list_head property_list;
529
530         int min_width, min_height;
531         int max_width, max_height;
532         struct drm_mode_config_funcs *funcs;
533         unsigned long fb_base;
534
535         /* pointers to standard properties */
536         struct list_head property_blob_list;
537         struct drm_property *edid_property;
538         struct drm_property *dpms_property;
539         struct drm_property *connector_type_property;
540         struct drm_property *connector_num_property;
541
542         /* TV properties */
543         struct drm_property *tv_mode_property;
544         struct drm_property *tv_left_margin_property;
545         struct drm_property *tv_right_margin_property;
546         struct drm_property *tv_top_margin_property;
547         struct drm_property *tv_bottom_margin_property;
548
549         /* hotplug */
550         uint32_t hotplug_counter;
551 };
552
553
554 extern void drm_crtc_init(struct drm_device *dev,
555                           struct drm_crtc *crtc,
556                           const struct drm_crtc_funcs *funcs);
557 extern void drm_crtc_cleanup(struct drm_crtc *crtc);
558
559 extern void drm_output_init(struct drm_device *dev,
560                             struct drm_output *output,
561                             const struct drm_output_funcs *funcs,
562                             int output_type);
563
564 extern void drm_output_cleanup(struct drm_output *output);
565
566 extern void drm_encoder_init(struct drm_device *dev,
567                              struct drm_encoder *encoder,
568                              const struct drm_encoder_funcs *funcs,
569                              int encoder_type);
570
571 extern void drm_encoder_cleanup(struct drm_encoder *encoder);
572
573 extern char *drm_get_output_name(struct drm_output *output);
574 extern char *drm_get_dpms_name(int val);
575 extern void drm_fb_release(struct file *filp);
576
577 extern struct edid *drm_get_edid(struct drm_output *output,
578                                  struct i2c_adapter *adapter);
579 extern int drm_add_edid_modes(struct drm_output *output, struct edid *edid);
580 extern void drm_mode_probed_add(struct drm_output *output, struct drm_display_mode *mode);
581 extern void drm_mode_remove(struct drm_output *output, struct drm_display_mode *mode);
582 extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
583                                                    struct drm_display_mode *mode);
584 extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode);
585 extern void drm_mode_config_init(struct drm_device *dev);
586 extern void drm_mode_config_cleanup(struct drm_device *dev);
587 extern void drm_mode_set_name(struct drm_display_mode *mode);
588 extern bool drm_mode_equal(struct drm_display_mode *mode1, struct drm_display_mode *mode2);
589 extern void drm_disable_unused_functions(struct drm_device *dev);
590
591 /* for us by fb module */
592 extern int drm_mode_attachmode_crtc(struct drm_device *dev,
593                                     struct drm_crtc *crtc,
594                                     struct drm_display_mode *mode);
595 extern int drm_mode_detachmode_crtc(struct drm_device *dev, struct drm_display_mode *mode);
596
597 extern struct drm_display_mode *drm_mode_create(struct drm_device *dev);
598 extern void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
599 extern void drm_mode_list_concat(struct list_head *head,
600                                  struct list_head *new);
601 extern void drm_mode_validate_size(struct drm_device *dev,
602                                    struct list_head *mode_list,
603                                    int maxX, int maxY, int maxPitch);
604 extern void drm_mode_prune_invalid(struct drm_device *dev,
605                                    struct list_head *mode_list, bool verbose);
606 extern void drm_mode_sort(struct list_head *mode_list);
607 extern int drm_mode_vrefresh(struct drm_display_mode *mode);
608 extern void drm_mode_set_crtcinfo(struct drm_display_mode *p,
609                                   int adjust_flags);
610 extern void drm_mode_output_list_update(struct drm_output *output);
611 extern int drm_mode_output_update_edid_property(struct drm_output *output,
612                                                 struct edid *edid);
613 extern int drm_output_property_set_value(struct drm_output *output,
614                                          struct drm_property *property,
615                                          uint64_t value);
616 extern int drm_output_property_get_value(struct drm_output *output,
617                                          struct drm_property *property,
618                                          uint64_t *value);
619 extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev);
620 extern void drm_framebuffer_set_object(struct drm_device *dev,
621                                        unsigned long handle);
622 extern struct drm_framebuffer *drm_framebuffer_create(struct drm_device *dev);
623 extern void drm_framebuffer_destroy(struct drm_framebuffer *fb);
624 extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
625 extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
626 extern void drm_crtc_probe_output_modes(struct drm_device *dev, int maxX, int maxY);
627 extern bool drm_crtc_in_use(struct drm_crtc *crtc);
628
629 extern int drm_output_attach_property(struct drm_output *output,
630                                       struct drm_property *property, uint64_t init_val);
631 extern struct drm_property *drm_property_create(struct drm_device *dev, int flags,
632                                                 const char *name, int num_values);
633 extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
634 extern int drm_property_add_enum(struct drm_property *property, int index, 
635                                  uint64_t value, const char *name);
636 extern bool drm_create_tv_properties(struct drm_device *dev, int num_formats,
637                                      char *formats[]);
638
639 extern int drm_mode_output_attach_encoder(struct drm_output *output,
640                                           struct drm_encoder *encoder);
641 extern void drm_mode_output_detach_encoder(struct drm_output *output,
642                                            struct drm_encoder *encoder);
643
644 /* IOCTLs */
645 extern int drm_mode_getresources(struct drm_device *dev,
646                                  void *data, struct drm_file *file_priv);
647
648 extern int drm_mode_getcrtc(struct drm_device *dev,
649                             void *data, struct drm_file *file_priv);
650 extern int drm_mode_getoutput(struct drm_device *dev,
651                               void *data, struct drm_file *file_priv);
652 extern int drm_mode_setcrtc(struct drm_device *dev,
653                             void *data, struct drm_file *file_priv);
654 extern int drm_mode_cursor_ioctl(struct drm_device *dev,
655                                 void *data, struct drm_file *file_priv);
656 extern int drm_mode_addfb(struct drm_device *dev,
657                           void *data, struct drm_file *file_priv);
658 extern int drm_mode_rmfb(struct drm_device *dev,
659                          void *data, struct drm_file *file_priv);
660 extern int drm_mode_getfb(struct drm_device *dev,
661                           void *data, struct drm_file *file_priv);
662 extern int drm_mode_addmode_ioctl(struct drm_device *dev,
663                                   void *data, struct drm_file *file_priv);
664 extern int drm_mode_rmmode_ioctl(struct drm_device *dev,
665                                  void *data, struct drm_file *file_priv);
666 extern int drm_mode_attachmode_ioctl(struct drm_device *dev,
667                                      void *data, struct drm_file *file_priv);
668 extern int drm_mode_detachmode_ioctl(struct drm_device *dev,
669                                      void *data, struct drm_file *file_priv);
670
671 extern int drm_mode_getproperty_ioctl(struct drm_device *dev,
672                                       void *data, struct drm_file *file_priv);
673 extern int drm_mode_getblob_ioctl(struct drm_device *dev,
674                                   void *data, struct drm_file *file_priv);
675 extern int drm_mode_output_property_set_ioctl(struct drm_device *dev,
676                                               void *data, struct drm_file *file_priv);
677 extern int drm_mode_hotplug_ioctl(struct drm_device *dev,
678                                   void *data, struct drm_file *file_priv);
679 extern int drm_mode_replacefb(struct drm_device *dev,
680                               void *data, struct drm_file *file_priv);
681 int drm_mode_getencoder(struct drm_device *dev,
682                         void *data, struct drm_file *file_priv);
683 #endif /* __DRM_CRTC_H__ */
684