Subversion Repositories Kolibri OS

Rev

Rev 2967 | Rev 3192 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2967 Rev 3031
Line 28... Line 28...
28
#include 
28
#include 
29
#include 
29
#include 
30
#include 
30
#include 
31
#include 
31
#include 
32
#include 
32
#include 
-
 
33
#include 
Line 33... Line 34...
33
 
34
 
Line 34... Line 35...
34
#include 
35
#include 
35
 
36
 
36
struct drm_device;
37
struct drm_device;
-
 
38
struct drm_mode_set;
Line 37... Line 39...
37
struct drm_mode_set;
39
struct drm_framebuffer;
38
struct drm_framebuffer;
40
struct drm_object_properties;
39
 
41
 
Line 48... Line 50...
48
#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
50
#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
Line 49... Line 51...
49
 
51
 
50
struct drm_mode_object {
52
struct drm_mode_object {
51
	uint32_t id;
53
	uint32_t id;
-
 
54
	uint32_t type;
-
 
55
	struct drm_object_properties *properties;
-
 
56
};
-
 
57
 
-
 
58
#define DRM_OBJECT_MAX_PROPERTY 24
-
 
59
struct drm_object_properties {
-
 
60
	int count;
-
 
61
	uint32_t ids[DRM_OBJECT_MAX_PROPERTY];
52
	uint32_t type;
62
	uint64_t values[DRM_OBJECT_MAX_PROPERTY];
Line 53... Line 63...
53
};
63
};
54
 
64
 
55
/*
65
/*
Line 107... Line 117...
107
#define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \
117
#define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \
108
	.name = nm, .status = 0, .type = (t), .clock = (c), \
118
	.name = nm, .status = 0, .type = (t), .clock = (c), \
109
	.hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
119
	.hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
110
	.htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
120
	.htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
111
	.vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
121
	.vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
112
	.vscan = (vs), .flags = (f), .vrefresh = 0
122
	.vscan = (vs), .flags = (f), .vrefresh = 0, \
-
 
123
	.base.type = DRM_MODE_OBJECT_MODE
Line 113... Line 124...
113
 
124
 
Line 114... Line 125...
114
#define CRTC_INTERLACE_HALVE_V 0x1 /* halve V values for interlacing */
125
#define CRTC_INTERLACE_HALVE_V 0x1 /* halve V values for interlacing */
115
 
126
 
Line 119... Line 130...
119
	struct drm_mode_object base;
130
	struct drm_mode_object base;
Line 120... Line 131...
120
 
131
 
Line 121... Line 132...
121
	char name[DRM_DISPLAY_MODE_LEN];
132
	char name[DRM_DISPLAY_MODE_LEN];
122
 
133
 
Line 123... Line 134...
123
	enum drm_mode_status status;
134
	enum drm_mode_status status;
124
	int type;
135
	unsigned int type;
125
 
136
 
126
	/* Proposed mode values */
137
	/* Proposed mode values */
Line 155... Line 166...
155
	int crtc_vblank_start;
166
	int crtc_vblank_start;
156
	int crtc_vblank_end;
167
	int crtc_vblank_end;
157
	int crtc_vsync_start;
168
	int crtc_vsync_start;
158
	int crtc_vsync_end;
169
	int crtc_vsync_end;
159
	int crtc_vtotal;
170
	int crtc_vtotal;
160
	int crtc_hadjusted;
-
 
161
	int crtc_vadjusted;
-
 
Line 162... Line 171...
162
 
171
 
163
	/* Driver private mode info */
172
	/* Driver private mode info */
164
	int private_size;
173
	int private_size;
165
	int *private;
174
	int *private;
Line 205... Line 214...
205
 
214
 
206
	enum subpixel_order subpixel_order;
215
	enum subpixel_order subpixel_order;
Line 207... Line 216...
207
	u32 color_formats;
216
	u32 color_formats;
208
 
-
 
209
	u8 cea_rev;
-
 
210
 
217
 
Line 211... Line 218...
211
	char *raw_edid; /* if any */
218
	u8 cea_rev;
-
 
219
};
212
};
220
 
213
 
221
struct drm_framebuffer_funcs {
214
struct drm_framebuffer_funcs {
222
	/* note: use drm_framebuffer_remove() */
215
	void (*destroy)(struct drm_framebuffer *framebuffer);
223
	void (*destroy)(struct drm_framebuffer *framebuffer);
216
	int (*create_handle)(struct drm_framebuffer *fb,
224
	int (*create_handle)(struct drm_framebuffer *fb,
Line 255... Line 263...
255
 
263
 
256
struct drm_property_blob {
264
struct drm_property_blob {
257
	struct drm_mode_object base;
265
	struct drm_mode_object base;
258
	struct list_head head;
266
	struct list_head head;
259
	unsigned int length;
267
	unsigned int length;
260
	void *data;
268
	unsigned char data[];
Line 261... Line 269...
261
};
269
};
262
 
270
 
263
struct drm_property_enum {
271
struct drm_property_enum {
Line 283... Line 291...
283
struct drm_pending_vblank_event;
291
struct drm_pending_vblank_event;
284
struct drm_plane;
292
struct drm_plane;
Line 285... Line 293...
285
 
293
 
286
/**
294
/**
287
 * drm_crtc_funcs - control CRTCs for a given device
-
 
288
 * @reset: reset CRTC after state has been invalidate (e.g. resume)
-
 
289
 * @dpms: control display power levels
295
 * drm_crtc_funcs - control CRTCs for a given device
290
 * @save: save CRTC state
296
 * @save: save CRTC state
291
 * @resore: restore CRTC state
-
 
292
 * @lock: lock the CRTC
-
 
293
 * @unlock: unlock the CRTC
-
 
294
 * @shadow_allocate: allocate shadow pixmap
297
 * @restore: restore CRTC state
295
 * @shadow_create: create shadow pixmap for rotation support
298
 * @reset: reset CRTC after state has been invalidate (e.g. resume)
296
 * @shadow_destroy: free shadow pixmap
299
 * @cursor_set: setup the cursor
297
 * @mode_fixup: fixup proposed mode
-
 
298
 * @mode_set: set the desired mode on the CRTC
300
 * @cursor_move: move the cursor
299
 * @gamma_set: specify color ramp for CRTC
301
 * @gamma_set: specify color ramp for CRTC
-
 
302
 * @destroy: deinit and free object
-
 
303
 * @set_property: called when a property is changed
-
 
304
 * @set_config: apply a new CRTC configuration
300
 * @destroy: deinit and free object.
305
 * @page_flip: initiate a page flip
301
 *
306
 *
302
 * The drm_crtc_funcs structure is the central CRTC management structure
307
 * The drm_crtc_funcs structure is the central CRTC management structure
303
 * in the DRM.  Each CRTC controls one or more connectors (note that the name
308
 * in the DRM.  Each CRTC controls one or more connectors (note that the name
304
 * CRTC is simply historical, a CRTC may control LVDS, VGA, DVI, TV out, etc.
309
 * CRTC is simply historical, a CRTC may control LVDS, VGA, DVI, TV out, etc.
Line 339... Line 344...
339
	 * completes, otherwise it will be NULL.
344
	 * completes, otherwise it will be NULL.
340
	 */
345
	 */
341
	int (*page_flip)(struct drm_crtc *crtc,
346
	int (*page_flip)(struct drm_crtc *crtc,
342
			 struct drm_framebuffer *fb,
347
			 struct drm_framebuffer *fb,
343
			 struct drm_pending_vblank_event *event);
348
			 struct drm_pending_vblank_event *event);
-
 
349
 
-
 
350
	int (*set_property)(struct drm_crtc *crtc,
-
 
351
			    struct drm_property *property, uint64_t val);
344
};
352
};
Line 345... Line 353...
345
 
353
 
346
/**
354
/**
347
 * drm_crtc - central CRTC control structure
355
 * drm_crtc - central CRTC control structure
348
 * @dev: parent DRM device
356
 * @dev: parent DRM device
349
 * @head: list management
357
 * @head: list management
350
 * @base: base KMS object for ID tracking etc.
358
 * @base: base KMS object for ID tracking etc.
351
 * @enabled: is this CRTC enabled?
359
 * @enabled: is this CRTC enabled?
352
 * @mode: current mode timings
360
 * @mode: current mode timings
-
 
361
 * @hwmode: mode timings as programmed to hw regs
-
 
362
 * @invert_dimensions: for purposes of error checking crtc vs fb sizes,
-
 
363
 *    invert the width/height of the crtc.  This is used if the driver
353
 * @hwmode: mode timings as programmed to hw regs
364
 *    is performing 90 or 270 degree rotated scanout
354
 * @x: x position on screen
365
 * @x: x position on screen
355
 * @y: y position on screen
366
 * @y: y position on screen
356
 * @funcs: CRTC control functions
367
 * @funcs: CRTC control functions
357
 * @gamma_size: size of gamma ramp
368
 * @gamma_size: size of gamma ramp
358
 * @gamma_store: gamma ramp values
369
 * @gamma_store: gamma ramp values
359
 * @framedur_ns: precise frame timing
370
 * @framedur_ns: precise frame timing
360
 * @framedur_ns: precise line timing
371
 * @framedur_ns: precise line timing
361
 * @pixeldur_ns: precise pixel timing
372
 * @pixeldur_ns: precise pixel timing
-
 
373
 * @helper_private: mid-layer private data
362
 * @helper_private: mid-layer private data
374
 * @properties: property tracking for this CRTC
363
 *
375
 *
364
 * Each CRTC may have one or more connectors associated with it.  This structure
376
 * Each CRTC may have one or more connectors associated with it.  This structure
365
 * allows the CRTC to be controlled.
377
 * allows the CRTC to be controlled.
366
 */
378
 */
Line 381... Line 393...
381
	/* Programmed mode in hw, after adjustments for encoders,
393
	/* Programmed mode in hw, after adjustments for encoders,
382
	 * crtc, panel scaling etc. Needed for timestamping etc.
394
	 * crtc, panel scaling etc. Needed for timestamping etc.
383
	 */
395
	 */
384
	struct drm_display_mode hwmode;
396
	struct drm_display_mode hwmode;
Line -... Line 397...
-
 
397
 
-
 
398
	bool invert_dimensions;
385
 
399
 
386
	int x, y;
400
	int x, y;
Line 387... Line 401...
387
	const struct drm_crtc_funcs *funcs;
401
	const struct drm_crtc_funcs *funcs;
388
 
402
 
Line 393... Line 407...
393
	/* Constants needed for precise vblank and swap timestamping. */
407
	/* Constants needed for precise vblank and swap timestamping. */
394
	s64 framedur_ns, linedur_ns, pixeldur_ns;
408
	s64 framedur_ns, linedur_ns, pixeldur_ns;
Line 395... Line 409...
395
 
409
 
396
	/* if you are using the helper */
410
	/* if you are using the helper */
-
 
411
	void *helper_private;
-
 
412
 
397
	void *helper_private;
413
	struct drm_object_properties properties;
Line 398... Line 414...
398
};
414
};
399
 
415
 
400
 
416
 
401
/**
417
/**
402
 * drm_connector_funcs - control connectors on a given device
418
 * drm_connector_funcs - control connectors on a given device
403
 * @dpms: set power state (see drm_crtc_funcs above)
419
 * @dpms: set power state (see drm_crtc_funcs above)
404
 * @save: save connector state
-
 
405
 * @restore: restore connector state
-
 
406
 * @reset: reset connector after state has been invalidate (e.g. resume)
-
 
407
 * @mode_valid: is this mode valid on the given connector?
420
 * @save: save connector state
408
 * @mode_fixup: try to fixup proposed mode for this connector
421
 * @restore: restore connector state
409
 * @mode_set: set this mode
422
 * @reset: reset connector after state has been invalidate (e.g. resume)
410
 * @detect: is this connector active?
423
 * @detect: is this connector active?
411
 * @get_modes: get mode list for this connector
424
 * @fill_modes: fill mode list for this connector
412
 * @set_property: property for this connector may need update
425
 * @set_property: property for this connector may need update
413
 * @destroy: make object go away
426
 * @destroy: make object go away
Line 449... Line 462...
449
	void (*reset)(struct drm_encoder *encoder);
462
	void (*reset)(struct drm_encoder *encoder);
450
	void (*destroy)(struct drm_encoder *encoder);
463
	void (*destroy)(struct drm_encoder *encoder);
451
};
464
};
Line 452... Line 465...
452
 
465
 
453
#define DRM_CONNECTOR_MAX_UMODES 16
-
 
454
#define DRM_CONNECTOR_MAX_PROPERTY 16
466
#define DRM_CONNECTOR_MAX_UMODES 16
455
#define DRM_CONNECTOR_LEN 32
467
#define DRM_CONNECTOR_LEN 32
Line 456... Line 468...
456
#define DRM_CONNECTOR_MAX_ENCODER 3
468
#define DRM_CONNECTOR_MAX_ENCODER 3
457
 
469
 
Line 518... Line 530...
518
 * @probed_modes: list of modes derived directly from the display
530
 * @probed_modes: list of modes derived directly from the display
519
 * @display_info: information about attached display (e.g. from EDID)
531
 * @display_info: information about attached display (e.g. from EDID)
520
 * @funcs: connector control functions
532
 * @funcs: connector control functions
521
 * @user_modes: user added mode list
533
 * @user_modes: user added mode list
522
 * @edid_blob_ptr: DRM property containing EDID if present
534
 * @edid_blob_ptr: DRM property containing EDID if present
523
 * @property_ids: property tracking for this connector
535
 * @properties: property tracking for this connector
524
 * @property_values: value pointers or data for properties
-
 
525
 * @polled: a %DRM_CONNECTOR_POLL_ value for core driven polling
536
 * @polled: a %DRM_CONNECTOR_POLL_ value for core driven polling
526
 * @dpms: current dpms state
537
 * @dpms: current dpms state
527
 * @helper_private: mid-layer private data
538
 * @helper_private: mid-layer private data
528
 * @force: a %DRM_FORCE_ state for forced mode sets
539
 * @force: a %DRM_FORCE_ state for forced mode sets
529
 * @encoder_ids: valid encoders for this connector
540
 * @encoder_ids: valid encoders for this connector
Line 563... Line 574...
563
	struct drm_display_info display_info;
574
	struct drm_display_info display_info;
564
	const struct drm_connector_funcs *funcs;
575
	const struct drm_connector_funcs *funcs;
Line 565... Line 576...
565
 
576
 
566
	struct list_head user_modes;
577
	struct list_head user_modes;
567
	struct drm_property_blob *edid_blob_ptr;
578
	struct drm_property_blob *edid_blob_ptr;
568
	u32 property_ids[DRM_CONNECTOR_MAX_PROPERTY];
-
 
Line 569... Line 579...
569
	uint64_t property_values[DRM_CONNECTOR_MAX_PROPERTY];
579
	struct drm_object_properties properties;
Line 570... Line 580...
570
 
580
 
571
	uint8_t polled; /* DRM_CONNECTOR_POLL_* */
581
	uint8_t polled; /* DRM_CONNECTOR_POLL_* */
Line 586... Line 596...
586
	int max_tmds_clock;	/* in MHz */
596
	int max_tmds_clock;	/* in MHz */
587
	bool latency_present[2];
597
	bool latency_present[2];
588
	int video_latency[2];	/* [0]: progressive, [1]: interlaced */
598
	int video_latency[2];	/* [0]: progressive, [1]: interlaced */
589
	int audio_latency[2];
599
	int audio_latency[2];
590
	int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
600
	int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
-
 
601
	unsigned bad_edid_counter;
591
};
602
};
Line 592... Line 603...
592
 
603
 
593
/**
604
/**
594
 * drm_plane_funcs - driver plane control functions
605
 * drm_plane_funcs - driver plane control functions
595
 * @update_plane: update the plane configuration
606
 * @update_plane: update the plane configuration
596
 * @disable_plane: shut down the plane
607
 * @disable_plane: shut down the plane
-
 
608
 * @destroy: clean up plane resources
597
 * @destroy: clean up plane resources
609
 * @set_property: called when a property is changed
598
 */
610
 */
599
struct drm_plane_funcs {
611
struct drm_plane_funcs {
600
	int (*update_plane)(struct drm_plane *plane,
612
	int (*update_plane)(struct drm_plane *plane,
601
			    struct drm_crtc *crtc, struct drm_framebuffer *fb,
613
			    struct drm_crtc *crtc, struct drm_framebuffer *fb,
602
			    int crtc_x, int crtc_y,
614
			    int crtc_x, int crtc_y,
603
			    unsigned int crtc_w, unsigned int crtc_h,
615
			    unsigned int crtc_w, unsigned int crtc_h,
604
			    uint32_t src_x, uint32_t src_y,
616
			    uint32_t src_x, uint32_t src_y,
605
			    uint32_t src_w, uint32_t src_h);
617
			    uint32_t src_w, uint32_t src_h);
606
	int (*disable_plane)(struct drm_plane *plane);
618
	int (*disable_plane)(struct drm_plane *plane);
-
 
619
	void (*destroy)(struct drm_plane *plane);
-
 
620
 
-
 
621
	int (*set_property)(struct drm_plane *plane,
607
	void (*destroy)(struct drm_plane *plane);
622
			    struct drm_property *property, uint64_t val);
Line 608... Line 623...
608
};
623
};
609
 
624
 
610
/**
625
/**
Line 620... Line 635...
620
 * @gamma_size: size of gamma table
635
 * @gamma_size: size of gamma table
621
 * @gamma_store: gamma correction table
636
 * @gamma_store: gamma correction table
622
 * @enabled: enabled flag
637
 * @enabled: enabled flag
623
 * @funcs: helper functions
638
 * @funcs: helper functions
624
 * @helper_private: storage for drver layer
639
 * @helper_private: storage for drver layer
-
 
640
 * @properties: property tracking for this plane
625
 */
641
 */
626
struct drm_plane {
642
struct drm_plane {
627
	struct drm_device *dev;
643
	struct drm_device *dev;
628
	struct list_head head;
644
	struct list_head head;
Line 642... Line 658...
642
 
658
 
Line 643... Line 659...
643
	bool enabled;
659
	bool enabled;
644
 
660
 
-
 
661
	const struct drm_plane_funcs *funcs;
-
 
662
	void *helper_private;
645
	const struct drm_plane_funcs *funcs;
663
 
Line 646... Line 664...
646
	void *helper_private;
664
	struct drm_object_properties properties;
647
};
665
};
648
 
666
 
Line 661... Line 679...
661
 * and from which framebuffer it scans out from.
679
 * and from which framebuffer it scans out from.
662
 *
680
 *
663
 * This is used to set modes.
681
 * This is used to set modes.
664
 */
682
 */
665
struct drm_mode_set {
683
struct drm_mode_set {
666
	struct list_head head;
-
 
667
 
-
 
668
	struct drm_framebuffer *fb;
684
	struct drm_framebuffer *fb;
669
	struct drm_crtc *crtc;
685
	struct drm_crtc *crtc;
670
	struct drm_display_mode *mode;
686
	struct drm_display_mode *mode;
Line 671... Line 687...
671
 
687
 
Line 759... Line 775...
759
 
775
 
Line 760... Line 776...
760
	struct list_head property_list;
776
	struct list_head property_list;
761
 
777
 
762
	int min_width, min_height;
778
	int min_width, min_height;
763
	int max_width, max_height;
779
	int max_width, max_height;
Line 764... Line 780...
764
	struct drm_mode_config_funcs *funcs;
780
	const struct drm_mode_config_funcs *funcs;
765
	resource_size_t fb_base;
781
	resource_size_t fb_base;
766
 
782
 
Line 794... Line 810...
794
 
810
 
795
	/* Optional properties */
811
	/* Optional properties */
796
	struct drm_property *scaling_mode_property;
812
	struct drm_property *scaling_mode_property;
797
	struct drm_property *dithering_mode_property;
813
	struct drm_property *dithering_mode_property;
-
 
814
	struct drm_property *dirty_info_property;
-
 
815
 
-
 
816
	/* dumb ioctl parameters */
798
	struct drm_property *dirty_info_property;
817
	uint32_t preferred_depth, prefer_shadow;
Line 799... Line 818...
799
};
818
};
800
 
819
 
801
#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
820
#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
Line 805... Line 824...
805
#define obj_to_fb(x) container_of(x, struct drm_framebuffer, base)
824
#define obj_to_fb(x) container_of(x, struct drm_framebuffer, base)
806
#define obj_to_property(x) container_of(x, struct drm_property, base)
825
#define obj_to_property(x) container_of(x, struct drm_property, base)
807
#define obj_to_blob(x) container_of(x, struct drm_property_blob, base)
826
#define obj_to_blob(x) container_of(x, struct drm_property_blob, base)
808
#define obj_to_plane(x) container_of(x, struct drm_plane, base)
827
#define obj_to_plane(x) container_of(x, struct drm_plane, base)
Line -... Line 828...
-
 
828
 
-
 
829
struct drm_prop_enum_list {
-
 
830
	int type;
-
 
831
	char *name;
Line 809... Line 832...
809
 
832
};
810
 
833
 
811
extern void drm_crtc_init(struct drm_device *dev,
834
extern int drm_crtc_init(struct drm_device *dev,
812
			  struct drm_crtc *crtc,
835
			  struct drm_crtc *crtc,
Line 813... Line 836...
813
			  const struct drm_crtc_funcs *funcs);
836
			  const struct drm_crtc_funcs *funcs);
814
extern void drm_crtc_cleanup(struct drm_crtc *crtc);
837
extern void drm_crtc_cleanup(struct drm_crtc *crtc);
815
 
838
 
816
extern void drm_connector_init(struct drm_device *dev,
839
extern int drm_connector_init(struct drm_device *dev,
Line 817... Line 840...
817
			    struct drm_connector *connector,
840
			    struct drm_connector *connector,
-
 
841
			    const struct drm_connector_funcs *funcs,
-
 
842
			    int connector_type);
Line 818... Line 843...
818
			    const struct drm_connector_funcs *funcs,
843
 
819
			    int connector_type);
844
extern void drm_connector_cleanup(struct drm_connector *connector);
820
 
845
/* helper to unplug all connectors from sysfs for device */
821
extern void drm_connector_cleanup(struct drm_connector *connector);
846
extern void drm_connector_unplug_all(struct drm_device *dev);
Line 822... Line 847...
822
 
847
 
Line 841... Line 866...
841
extern char *drm_get_dvi_i_select_name(int val);
866
extern char *drm_get_dvi_i_select_name(int val);
842
extern char *drm_get_tv_subconnector_name(int val);
867
extern char *drm_get_tv_subconnector_name(int val);
843
extern char *drm_get_tv_select_name(int val);
868
extern char *drm_get_tv_select_name(int val);
844
extern void drm_fb_release(struct drm_file *file_priv);
869
extern void drm_fb_release(struct drm_file *file_priv);
845
extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group);
870
extern int drm_mode_group_init_legacy_group(struct drm_device *dev, struct drm_mode_group *group);
-
 
871
extern bool drm_probe_ddc(struct i2c_adapter *adapter);
846
extern struct edid *drm_get_edid(struct drm_connector *connector,
872
extern struct edid *drm_get_edid(struct drm_connector *connector,
847
				 struct i2c_adapter *adapter);
873
				 struct i2c_adapter *adapter);
848
extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
874
extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
849
extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
875
extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
850
extern void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode);
876
extern void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode);
-
 
877
extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src);
851
extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
878
extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
852
						   const struct drm_display_mode *mode);
879
						   const struct drm_display_mode *mode);
853
extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode);
880
extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode);
854
extern void drm_mode_config_init(struct drm_device *dev);
881
extern void drm_mode_config_init(struct drm_device *dev);
855
extern void drm_mode_config_reset(struct drm_device *dev);
882
extern void drm_mode_config_reset(struct drm_device *dev);
Line 860... Line 887...
860
extern int drm_mode_height(struct drm_display_mode *mode);
887
extern int drm_mode_height(struct drm_display_mode *mode);
Line 861... Line 888...
861
 
888
 
862
/* for us by fb module */
889
/* for us by fb module */
863
extern int drm_mode_attachmode_crtc(struct drm_device *dev,
890
extern int drm_mode_attachmode_crtc(struct drm_device *dev,
864
				    struct drm_crtc *crtc,
891
				    struct drm_crtc *crtc,
865
				    struct drm_display_mode *mode);
892
				    const struct drm_display_mode *mode);
Line 866... Line 893...
866
extern int drm_mode_detachmode_crtc(struct drm_device *dev, struct drm_display_mode *mode);
893
extern int drm_mode_detachmode_crtc(struct drm_device *dev, struct drm_display_mode *mode);
867
 
894
 
868
extern struct drm_display_mode *drm_mode_create(struct drm_device *dev);
895
extern struct drm_display_mode *drm_mode_create(struct drm_device *dev);
Line 886... Line 913...
886
					 struct drm_property *property,
913
					 struct drm_property *property,
887
					 uint64_t value);
914
					 uint64_t value);
888
extern int drm_connector_property_get_value(struct drm_connector *connector,
915
extern int drm_connector_property_get_value(struct drm_connector *connector,
889
					 struct drm_property *property,
916
					 struct drm_property *property,
890
					 uint64_t *value);
917
					 uint64_t *value);
-
 
918
extern int drm_object_property_set_value(struct drm_mode_object *obj,
-
 
919
					 struct drm_property *property,
-
 
920
					 uint64_t val);
-
 
921
extern int drm_object_property_get_value(struct drm_mode_object *obj,
-
 
922
					 struct drm_property *property,
-
 
923
					 uint64_t *value);
891
extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev);
924
extern struct drm_display_mode *drm_crtc_mode_create(struct drm_device *dev);
892
extern void drm_framebuffer_set_object(struct drm_device *dev,
925
extern void drm_framebuffer_set_object(struct drm_device *dev,
893
				       unsigned long handle);
926
				       unsigned long handle);
894
extern int drm_framebuffer_init(struct drm_device *dev,
927
extern int drm_framebuffer_init(struct drm_device *dev,
895
				struct drm_framebuffer *fb,
928
				struct drm_framebuffer *fb,
896
				const struct drm_framebuffer_funcs *funcs);
929
				const struct drm_framebuffer_funcs *funcs);
-
 
930
extern void drm_framebuffer_unreference(struct drm_framebuffer *fb);
-
 
931
extern void drm_framebuffer_reference(struct drm_framebuffer *fb);
-
 
932
extern void drm_framebuffer_remove(struct drm_framebuffer *fb);
897
extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
933
extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
898
extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
934
extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
899
extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
935
extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
900
extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY);
936
extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY);
901
extern bool drm_crtc_in_use(struct drm_crtc *crtc);
937
extern bool drm_crtc_in_use(struct drm_crtc *crtc);
Line 902... Line 938...
902
 
938
 
903
extern int drm_connector_attach_property(struct drm_connector *connector,
939
extern void drm_connector_attach_property(struct drm_connector *connector,
-
 
940
				      struct drm_property *property, uint64_t init_val);
-
 
941
extern void drm_object_attach_property(struct drm_mode_object *obj,
-
 
942
				       struct drm_property *property,
904
				      struct drm_property *property, uint64_t init_val);
943
				       uint64_t init_val);
905
extern struct drm_property *drm_property_create(struct drm_device *dev, int flags,
944
extern struct drm_property *drm_property_create(struct drm_device *dev, int flags,
-
 
945
						const char *name, int num_values);
-
 
946
extern struct drm_property *drm_property_create_enum(struct drm_device *dev, int flags,
-
 
947
					 const char *name,
-
 
948
					 const struct drm_prop_enum_list *props,
-
 
949
					 int num_values);
-
 
950
struct drm_property *drm_property_create_bitmask(struct drm_device *dev,
-
 
951
					 int flags, const char *name,
-
 
952
					 const struct drm_prop_enum_list *props,
-
 
953
					 int num_values);
-
 
954
struct drm_property *drm_property_create_range(struct drm_device *dev, int flags,
-
 
955
					 const char *name,
906
						const char *name, int num_values);
956
					 uint64_t min, uint64_t max);
907
extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
957
extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
908
extern int drm_property_add_enum(struct drm_property *property, int index,
958
extern int drm_property_add_enum(struct drm_property *property, int index,
909
				 uint64_t value, const char *name);
959
				 uint64_t value, const char *name);
910
extern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
960
extern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
Line 917... Line 967...
917
 
967
 
918
extern int drm_mode_connector_attach_encoder(struct drm_connector *connector,
968
extern int drm_mode_connector_attach_encoder(struct drm_connector *connector,
919
					     struct drm_encoder *encoder);
969
					     struct drm_encoder *encoder);
920
extern void drm_mode_connector_detach_encoder(struct drm_connector *connector,
970
extern void drm_mode_connector_detach_encoder(struct drm_connector *connector,
921
					   struct drm_encoder *encoder);
971
					   struct drm_encoder *encoder);
922
extern bool drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
972
extern int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
923
					 int gamma_size);
973
					 int gamma_size);
924
extern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
974
extern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev,
925
		uint32_t id, uint32_t type);
975
		uint32_t id, uint32_t type);
926
/* IOCTLs */
976
/* IOCTLs */
Line 993... Line 1043...
993
				int GTF_2C, int GTF_K, int GTF_2J);
1043
				int GTF_2C, int GTF_K, int GTF_2J);
994
extern int drm_add_modes_noedid(struct drm_connector *connector,
1044
extern int drm_add_modes_noedid(struct drm_connector *connector,
995
				int hdisplay, int vdisplay);
1045
				int hdisplay, int vdisplay);
Line 996... Line 1046...
996
 
1046
 
-
 
1047
extern int drm_edid_header_is_valid(const u8 *raw_edid);
997
extern int drm_edid_header_is_valid(const u8 *raw_edid);
1048
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);
998
extern bool drm_edid_is_valid(struct edid *edid);
1049
extern bool drm_edid_is_valid(struct edid *edid);
999
struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
1050
struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
-
 
1051
					   int hsize, int vsize, int fresh,
-
 
1052
					   bool rb);
-
 
1053
 
-
 
1054
extern int drm_mode_create_dumb_ioctl(struct drm_device *dev,
-
 
1055
				      void *data, struct drm_file *file_priv);
-
 
1056
extern int drm_mode_mmap_dumb_ioctl(struct drm_device *dev,
-
 
1057
				    void *data, struct drm_file *file_priv);
-
 
1058
extern int drm_mode_destroy_dumb_ioctl(struct drm_device *dev,
-
 
1059
				      void *data, struct drm_file *file_priv);
-
 
1060
extern int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
-
 
1061
					     struct drm_file *file_priv);
-
 
1062
extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
-
 
1063
					   struct drm_file *file_priv);
-
 
1064
 
-
 
1065
extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
-
 
1066
				 int *bpp);
-
 
1067
extern int drm_format_num_planes(uint32_t format);
-
 
1068
extern int drm_format_plane_cpp(uint32_t format, int plane);
-
 
1069
extern int drm_format_horz_chroma_subsampling(uint32_t format);
-
 
1070
extern int drm_format_vert_chroma_subsampling(uint32_t format);
1000
					   int hsize, int vsize, int fresh);
1071