Subversion Repositories Kolibri OS

Rev

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

Rev 3262 Rev 3391
Line 36... Line 36...
36
 
36
 
37
struct drm_device;
37
struct drm_device;
38
struct drm_mode_set;
38
struct drm_mode_set;
39
struct drm_framebuffer;
39
struct drm_framebuffer;
40
struct drm_object_properties;
-
 
-
 
40
struct drm_object_properties;
-
 
41
struct drm_file;
Line 41... Line 42...
41
 
42
struct drm_clip_rect;
42
 
43
 
43
#define DRM_MODE_OBJECT_CRTC 0xcccccccc
44
#define DRM_MODE_OBJECT_CRTC 0xcccccccc
44
#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
45
#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
Line 252... Line 253...
252
	 * should be deferred.  In cases like this, the driver would like to
253
	 * should be deferred.  In cases like this, the driver would like to
253
	 * hold a ref to the fb even though it has already been removed from
254
	 * hold a ref to the fb even though it has already been removed from
254
	 * userspace perspective.
255
	 * userspace perspective.
255
	 */
256
	 */
256
	struct kref refcount;
257
	struct kref refcount;
-
 
258
	/*
-
 
259
	 * Place on the dev->mode_config.fb_list, access protected by
-
 
260
	 * dev->mode_config.fb_lock.
-
 
261
	 */
257
	struct list_head head;
262
	struct list_head head;
258
	struct drm_mode_object base;
263
	struct drm_mode_object base;
259
	const struct drm_framebuffer_funcs *funcs;
264
	const struct drm_framebuffer_funcs *funcs;
260
	unsigned int pitches[4];
265
	unsigned int pitches[4];
261
	unsigned int offsets[4];
266
	unsigned int offsets[4];
Line 388... Line 393...
388
 */
393
 */
389
struct drm_crtc {
394
struct drm_crtc {
390
	struct drm_device *dev;
395
	struct drm_device *dev;
391
	struct list_head head;
396
	struct list_head head;
Line -... Line 397...
-
 
397
 
-
 
398
	/**
-
 
399
	 * crtc mutex
-
 
400
	 *
-
 
401
	 * This provides a read lock for the overall crtc state (mode, dpms
-
 
402
	 * state, ...) and a write lock for everything which can be update
-
 
403
	 * without a full modeset (fb, cursor data, ...)
-
 
404
	 */
-
 
405
	struct mutex mutex;
392
 
406
 
Line 393... Line 407...
393
	struct drm_mode_object base;
407
	struct drm_mode_object base;
394
 
408
 
Line 427... Line 441...
427
/**
441
/**
428
 * drm_connector_funcs - control connectors on a given device
442
 * drm_connector_funcs - control connectors on a given device
429
 * @dpms: set power state (see drm_crtc_funcs above)
443
 * @dpms: set power state (see drm_crtc_funcs above)
430
 * @save: save connector state
444
 * @save: save connector state
431
 * @restore: restore connector state
445
 * @restore: restore connector state
432
 * @reset: reset connector after state has been invalidate (e.g. resume)
446
 * @reset: reset connector after state has been invalidated (e.g. resume)
433
 * @detect: is this connector active?
447
 * @detect: is this connector active?
434
 * @fill_modes: fill mode list for this connector
448
 * @fill_modes: fill mode list for this connector
435
 * @set_property: property for this connector may need update
449
 * @set_property: property for this connector may need an update
436
 * @destroy: make object go away
450
 * @destroy: make object go away
437
 * @force: notify the driver the connector is forced on
451
 * @force: notify the driver that the connector is forced on
438
 *
452
 *
439
 * Each CRTC may have one or more connectors attached to it.  The functions
453
 * Each CRTC may have one or more connectors attached to it.  The functions
440
 * below allow the core DRM code to control connectors, enumerate available modes,
454
 * below allow the core DRM code to control connectors, enumerate available modes,
441
 * etc.
455
 * etc.
442
 */
456
 */
Line 769... Line 783...
769
struct drm_mode_config {
783
struct drm_mode_config {
770
	struct mutex mutex; /* protects configuration (mode lists etc.) */
784
	struct mutex mutex; /* protects configuration (mode lists etc.) */
771
	struct mutex idr_mutex; /* for IDR management */
785
	struct mutex idr_mutex; /* for IDR management */
772
    struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */
786
    struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */
773
	/* this is limited to one for now */
787
	/* this is limited to one for now */
-
 
788
 
-
 
789
 
-
 
790
	/**
-
 
791
	 * fb_lock - mutex to protect fb state
-
 
792
	 *
-
 
793
	 * Besides the global fb list his also protects the fbs list in the
-
 
794
	 * file_priv
-
 
795
	 */
-
 
796
	struct mutex fb_lock;
774
	int num_fb;
797
	int num_fb;
775
	struct list_head fb_list;
798
	struct list_head fb_list;
-
 
799
 
776
	int num_connector;
800
	int num_connector;
777
	struct list_head connector_list;
801
	struct list_head connector_list;
778
	int num_encoder;
802
	int num_encoder;
779
	struct list_head encoder_list;
803
	struct list_head encoder_list;
780
	int num_plane;
804
	int num_plane;
Line 840... Line 864...
840
struct drm_prop_enum_list {
864
struct drm_prop_enum_list {
841
	int type;
865
	int type;
842
	char *name;
866
	char *name;
843
};
867
};
Line -... Line 868...
-
 
868
 
-
 
869
extern void drm_modeset_lock_all(struct drm_device *dev);
-
 
870
extern void drm_modeset_unlock_all(struct drm_device *dev);
-
 
871
extern void drm_warn_on_modeset_not_all_locked(struct drm_device *dev);
844
 
872
 
845
extern int drm_crtc_init(struct drm_device *dev,
873
extern int drm_crtc_init(struct drm_device *dev,
846
			  struct drm_crtc *crtc,
874
			  struct drm_crtc *crtc,
847
			  const struct drm_crtc_funcs *funcs);
875
			  const struct drm_crtc_funcs *funcs);
Line 930... Line 958...
930
extern void drm_framebuffer_set_object(struct drm_device *dev,
958
extern void drm_framebuffer_set_object(struct drm_device *dev,
931
				       unsigned long handle);
959
				       unsigned long handle);
932
extern int drm_framebuffer_init(struct drm_device *dev,
960
extern int drm_framebuffer_init(struct drm_device *dev,
933
				struct drm_framebuffer *fb,
961
				struct drm_framebuffer *fb,
934
				const struct drm_framebuffer_funcs *funcs);
962
				const struct drm_framebuffer_funcs *funcs);
-
 
963
extern struct drm_framebuffer *drm_framebuffer_lookup(struct drm_device *dev,
-
 
964
						      uint32_t id);
935
extern void drm_framebuffer_unreference(struct drm_framebuffer *fb);
965
extern void drm_framebuffer_unreference(struct drm_framebuffer *fb);
936
extern void drm_framebuffer_reference(struct drm_framebuffer *fb);
966
extern void drm_framebuffer_reference(struct drm_framebuffer *fb);
937
extern void drm_framebuffer_remove(struct drm_framebuffer *fb);
967
extern void drm_framebuffer_remove(struct drm_framebuffer *fb);
938
extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
968
extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
-
 
969
extern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb);
939
extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
970
extern int drmfb_probe(struct drm_device *dev, struct drm_crtc *crtc);
940
extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
971
extern int drmfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
941
extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY);
972
extern void drm_crtc_probe_connector_modes(struct drm_device *dev, int maxX, int maxY);
942
extern bool drm_crtc_in_use(struct drm_crtc *crtc);
973
extern bool drm_crtc_in_use(struct drm_crtc *crtc);
Line 983... Line 1014...
983
				   struct drm_file *file_priv);
1014
				   struct drm_file *file_priv);
984
extern int drm_mode_getcrtc(struct drm_device *dev,
1015
extern int drm_mode_getcrtc(struct drm_device *dev,
985
			    void *data, struct drm_file *file_priv);
1016
			    void *data, struct drm_file *file_priv);
986
extern int drm_mode_getconnector(struct drm_device *dev,
1017
extern int drm_mode_getconnector(struct drm_device *dev,
987
			      void *data, struct drm_file *file_priv);
1018
			      void *data, struct drm_file *file_priv);
-
 
1019
extern int drm_mode_set_config_internal(struct drm_mode_set *set);
988
extern int drm_mode_setcrtc(struct drm_device *dev,
1020
extern int drm_mode_setcrtc(struct drm_device *dev,
989
			    void *data, struct drm_file *file_priv);
1021
			    void *data, struct drm_file *file_priv);
990
extern int drm_mode_getplane(struct drm_device *dev,
1022
extern int drm_mode_getplane(struct drm_device *dev,
991
			       void *data, struct drm_file *file_priv);
1023
			       void *data, struct drm_file *file_priv);
992
extern int drm_mode_setplane(struct drm_device *dev,
1024
extern int drm_mode_setplane(struct drm_device *dev,
Line 1028... Line 1060...
1028
extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
1060
extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
1029
				    void *data, struct drm_file *file_priv);
1061
				    void *data, struct drm_file *file_priv);
1030
extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
1062
extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
1031
				    void *data, struct drm_file *file_priv);
1063
				    void *data, struct drm_file *file_priv);
1032
extern u8 *drm_find_cea_extension(struct edid *edid);
1064
extern u8 *drm_find_cea_extension(struct edid *edid);
1033
extern u8 drm_match_cea_mode(struct drm_display_mode *to_match);
1065
extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
1034
extern bool drm_detect_hdmi_monitor(struct edid *edid);
1066
extern bool drm_detect_hdmi_monitor(struct edid *edid);
1035
extern bool drm_detect_monitor_audio(struct edid *edid);
1067
extern bool drm_detect_monitor_audio(struct edid *edid);
-
 
1068
extern bool drm_rgb_quant_range_selectable(struct edid *edid);
1036
extern int drm_mode_page_flip_ioctl(struct drm_device *dev,
1069
extern int drm_mode_page_flip_ioctl(struct drm_device *dev,
1037
				    void *data, struct drm_file *file_priv);
1070
				    void *data, struct drm_file *file_priv);
1038
extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
1071
extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
1039
				int hdisplay, int vdisplay, int vrefresh,
1072
				int hdisplay, int vdisplay, int vrefresh,
1040
				bool reduced, bool interlaced, bool margins);
1073
				bool reduced, bool interlaced, bool margins);
Line 1045... Line 1078...
1045
				int hdisplay, int vdisplay, int vrefresh,
1078
				int hdisplay, int vdisplay, int vrefresh,
1046
				bool interlaced, int margins, int GTF_M,
1079
				bool interlaced, int margins, int GTF_M,
1047
				int GTF_2C, int GTF_K, int GTF_2J);
1080
				int GTF_2C, int GTF_K, int GTF_2J);
1048
extern int drm_add_modes_noedid(struct drm_connector *connector,
1081
extern int drm_add_modes_noedid(struct drm_connector *connector,
1049
				int hdisplay, int vdisplay);
1082
				int hdisplay, int vdisplay);
1050
extern uint8_t drm_mode_cea_vic(const struct drm_display_mode *mode);
-
 
Line 1051... Line 1083...
1051
 
1083
 
1052
extern int drm_edid_header_is_valid(const u8 *raw_edid);
1084
extern int drm_edid_header_is_valid(const u8 *raw_edid);
1053
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);
1085
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);
1054
extern bool drm_edid_is_valid(struct edid *edid);
1086
extern bool drm_edid_is_valid(struct edid *edid);