Subversion Repositories Kolibri OS

Rev

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

Rev 5056 Rev 5270
Line 29... Line 29...
29
#include 
29
#include 
30
#include 
30
#include 
31
#include 
31
#include 
32
#include 
32
#include 
33
#include 
33
#include 
34
#include 
34
#include 
35
#include 
35
#include 
36
#include 
36
#include 
Line 37... Line 37...
37
 
37
 
38
struct drm_device;
38
struct drm_device;
39
struct drm_mode_set;
39
struct drm_mode_set;
40
struct drm_framebuffer;
40
struct drm_framebuffer;
41
struct drm_object_properties;
41
struct drm_object_properties;
42
struct drm_file;
42
struct drm_file;
43
struct drm_clip_rect;
43
struct drm_clip_rect;
-
 
44
struct device_node;
Line 44... Line 45...
44
struct device_node;
45
struct fence;
45
 
46
 
46
#define DRM_MODE_OBJECT_CRTC 0xcccccccc
47
#define DRM_MODE_OBJECT_CRTC 0xcccccccc
47
#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
48
#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
Line 134... Line 135...
134
	u8 edid_hdmi_dc_modes;
135
	u8 edid_hdmi_dc_modes;
Line 135... Line 136...
135
 
136
 
136
	u8 cea_rev;
137
	u8 cea_rev;
Line -... Line 138...
-
 
138
};
-
 
139
 
-
 
140
/* data corresponds to displayid vend/prod/serial */
-
 
141
struct drm_tile_group {
-
 
142
	struct kref refcount;
-
 
143
	struct drm_device *dev;
-
 
144
	int id;
-
 
145
	u8 group_data[8];
137
};
146
};
138
 
147
 
139
struct drm_framebuffer_funcs {
148
struct drm_framebuffer_funcs {
140
	/* note: use drm_framebuffer_remove() */
149
	/* note: use drm_framebuffer_remove() */
141
	void (*destroy)(struct drm_framebuffer *framebuffer);
150
	void (*destroy)(struct drm_framebuffer *framebuffer);
142
	int (*create_handle)(struct drm_framebuffer *fb,
151
	int (*create_handle)(struct drm_framebuffer *fb,
143
			     struct drm_file *file_priv,
152
			     struct drm_file *file_priv,
144
			     unsigned int *handle);
153
			     unsigned int *handle);
145
	/**
154
	/*
146
	 * Optinal callback for the dirty fb ioctl.
155
	 * Optional callback for the dirty fb ioctl.
147
	 *
156
	 *
148
	 * Userspace can notify the driver via this callback
157
	 * Userspace can notify the driver via this callback
149
	 * that a area of the framebuffer has changed and should
158
	 * that a area of the framebuffer has changed and should
Line 194... Line 203...
194
};
203
};
Line 195... Line 204...
195
 
204
 
196
struct drm_property_blob {
205
struct drm_property_blob {
197
	struct drm_mode_object base;
206
	struct drm_mode_object base;
198
	struct list_head head;
207
	struct list_head head;
199
	unsigned int length;
208
	size_t length;
200
	unsigned char data[];
209
	unsigned char data[];
Line 201... Line 210...
201
};
210
};
202
 
211
 
Line 213... Line 222...
213
    char        name[DRM_PROP_NAME_LEN];
222
    char        name[DRM_PROP_NAME_LEN];
214
    uint32_t    num_values;
223
    uint32_t    num_values;
215
    uint64_t    *values;
224
    uint64_t    *values;
216
	struct drm_device *dev;
225
	struct drm_device *dev;
Line 217... Line 226...
217
 
226
 
218
	struct list_head enum_blob_list;
227
	struct list_head enum_list;
Line 219... Line -...
219
};
-
 
220
 
-
 
221
void drm_modeset_lock_all(struct drm_device *dev);
-
 
222
void drm_modeset_unlock_all(struct drm_device *dev);
-
 
223
void drm_warn_on_modeset_not_all_locked(struct drm_device *dev);
228
};
224
 
229
 
225
struct drm_crtc;
230
struct drm_crtc;
226
struct drm_connector;
231
struct drm_connector;
227
struct drm_encoder;
232
struct drm_encoder;
228
struct drm_pending_vblank_event;
233
struct drm_pending_vblank_event;
-
 
234
struct drm_plane;
-
 
235
struct drm_bridge;
-
 
236
struct drm_atomic_state;
-
 
237
 
-
 
238
/**
-
 
239
 * struct drm_crtc_state - mutable CRTC state
-
 
240
 * @enable: whether the CRTC should be enabled, gates all other state
-
 
241
 * @mode_changed: for use by helpers and drivers when computing state updates
-
 
242
 * @plane_mask: bitmask of (1 << drm_plane_index(plane)) of attached planes
-
 
243
 * @last_vblank_count: for helpers and drivers to capture the vblank of the
-
 
244
 * 	update to ensure framebuffer cleanup isn't done too early
-
 
245
 * @planes_changed: for use by helpers and drivers when computing state updates
-
 
246
 * @adjusted_mode: for use by helpers and drivers to compute adjusted mode timings
-
 
247
 * @mode: current mode timings
-
 
248
 * @event: optional pointer to a DRM event to signal upon completion of the
-
 
249
 * 	state update
-
 
250
 * @state: backpointer to global drm_atomic_state
-
 
251
 */
-
 
252
struct drm_crtc_state {
-
 
253
	bool enable;
-
 
254
 
-
 
255
	/* computed state bits used by helpers and drivers */
-
 
256
	bool planes_changed : 1;
-
 
257
	bool mode_changed : 1;
-
 
258
 
-
 
259
	/* attached planes bitmask:
-
 
260
	 * WARNING: transitional helpers do not maintain plane_mask so
-
 
261
	 * drivers not converted over to atomic helpers should not rely
-
 
262
	 * on plane_mask being accurate!
-
 
263
	 */
-
 
264
	u32 plane_mask;
-
 
265
 
-
 
266
	/* last_vblank_count: for vblank waits before cleanup */
-
 
267
	u32 last_vblank_count;
-
 
268
 
-
 
269
	/* adjusted_mode: for use by helpers and drivers */
-
 
270
	struct drm_display_mode adjusted_mode;
-
 
271
 
-
 
272
	struct drm_display_mode mode;
-
 
273
 
-
 
274
	struct drm_pending_vblank_event *event;
-
 
275
 
Line 229... Line 276...
229
struct drm_plane;
276
	struct drm_atomic_state *state;
230
struct drm_bridge;
277
};
231
 
278
 
232
/**
279
/**
233
 * drm_crtc_funcs - control CRTCs for a given device
280
 * struct drm_crtc_funcs - control CRTCs for a given device
234
 * @save: save CRTC state
281
 * @save: save CRTC state
-
 
282
 * @restore: restore CRTC state
235
 * @restore: restore CRTC state
283
 * @reset: reset CRTC after state has been invalidated (e.g. resume)
236
 * @reset: reset CRTC after state has been invalidated (e.g. resume)
284
 * @cursor_set: setup the cursor
237
 * @cursor_set: setup the cursor
285
 * @cursor_set2: setup the cursor with hotspot, superseeds @cursor_set if set
238
 * @cursor_move: move the cursor
286
 * @cursor_move: move the cursor
239
 * @gamma_set: specify color ramp for CRTC
287
 * @gamma_set: specify color ramp for CRTC
240
 * @destroy: deinit and free object
288
 * @destroy: deinit and free object
-
 
289
 * @set_property: called when a property is changed
-
 
290
 * @set_config: apply a new CRTC configuration
-
 
291
 * @page_flip: initiate a page flip
241
 * @set_property: called when a property is changed
292
 * @atomic_duplicate_state: duplicate the atomic state for this CRTC
242
 * @set_config: apply a new CRTC configuration
293
 * @atomic_destroy_state: destroy an atomic state for this CRTC
243
 * @page_flip: initiate a page flip
294
 * @atomic_set_property: set a property on an atomic state for this CRTC
244
 *
295
 *
245
 * The drm_crtc_funcs structure is the central CRTC management structure
296
 * The drm_crtc_funcs structure is the central CRTC management structure
Line 289... Line 340...
289
			 struct drm_pending_vblank_event *event,
340
			 struct drm_pending_vblank_event *event,
290
			 uint32_t flags);
341
			 uint32_t flags);
Line 291... Line 342...
291
 
342
 
292
	int (*set_property)(struct drm_crtc *crtc,
343
	int (*set_property)(struct drm_crtc *crtc,
-
 
344
			    struct drm_property *property, uint64_t val);
-
 
345
 
-
 
346
	/* atomic update handling */
-
 
347
	struct drm_crtc_state *(*atomic_duplicate_state)(struct drm_crtc *crtc);
-
 
348
	void (*atomic_destroy_state)(struct drm_crtc *crtc,
-
 
349
				     struct drm_crtc_state *state);
-
 
350
	int (*atomic_set_property)(struct drm_crtc *crtc,
-
 
351
				   struct drm_crtc_state *state,
-
 
352
				   struct drm_property *property,
293
			    struct drm_property *property, uint64_t val);
353
				   uint64_t val);
Line 294... Line 354...
294
};
354
};
295
 
355
 
296
/**
356
/**
-
 
357
 * struct drm_crtc - central CRTC control structure
297
 * drm_crtc - central CRTC control structure
358
 * @dev: parent DRM device
298
 * @dev: parent DRM device
359
 * @port: OF node used by drm_of_find_possible_crtcs()
299
 * @head: list management
360
 * @head: list management
300
 * @mutex: per-CRTC locking
361
 * @mutex: per-CRTC locking
301
 * @base: base KMS object for ID tracking etc.
362
 * @base: base KMS object for ID tracking etc.
-
 
363
 * @primary: primary plane for this CRTC
-
 
364
 * @cursor: cursor plane for this CRTC
302
 * @primary: primary plane for this CRTC
365
 * @cursor_x: current x position of the cursor, used for universal cursor planes
303
 * @cursor: cursor plane for this CRTC
366
 * @cursor_y: current y position of the cursor, used for universal cursor planes
304
 * @enabled: is this CRTC enabled?
367
 * @enabled: is this CRTC enabled?
305
 * @mode: current mode timings
368
 * @mode: current mode timings
306
 * @hwmode: mode timings as programmed to hw regs
369
 * @hwmode: mode timings as programmed to hw regs
Line 311... Line 374...
311
 * @y: y position on screen
374
 * @y: y position on screen
312
 * @funcs: CRTC control functions
375
 * @funcs: CRTC control functions
313
 * @gamma_size: size of gamma ramp
376
 * @gamma_size: size of gamma ramp
314
 * @gamma_store: gamma ramp values
377
 * @gamma_store: gamma ramp values
315
 * @framedur_ns: precise frame timing
378
 * @framedur_ns: precise frame timing
316
 * @framedur_ns: precise line timing
379
 * @linedur_ns: precise line timing
317
 * @pixeldur_ns: precise pixel timing
380
 * @pixeldur_ns: precise pixel timing
318
 * @helper_private: mid-layer private data
381
 * @helper_private: mid-layer private data
319
 * @properties: property tracking for this CRTC
382
 * @properties: property tracking for this CRTC
-
 
383
 * @state: current atomic state for this CRTC
-
 
384
 * @acquire_ctx: per-CRTC implicit acquire context used by atomic drivers for
-
 
385
 * 	legacy ioctls
320
 *
386
 *
321
 * Each CRTC may have one or more connectors associated with it.  This structure
387
 * Each CRTC may have one or more connectors associated with it.  This structure
322
 * allows the CRTC to be controlled.
388
 * allows the CRTC to be controlled.
323
 */
389
 */
324
struct drm_crtc {
390
struct drm_crtc {
325
	struct drm_device *dev;
391
	struct drm_device *dev;
326
	struct device_node *port;
392
	struct device_node *port;
327
	struct list_head head;
393
	struct list_head head;
Line 328... Line 394...
328
 
394
 
329
	/**
395
	/*
330
	 * crtc mutex
396
	 * crtc mutex
331
	 *
397
	 *
332
	 * This provides a read lock for the overall crtc state (mode, dpms
398
	 * This provides a read lock for the overall crtc state (mode, dpms
333
	 * state, ...) and a write lock for everything which can be update
399
	 * state, ...) and a write lock for everything which can be update
Line 343... Line 409...
343
 
409
 
344
	/* position of cursor plane on crtc */
410
	/* position of cursor plane on crtc */
345
	int cursor_x;
411
	int cursor_x;
Line 346... Line -...
346
	int cursor_y;
-
 
347
 
-
 
348
	/* Temporary tracking of the old fb while a modeset is ongoing. Used
-
 
349
	 * by drm_mode_set_config_internal to implement correct refcounting. */
-
 
350
	struct drm_framebuffer *old_fb;
412
	int cursor_y;
Line 351... Line 413...
351
 
413
 
352
	bool enabled;
414
	bool enabled;
Line 373... Line 435...
373
 
435
 
374
	/* if you are using the helper */
436
	/* if you are using the helper */
Line 375... Line 437...
375
	void *helper_private;
437
	void *helper_private;
-
 
438
 
-
 
439
	struct drm_object_properties properties;
-
 
440
 
-
 
441
	struct drm_crtc_state *state;
-
 
442
 
-
 
443
	/*
-
 
444
	 * For legacy crtc ioctls so that atomic drivers can get at the locking
-
 
445
	 * acquire context.
376
 
446
	 */
Line -... Line 447...
-
 
447
	struct drm_modeset_acquire_ctx *acquire_ctx;
-
 
448
};
-
 
449
 
-
 
450
/**
-
 
451
 * struct drm_connector_state - mutable connector state
-
 
452
 * @crtc: CRTC to connect connector to, NULL if disabled
-
 
453
 * @best_encoder: can be used by helpers and drivers to select the encoder
-
 
454
 * @state: backpointer to global drm_atomic_state
-
 
455
 */
-
 
456
struct drm_connector_state {
-
 
457
	struct drm_crtc *crtc;  /* do not write directly, use drm_atomic_set_crtc_for_connector() */
-
 
458
 
-
 
459
	struct drm_encoder *best_encoder;
Line 377... Line 460...
377
	struct drm_object_properties properties;
460
 
378
};
461
	struct drm_atomic_state *state;
379
 
462
};
380
 
463
 
381
/**
464
/**
382
 * drm_connector_funcs - control connectors on a given device
465
 * struct drm_connector_funcs - control connectors on a given device
383
 * @dpms: set power state (see drm_crtc_funcs above)
466
 * @dpms: set power state (see drm_crtc_funcs above)
384
 * @save: save connector state
467
 * @save: save connector state
385
 * @restore: restore connector state
468
 * @restore: restore connector state
386
 * @reset: reset connector after state has been invalidated (e.g. resume)
469
 * @reset: reset connector after state has been invalidated (e.g. resume)
387
 * @detect: is this connector active?
470
 * @detect: is this connector active?
-
 
471
 * @fill_modes: fill mode list for this connector
-
 
472
 * @set_property: property for this connector may need an update
-
 
473
 * @destroy: make object go away
388
 * @fill_modes: fill mode list for this connector
474
 * @force: notify the driver that the connector is forced on
389
 * @set_property: property for this connector may need an update
475
 * @atomic_duplicate_state: duplicate the atomic state for this connector
390
 * @destroy: make object go away
476
 * @atomic_destroy_state: destroy an atomic state for this connector
391
 * @force: notify the driver that the connector is forced on
477
 * @atomic_set_property: set a property on an atomic state for this connector
392
 *
478
 *
Line 411... Line 497...
411
	int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
497
	int (*fill_modes)(struct drm_connector *connector, uint32_t max_width, uint32_t max_height);
412
	int (*set_property)(struct drm_connector *connector, struct drm_property *property,
498
	int (*set_property)(struct drm_connector *connector, struct drm_property *property,
413
			     uint64_t val);
499
			     uint64_t val);
414
	void (*destroy)(struct drm_connector *connector);
500
	void (*destroy)(struct drm_connector *connector);
415
	void (*force)(struct drm_connector *connector);
501
	void (*force)(struct drm_connector *connector);
-
 
502
 
-
 
503
	/* atomic update handling */
-
 
504
	struct drm_connector_state *(*atomic_duplicate_state)(struct drm_connector *connector);
-
 
505
	void (*atomic_destroy_state)(struct drm_connector *connector,
-
 
506
				     struct drm_connector_state *state);
-
 
507
	int (*atomic_set_property)(struct drm_connector *connector,
-
 
508
				   struct drm_connector_state *state,
-
 
509
				   struct drm_property *property,
-
 
510
				   uint64_t val);
416
};
511
};
Line 417... Line 512...
417
 
512
 
418
/**
513
/**
419
 * drm_encoder_funcs - encoder controls
514
 * struct drm_encoder_funcs - encoder controls
420
 * @reset: reset state (e.g. at init or resume time)
515
 * @reset: reset state (e.g. at init or resume time)
421
 * @destroy: cleanup and free associated data
516
 * @destroy: cleanup and free associated data
422
 *
517
 *
423
 * Encoders sit between CRTCs and connectors.
518
 * Encoders sit between CRTCs and connectors.
Line 428... Line 523...
428
};
523
};
Line 429... Line 524...
429
 
524
 
Line 430... Line 525...
430
#define DRM_CONNECTOR_MAX_ENCODER 3
525
#define DRM_CONNECTOR_MAX_ENCODER 3
431
 
526
 
432
/**
527
/**
433
 * drm_encoder - central DRM encoder structure
528
 * struct drm_encoder - central DRM encoder structure
434
 * @dev: parent DRM device
529
 * @dev: parent DRM device
435
 * @head: list management
530
 * @head: list management
436
 * @base: base KMS object
531
 * @base: base KMS object
Line 472... Line 567...
472
#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2)
567
#define DRM_CONNECTOR_POLL_DISCONNECT (1 << 2)
Line 473... Line 568...
473
 
568
 
Line 474... Line 569...
474
#define MAX_ELD_BYTES	128
569
#define MAX_ELD_BYTES	128
475
 
570
 
476
/**
571
/**
477
 * drm_connector - central DRM connector control structure
572
 * struct drm_connector - central DRM connector control structure
478
 * @dev: parent DRM device
573
 * @dev: parent DRM device
479
 * @kdev: kernel device for sysfs attributes
574
 * @kdev: kernel device for sysfs attributes
480
 * @attr: sysfs attributes
575
 * @attr: sysfs attributes
481
 * @head: list management
576
 * @head: list management
482
 * @base: base KMS object
577
 * @base: base KMS object
483
 * @name: connector name
578
 * @name: connector name
484
 * @connector_type: one of the %DRM_MODE_CONNECTOR_ types from drm_mode.h
579
 * @connector_type: one of the %DRM_MODE_CONNECTOR_ types from drm_mode.h
485
 * @connector_type_id: index into connector type enum
580
 * @connector_type_id: index into connector type enum
-
 
581
 * @interlace_allowed: can this connector handle interlaced modes?
486
 * @interlace_allowed: can this connector handle interlaced modes?
582
 * @doublescan_allowed: can this connector handle doublescan?
487
 * @doublescan_allowed: can this connector handle doublescan?
583
 * @stereo_allowed: can this connector handle stereo modes?
488
 * @modes: modes available on this connector (from fill_modes() + user)
584
 * @modes: modes available on this connector (from fill_modes() + user)
489
 * @status: one of the drm_connector_status enums (connected, not, or unknown)
585
 * @status: one of the drm_connector_status enums (connected, not, or unknown)
490
 * @probed_modes: list of modes derived directly from the display
586
 * @probed_modes: list of modes derived directly from the display
491
 * @display_info: information about attached display (e.g. from EDID)
587
 * @display_info: information about attached display (e.g. from EDID)
492
 * @funcs: connector control functions
588
 * @funcs: connector control functions
-
 
589
 * @edid_blob_ptr: DRM property containing EDID if present
493
 * @edid_blob_ptr: DRM property containing EDID if present
590
 * @properties: property tracking for this connector
494
 * @properties: property tracking for this connector
591
 * @path_blob_ptr: DRM blob property data for the DP MST path property
495
 * @polled: a %DRM_CONNECTOR_POLL_ value for core driven polling
592
 * @polled: a %DRM_CONNECTOR_POLL_ value for core driven polling
-
 
593
 * @dpms: current dpms state
496
 * @dpms: current dpms state
594
 * @helper_private: mid-layer private data
-
 
595
 * @cmdline_mode: mode line parsed from the kernel cmdline for this connector
497
 * @helper_private: mid-layer private data
596
 * @force: a %DRM_FORCE_ state for forced mode sets
498
 * @force: a %DRM_FORCE_ state for forced mode sets
597
 * @override_edid: has the EDID been overwritten through debugfs for testing?
499
 * @encoder_ids: valid encoders for this connector
598
 * @encoder_ids: valid encoders for this connector
500
 * @encoder: encoder driving this connector, if any
599
 * @encoder: encoder driving this connector, if any
501
 * @eld: EDID-like data, if present
600
 * @eld: EDID-like data, if present
502
 * @dvi_dual: dual link DVI, if found
601
 * @dvi_dual: dual link DVI, if found
503
 * @max_tmds_clock: max clock rate, if found
602
 * @max_tmds_clock: max clock rate, if found
504
 * @latency_present: AV delay info from ELD, if found
603
 * @latency_present: AV delay info from ELD, if found
505
 * @video_latency: video latency info from ELD, if found
604
 * @video_latency: video latency info from ELD, if found
-
 
605
 * @audio_latency: audio latency info from ELD, if found
-
 
606
 * @null_edid_counter: track sinks that give us all zeros for the EDID
-
 
607
 * @bad_edid_counter: track sinks that give us an EDID with invalid checksum
-
 
608
 * @debugfs_entry: debugfs directory for this connector
-
 
609
 * @state: current atomic state for this connector
-
 
610
 * @has_tile: is this connector connected to a tiled monitor
-
 
611
 * @tile_group: tile group for the connected monitor
-
 
612
 * @tile_is_single_monitor: whether the tile is one monitor housing
-
 
613
 * @num_h_tile: number of horizontal tiles in the tile group
-
 
614
 * @num_v_tile: number of vertical tiles in the tile group
-
 
615
 * @tile_h_loc: horizontal location of this tile
-
 
616
 * @tile_v_loc: vertical location of this tile
506
 * @audio_latency: audio latency info from ELD, if found
617
 * @tile_h_size: horizontal size of this tile.
507
 * @null_edid_counter: track sinks that give us all zeros for the EDID
618
 * @tile_v_size: vertical size of this tile.
508
 *
619
 *
509
 * Each connector may be connected to one or more CRTCs, or may be clonable by
620
 * Each connector may be connected to one or more CRTCs, or may be clonable by
510
 * another connector if they can share a CRTC.  Each connector also has a specific
621
 * another connector if they can share a CRTC.  Each connector also has a specific
Line 538... Line 649...
538
	struct drm_property_blob *edid_blob_ptr;
649
	struct drm_property_blob *edid_blob_ptr;
539
	struct drm_object_properties properties;
650
	struct drm_object_properties properties;
Line 540... Line 651...
540
 
651
 
Line -... Line 652...
-
 
652
	struct drm_property_blob *path_blob_ptr;
-
 
653
 
541
	struct drm_property_blob *path_blob_ptr;
654
	struct drm_property_blob *tile_blob_ptr;
Line 542... Line 655...
542
 
655
 
543
	uint8_t polled; /* DRM_CONNECTOR_POLL_* */
656
	uint8_t polled; /* DRM_CONNECTOR_POLL_* */
Line 544... Line 657...
544
 
657
 
Line 545... Line 658...
545
	/* requested DPMS state */
658
	/* requested DPMS state */
-
 
659
	int dpms;
546
	int dpms;
660
 
547
 
661
	void *helper_private;
548
	void *helper_private;
662
 
549
 
663
	/* forced on connector */
Line 562... Line 676...
562
	int audio_latency[2];
676
	int audio_latency[2];
563
	int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
677
	int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
564
	unsigned bad_edid_counter;
678
	unsigned bad_edid_counter;
Line 565... Line 679...
565
 
679
 
-
 
680
	struct dentry *debugfs_entry;
-
 
681
 
-
 
682
	struct drm_connector_state *state;
-
 
683
 
-
 
684
	/* DisplayID bits */
-
 
685
	bool has_tile;
-
 
686
	struct drm_tile_group *tile_group;
-
 
687
	bool tile_is_single_monitor;
-
 
688
 
-
 
689
	uint8_t num_h_tile, num_v_tile;
-
 
690
	uint8_t tile_h_loc, tile_v_loc;
566
	struct dentry *debugfs_entry;
691
	uint16_t tile_h_size, tile_v_size;
Line 567... Line 692...
567
};
692
};
-
 
693
 
-
 
694
/**
-
 
695
 * struct drm_plane_state - mutable plane state
-
 
696
 * @crtc: currently bound CRTC, NULL if disabled
-
 
697
 * @fb: currently bound framebuffer
-
 
698
 * @fence: optional fence to wait for before scanning out @fb
-
 
699
 * @crtc_x: left position of visible portion of plane on crtc
-
 
700
 * @crtc_y: upper position of visible portion of plane on crtc
-
 
701
 * @crtc_w: width of visible portion of plane on crtc
-
 
702
 * @crtc_h: height of visible portion of plane on crtc
-
 
703
 * @src_x: left position of visible portion of plane within
-
 
704
 *	plane (in 16.16)
-
 
705
 * @src_y: upper position of visible portion of plane within
-
 
706
 *	plane (in 16.16)
-
 
707
 * @src_w: width of visible portion of plane (in 16.16)
-
 
708
 * @src_h: height of visible portion of plane (in 16.16)
-
 
709
 * @state: backpointer to global drm_atomic_state
-
 
710
 */
-
 
711
struct drm_plane_state {
-
 
712
	struct drm_crtc *crtc;   /* do not write directly, use drm_atomic_set_crtc_for_plane() */
-
 
713
	struct drm_framebuffer *fb;  /* do not write directly, use drm_atomic_set_fb_for_plane() */
-
 
714
	struct fence *fence;
-
 
715
 
-
 
716
	/* Signed dest location allows it to be partially off screen */
-
 
717
	int32_t crtc_x, crtc_y;
-
 
718
	uint32_t crtc_w, crtc_h;
-
 
719
 
-
 
720
	/* Source values are 16.16 fixed point */
-
 
721
	uint32_t src_x, src_y;
-
 
722
	uint32_t src_h, src_w;
-
 
723
 
-
 
724
	struct drm_atomic_state *state;
-
 
725
};
-
 
726
 
568
 
727
 
569
/**
728
/**
570
 * drm_plane_funcs - driver plane control functions
729
 * struct drm_plane_funcs - driver plane control functions
571
 * @update_plane: update the plane configuration
730
 * @update_plane: update the plane configuration
-
 
731
 * @disable_plane: shut down the plane
572
 * @disable_plane: shut down the plane
732
 * @destroy: clean up plane resources
-
 
733
 * @reset: reset plane after state has been invalidated (e.g. resume)
-
 
734
 * @set_property: called when a property is changed
-
 
735
 * @atomic_duplicate_state: duplicate the atomic state for this plane
573
 * @destroy: clean up plane resources
736
 * @atomic_destroy_state: destroy an atomic state for this plane
574
 * @set_property: called when a property is changed
737
 * @atomic_set_property: set a property on an atomic state for this plane
575
 */
738
 */
576
struct drm_plane_funcs {
739
struct drm_plane_funcs {
577
	int (*update_plane)(struct drm_plane *plane,
740
	int (*update_plane)(struct drm_plane *plane,
578
			    struct drm_crtc *crtc, struct drm_framebuffer *fb,
741
			    struct drm_crtc *crtc, struct drm_framebuffer *fb,
579
			    int crtc_x, int crtc_y,
742
			    int crtc_x, int crtc_y,
580
			    unsigned int crtc_w, unsigned int crtc_h,
743
			    unsigned int crtc_w, unsigned int crtc_h,
581
			    uint32_t src_x, uint32_t src_y,
744
			    uint32_t src_x, uint32_t src_y,
582
			    uint32_t src_w, uint32_t src_h);
745
			    uint32_t src_w, uint32_t src_h);
-
 
746
	int (*disable_plane)(struct drm_plane *plane);
Line 583... Line 747...
583
	int (*disable_plane)(struct drm_plane *plane);
747
	void (*destroy)(struct drm_plane *plane);
584
	void (*destroy)(struct drm_plane *plane);
748
	void (*reset)(struct drm_plane *plane);
-
 
749
 
-
 
750
	int (*set_property)(struct drm_plane *plane,
-
 
751
			    struct drm_property *property, uint64_t val);
-
 
752
 
-
 
753
	/* atomic update handling */
-
 
754
	struct drm_plane_state *(*atomic_duplicate_state)(struct drm_plane *plane);
-
 
755
	void (*atomic_destroy_state)(struct drm_plane *plane,
-
 
756
				     struct drm_plane_state *state);
-
 
757
	int (*atomic_set_property)(struct drm_plane *plane,
585
 
758
				   struct drm_plane_state *state,
Line 586... Line 759...
586
	int (*set_property)(struct drm_plane *plane,
759
				   struct drm_property *property,
587
			    struct drm_property *property, uint64_t val);
760
				   uint64_t val);
588
};
761
};
589
 
762
 
590
enum drm_plane_type {
763
enum drm_plane_type {
Line 591... Line 764...
591
	DRM_PLANE_TYPE_OVERLAY,
764
	DRM_PLANE_TYPE_OVERLAY,
592
	DRM_PLANE_TYPE_PRIMARY,
765
	DRM_PLANE_TYPE_PRIMARY,
593
	DRM_PLANE_TYPE_CURSOR,
766
	DRM_PLANE_TYPE_CURSOR,
594
};
767
};
595
 
768
 
596
/**
769
/**
597
 * drm_plane - central DRM plane control structure
770
 * struct drm_plane - central DRM plane control structure
598
 * @dev: DRM device this plane belongs to
771
 * @dev: DRM device this plane belongs to
599
 * @head: for list management
772
 * @head: for list management
600
 * @base: base mode object
773
 * @base: base mode object
-
 
774
 * @possible_crtcs: pipes this plane can be bound to
-
 
775
 * @format_types: array of formats supported by this plane
601
 * @possible_crtcs: pipes this plane can be bound to
776
 * @format_count: number of formats supported
602
 * @format_types: array of formats supported by this plane
777
 * @crtc: currently bound CRTC
603
 * @format_count: number of formats supported
778
 * @fb: currently bound fb
-
 
779
 * @old_fb: Temporary tracking of the old fb while a modeset is ongoing. Used by
604
 * @crtc: currently bound CRTC
780
 * 	drm_mode_set_config_internal() to implement correct refcounting.
605
 * @fb: currently bound fb
781
 * @funcs: helper functions
606
 * @funcs: helper functions
782
 * @properties: property tracking for this plane
607
 * @properties: property tracking for this plane
783
 * @type: type of plane (overlay, primary, cursor)
Line -... Line 784...
-
 
784
 * @state: current atomic state for this plane
-
 
785
 */
608
 * @type: type of plane (overlay, primary, cursor)
786
struct drm_plane {
Line 609... Line 787...
609
 */
787
	struct drm_device *dev;
610
struct drm_plane {
788
	struct list_head head;
611
	struct drm_device *dev;
789
 
Line 612... Line 790...
612
	struct list_head head;
790
	struct drm_modeset_lock mutex;
613
 
791
 
Line -... Line 792...
-
 
792
	struct drm_mode_object base;
-
 
793
 
614
	struct drm_mode_object base;
794
	uint32_t possible_crtcs;
Line 615... Line 795...
615
 
795
	uint32_t *format_types;
Line 616... Line 796...
616
	uint32_t possible_crtcs;
796
	uint32_t format_count;
-
 
797
 
-
 
798
	struct drm_crtc *crtc;
-
 
799
	struct drm_framebuffer *fb;
-
 
800
 
617
	uint32_t *format_types;
801
	struct drm_framebuffer *old_fb;
Line 618... Line 802...
618
	uint32_t format_count;
802
 
619
 
803
	const struct drm_plane_funcs *funcs;
620
	struct drm_crtc *crtc;
804
 
621
	struct drm_framebuffer *fb;
805
	struct drm_object_properties properties;
622
 
806
 
623
	const struct drm_plane_funcs *funcs;
807
	enum drm_plane_type type;
624
 
808
 
Line 650... Line 834...
650
	void (*enable)(struct drm_bridge *bridge);
834
	void (*enable)(struct drm_bridge *bridge);
651
	void (*destroy)(struct drm_bridge *bridge);
835
	void (*destroy)(struct drm_bridge *bridge);
652
};
836
};
Line 653... Line 837...
653
 
837
 
654
/**
838
/**
655
 * drm_bridge - central DRM bridge control structure
839
 * struct drm_bridge - central DRM bridge control structure
656
 * @dev: DRM device this bridge belongs to
840
 * @dev: DRM device this bridge belongs to
657
 * @head: list management
841
 * @head: list management
658
 * @base: base mode object
842
 * @base: base mode object
659
 * @funcs: control functions
843
 * @funcs: control functions
Line 668... Line 852...
668
	const struct drm_bridge_funcs *funcs;
852
	const struct drm_bridge_funcs *funcs;
669
	void *driver_private;
853
	void *driver_private;
670
};
854
};
Line 671... Line 855...
671
 
855
 
672
/**
856
/**
673
 * drm_mode_set - new values for a CRTC config change
857
 * struct struct drm_atomic_state - the global state object for atomic updates
-
 
858
 * @dev: parent DRM device
-
 
859
 * @flags: state flags like async update
-
 
860
 * @planes: pointer to array of plane pointers
-
 
861
 * @plane_states: pointer to array of plane states pointers
-
 
862
 * @crtcs: pointer to array of CRTC pointers
-
 
863
 * @crtc_states: pointer to array of CRTC states pointers
-
 
864
 * @num_connector: size of the @connectors and @connector_states arrays
-
 
865
 * @connectors: pointer to array of connector pointers
-
 
866
 * @connector_states: pointer to array of connector states pointers
-
 
867
 * @acquire_ctx: acquire context for this atomic modeset state update
-
 
868
 */
-
 
869
struct drm_atomic_state {
-
 
870
	struct drm_device *dev;
-
 
871
	uint32_t flags;
-
 
872
	struct drm_plane **planes;
-
 
873
	struct drm_plane_state **plane_states;
-
 
874
	struct drm_crtc **crtcs;
-
 
875
	struct drm_crtc_state **crtc_states;
-
 
876
	int num_connector;
-
 
877
	struct drm_connector **connectors;
-
 
878
	struct drm_connector_state **connector_states;
-
 
879
 
-
 
880
	struct drm_modeset_acquire_ctx *acquire_ctx;
-
 
881
};
-
 
882
 
-
 
883
 
-
 
884
/**
674
 * @head: list management
885
 * struct drm_mode_set - new values for a CRTC config change
675
 * @fb: framebuffer to use for new config
886
 * @fb: framebuffer to use for new config
676
 * @crtc: CRTC whose configuration we're about to change
887
 * @crtc: CRTC whose configuration we're about to change
677
 * @mode: mode timings to use
888
 * @mode: mode timings to use
678
 * @x: position of this CRTC relative to @fb
889
 * @x: position of this CRTC relative to @fb
Line 699... Line 910...
699
 
910
 
700
/**
911
/**
701
 * struct drm_mode_config_funcs - basic driver provided mode setting functions
912
 * struct drm_mode_config_funcs - basic driver provided mode setting functions
702
 * @fb_create: create a new framebuffer object
913
 * @fb_create: create a new framebuffer object
-
 
914
 * @output_poll_changed: function to handle output configuration changes
-
 
915
 * @atomic_check: check whether a give atomic state update is possible
-
 
916
 * @atomic_commit: commit an atomic state update previously verified with
703
 * @output_poll_changed: function to handle output configuration changes
917
 * 	atomic_check()
704
 *
918
 *
705
 * Some global (i.e. not per-CRTC, connector, etc) mode setting functions that
919
 * Some global (i.e. not per-CRTC, connector, etc) mode setting functions that
706
 * involve drivers.
920
 * involve drivers.
707
 */
921
 */
708
struct drm_mode_config_funcs {
922
struct drm_mode_config_funcs {
709
	struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
923
	struct drm_framebuffer *(*fb_create)(struct drm_device *dev,
710
					     struct drm_file *file_priv,
924
					     struct drm_file *file_priv,
711
					     struct drm_mode_fb_cmd2 *mode_cmd);
925
					     struct drm_mode_fb_cmd2 *mode_cmd);
-
 
926
	void (*output_poll_changed)(struct drm_device *dev);
-
 
927
 
-
 
928
	int (*atomic_check)(struct drm_device *dev,
-
 
929
			    struct drm_atomic_state *a);
-
 
930
	int (*atomic_commit)(struct drm_device *dev,
-
 
931
			     struct drm_atomic_state *a,
712
	void (*output_poll_changed)(struct drm_device *dev);
932
			     bool async);
Line 713... Line 933...
713
};
933
};
714
 
934
 
715
/**
935
/**
716
 * drm_mode_group - group of mode setting resources for potential sub-grouping
936
 * struct drm_mode_group - group of mode setting resources for potential sub-grouping
717
 * @num_crtcs: CRTC count
937
 * @num_crtcs: CRTC count
-
 
938
 * @num_encoders: encoder count
718
 * @num_encoders: encoder count
939
 * @num_connectors: connector count
719
 * @num_connectors: connector count
940
 * @num_bridges: bridge count
720
 * @id_list: list of KMS object IDs in this group
941
 * @id_list: list of KMS object IDs in this group
721
 *
942
 *
722
 * Currently this simply tracks the global mode setting state.  But in the
943
 * Currently this simply tracks the global mode setting state.  But in the
Line 734... Line 955...
734
	/* list of object IDs for this group */
955
	/* list of object IDs for this group */
735
	uint32_t *id_list;
956
	uint32_t *id_list;
736
};
957
};
Line 737... Line 958...
737
 
958
 
738
/**
959
/**
739
 * drm_mode_config - Mode configuration control structure
960
 * struct drm_mode_config - Mode configuration control structure
-
 
961
 * @mutex: mutex protecting KMS related lists and structures
-
 
962
 * @connection_mutex: ww mutex protecting connector state and routing
-
 
963
 * @acquire_ctx: global implicit acquire context used by atomic drivers for
740
 * @mutex: mutex protecting KMS related lists and structures
964
 * 	legacy ioctls
741
 * @idr_mutex: mutex for KMS ID allocation and management
965
 * @idr_mutex: mutex for KMS ID allocation and management
-
 
966
 * @crtc_idr: main KMS ID tracking object
742
 * @crtc_idr: main KMS ID tracking object
967
 * @fb_lock: mutex to protect fb state and lists
743
 * @num_fb: number of fbs available
968
 * @num_fb: number of fbs available
744
 * @fb_list: list of framebuffers available
969
 * @fb_list: list of framebuffers available
745
 * @num_connector: number of connectors on this device
970
 * @num_connector: number of connectors on this device
746
 * @connector_list: list of connector objects
971
 * @connector_list: list of connector objects
747
 * @num_bridge: number of bridges on this device
972
 * @num_bridge: number of bridges on this device
748
 * @bridge_list: list of bridge objects
973
 * @bridge_list: list of bridge objects
749
 * @num_encoder: number of encoders on this device
974
 * @num_encoder: number of encoders on this device
-
 
975
 * @encoder_list: list of encoder objects
-
 
976
 * @num_overlay_plane: number of overlay planes on this device
-
 
977
 * @num_total_plane: number of universal (i.e. with primary/curso) planes on this device
750
 * @encoder_list: list of encoder objects
978
 * @plane_list: list of plane objects
751
 * @num_crtc: number of CRTCs on this device
979
 * @num_crtc: number of CRTCs on this device
-
 
980
 * @crtc_list: list of CRTC objects
752
 * @crtc_list: list of CRTC objects
981
 * @property_list: list of property objects
753
 * @min_width: minimum pixel width on this device
982
 * @min_width: minimum pixel width on this device
754
 * @min_height: minimum pixel height on this device
983
 * @min_height: minimum pixel height on this device
755
 * @max_width: maximum pixel width on this device
984
 * @max_width: maximum pixel width on this device
756
 * @max_height: maximum pixel height on this device
985
 * @max_height: maximum pixel height on this device
757
 * @funcs: core driver provided mode setting functions
986
 * @funcs: core driver provided mode setting functions
758
 * @fb_base: base address of the framebuffer
987
 * @fb_base: base address of the framebuffer
-
 
988
 * @poll_enabled: track polling support for this device
759
 * @poll_enabled: track polling status for this device
989
 * @poll_running: track polling status for this device
-
 
990
 * @output_poll_work: delayed work for polling in process context
760
 * @output_poll_work: delayed work for polling in process context
991
 * @property_blob_list: list of all the blob property objects
-
 
992
 * @*_property: core property tracking
-
 
993
 * @preferred_depth: preferred RBG pixel depth, used by fb helpers
-
 
994
 * @prefer_shadow: hint to userspace to prefer shadow-fb rendering
-
 
995
 * @async_page_flip: does this device support async flips on the primary plane?
-
 
996
 * @cursor_width: hint to userspace for max cursor width
761
 * @*_property: core property tracking
997
 * @cursor_height: hint to userspace for max cursor height
762
 *
998
 *
763
 * Core mode resource tracking structure.  All CRTC, encoders, and connectors
999
 * Core mode resource tracking structure.  All CRTC, encoders, and connectors
764
 * enumerated by the driver are added here, as are global properties.  Some
1000
 * enumerated by the driver are added here, as are global properties.  Some
765
 * global restrictions are also here, e.g. dimension restrictions.
1001
 * global restrictions are also here, e.g. dimension restrictions.
Line 768... Line 1004...
768
	struct mutex mutex; /* protects configuration (mode lists etc.) */
1004
	struct mutex mutex; /* protects configuration (mode lists etc.) */
769
	struct drm_modeset_lock connection_mutex; /* protects connector->encoder and encoder->crtc links */
1005
	struct drm_modeset_lock connection_mutex; /* protects connector->encoder and encoder->crtc links */
770
	struct drm_modeset_acquire_ctx *acquire_ctx; /* for legacy _lock_all() / _unlock_all() */
1006
	struct drm_modeset_acquire_ctx *acquire_ctx; /* for legacy _lock_all() / _unlock_all() */
771
	struct mutex idr_mutex; /* for IDR management */
1007
	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 */
1008
    struct idr crtc_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */
-
 
1009
	struct idr tile_idr; /* use this idr for all IDs, fb, crtc, connector, modes - just makes life easier */
773
	/* this is limited to one for now */
1010
	/* this is limited to one for now */
Line 774... Line -...
774
 
-
 
775
 
-
 
776
	/**
-
 
777
	 * fb_lock - mutex to protect fb state
-
 
778
	 *
1011
 
779
	 * Besides the global fb list his also protects the fbs list in the
-
 
780
	 * file_priv
-
 
781
	 */
-
 
782
	struct mutex fb_lock;
1012
	struct mutex fb_lock; /* proctects global and per-file fb lists */
783
	int num_fb;
1013
	int num_fb;
Line 784... Line 1014...
784
	struct list_head fb_list;
1014
	struct list_head fb_list;
785
 
1015
 
Line 818... Line 1048...
818
	/* pointers to standard properties */
1048
	/* pointers to standard properties */
819
	struct list_head property_blob_list;
1049
	struct list_head property_blob_list;
820
	struct drm_property *edid_property;
1050
	struct drm_property *edid_property;
821
	struct drm_property *dpms_property;
1051
	struct drm_property *dpms_property;
822
	struct drm_property *path_property;
1052
	struct drm_property *path_property;
-
 
1053
	struct drm_property *tile_property;
823
	struct drm_property *plane_type_property;
1054
	struct drm_property *plane_type_property;
-
 
1055
	struct drm_property *rotation_property;
Line 824... Line 1056...
824
 
1056
 
825
	/* DVI-I properties */
1057
	/* DVI-I properties */
826
	struct drm_property *dvi_i_subconnector_property;
1058
	struct drm_property *dvi_i_subconnector_property;
Line 844... Line 1076...
844
	/* Optional properties */
1076
	/* Optional properties */
845
	struct drm_property *scaling_mode_property;
1077
	struct drm_property *scaling_mode_property;
846
	struct drm_property *aspect_ratio_property;
1078
	struct drm_property *aspect_ratio_property;
847
	struct drm_property *dirty_info_property;
1079
	struct drm_property *dirty_info_property;
Line -... Line 1080...
-
 
1080
 
-
 
1081
	/* properties for virtual machine layout */
-
 
1082
	struct drm_property *suggested_x_property;
-
 
1083
	struct drm_property *suggested_y_property;
848
 
1084
 
849
	/* dumb ioctl parameters */
1085
	/* dumb ioctl parameters */
Line 850... Line 1086...
850
	uint32_t preferred_depth, prefer_shadow;
1086
	uint32_t preferred_depth, prefer_shadow;
851
 
1087
 
Line 852... Line 1088...
852
	/* whether async page flip is supported or not */
1088
	/* whether async page flip is supported or not */
853
	bool async_page_flip;
1089
	bool async_page_flip;
854
 
1090
 
Line -... Line 1091...
-
 
1091
	/* cursor size */
-
 
1092
	uint32_t cursor_width, cursor_height;
-
 
1093
};
-
 
1094
 
-
 
1095
/**
-
 
1096
 * drm_for_each_plane_mask - iterate over planes specified by bitmask
-
 
1097
 * @plane: the loop cursor
-
 
1098
 * @dev: the DRM device
-
 
1099
 * @plane_mask: bitmask of plane indices
-
 
1100
 *
-
 
1101
 * Iterate over all planes specified by bitmask.
-
 
1102
 */
-
 
1103
#define drm_for_each_plane_mask(plane, dev, plane_mask) \
855
	/* cursor size */
1104
	list_for_each_entry((plane), &(dev)->mode_config.plane_list, head) \
856
	uint32_t cursor_width, cursor_height;
1105
		if ((plane_mask) & (1 << drm_plane_index(plane)))
857
};
1106
 
858
 
1107
 
859
#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
1108
#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
Line 873... Line 1122...
873
extern int drm_crtc_init_with_planes(struct drm_device *dev,
1122
extern int drm_crtc_init_with_planes(struct drm_device *dev,
874
				     struct drm_crtc *crtc,
1123
				     struct drm_crtc *crtc,
875
				     struct drm_plane *primary,
1124
				     struct drm_plane *primary,
876
				     struct drm_plane *cursor,
1125
				     struct drm_plane *cursor,
877
				     const struct drm_crtc_funcs *funcs);
1126
				     const struct drm_crtc_funcs *funcs);
878
extern int drm_crtc_init(struct drm_device *dev,
-
 
879
			  struct drm_crtc *crtc,
-
 
880
			  const struct drm_crtc_funcs *funcs);
-
 
881
extern void drm_crtc_cleanup(struct drm_crtc *crtc);
1127
extern void drm_crtc_cleanup(struct drm_crtc *crtc);
882
extern unsigned int drm_crtc_index(struct drm_crtc *crtc);
1128
extern unsigned int drm_crtc_index(struct drm_crtc *crtc);
Line 883... Line 1129...
883
 
1129
 
884
/**
1130
/**
Line 901... Line 1147...
901
			    int connector_type);
1147
			    int connector_type);
902
int drm_connector_register(struct drm_connector *connector);
1148
int drm_connector_register(struct drm_connector *connector);
903
void drm_connector_unregister(struct drm_connector *connector);
1149
void drm_connector_unregister(struct drm_connector *connector);
Line 904... Line 1150...
904
 
1150
 
-
 
1151
extern void drm_connector_cleanup(struct drm_connector *connector);
905
extern void drm_connector_cleanup(struct drm_connector *connector);
1152
extern unsigned int drm_connector_index(struct drm_connector *connector);
906
/* helper to unplug all connectors from sysfs for device */
1153
/* helper to unplug all connectors from sysfs for device */
Line 907... Line 1154...
907
extern void drm_connector_unplug_all(struct drm_device *dev);
1154
extern void drm_connector_unplug_all(struct drm_device *dev);
908
 
1155
 
Line 940... Line 1187...
940
			  unsigned long possible_crtcs,
1187
			  unsigned long possible_crtcs,
941
			  const struct drm_plane_funcs *funcs,
1188
			  const struct drm_plane_funcs *funcs,
942
			  const uint32_t *formats, uint32_t format_count,
1189
			  const uint32_t *formats, uint32_t format_count,
943
			  bool is_primary);
1190
			  bool is_primary);
944
extern void drm_plane_cleanup(struct drm_plane *plane);
1191
extern void drm_plane_cleanup(struct drm_plane *plane);
-
 
1192
extern unsigned int drm_plane_index(struct drm_plane *plane);
945
extern void drm_plane_force_disable(struct drm_plane *plane);
1193
extern void drm_plane_force_disable(struct drm_plane *plane);
946
extern int drm_crtc_check_viewport(const struct drm_crtc *crtc,
1194
extern int drm_crtc_check_viewport(const struct drm_crtc *crtc,
947
				   int x, int y,
1195
				   int x, int y,
948
				   const struct drm_display_mode *mode,
1196
				   const struct drm_display_mode *mode,
949
				   const struct drm_framebuffer *fb);
1197
				   const struct drm_framebuffer *fb);
Line 969... Line 1217...
969
extern void drm_mode_config_init(struct drm_device *dev);
1217
extern void drm_mode_config_init(struct drm_device *dev);
970
extern void drm_mode_config_reset(struct drm_device *dev);
1218
extern void drm_mode_config_reset(struct drm_device *dev);
971
extern void drm_mode_config_cleanup(struct drm_device *dev);
1219
extern void drm_mode_config_cleanup(struct drm_device *dev);
Line 972... Line 1220...
972
 
1220
 
973
extern int drm_mode_connector_set_path_property(struct drm_connector *connector,
1221
extern int drm_mode_connector_set_path_property(struct drm_connector *connector,
-
 
1222
						const char *path);
974
						char *path);
1223
int drm_mode_connector_set_tile_property(struct drm_connector *connector);
975
extern int drm_mode_connector_update_edid_property(struct drm_connector *connector,
1224
extern int drm_mode_connector_update_edid_property(struct drm_connector *connector,
Line 976... Line 1225...
976
                       struct edid *edid);
1225
						   const struct edid *edid);
977
 
1226
 
978
static inline bool drm_property_type_is(struct drm_property *property,
1227
static inline bool drm_property_type_is(struct drm_property *property,
979
		uint32_t type)
1228
		uint32_t type)
Line 1032... Line 1281...
1032
					 int flags, const char *name, uint32_t type);
1281
					 int flags, const char *name, uint32_t type);
1033
extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
1282
extern void drm_property_destroy(struct drm_device *dev, struct drm_property *property);
1034
extern int drm_property_add_enum(struct drm_property *property, int index,
1283
extern int drm_property_add_enum(struct drm_property *property, int index,
1035
				 uint64_t value, const char *name);
1284
				 uint64_t value, const char *name);
1036
extern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
1285
extern int drm_mode_create_dvi_i_properties(struct drm_device *dev);
1037
extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats,
1286
extern int drm_mode_create_tv_properties(struct drm_device *dev,
-
 
1287
					 unsigned int num_modes,
1038
				     char *formats[]);
1288
					 char *modes[]);
1039
extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
1289
extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
1040
extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
1290
extern int drm_mode_create_aspect_ratio_property(struct drm_device *dev);
1041
extern int drm_mode_create_dirty_info_property(struct drm_device *dev);
1291
extern int drm_mode_create_dirty_info_property(struct drm_device *dev);
-
 
1292
extern int drm_mode_create_suggested_offset_properties(struct drm_device *dev);
Line 1042... Line 1293...
1042
 
1293
 
1043
extern int drm_mode_connector_attach_encoder(struct drm_connector *connector,
1294
extern int drm_mode_connector_attach_encoder(struct drm_connector *connector,
1044
					     struct drm_encoder *encoder);
1295
					     struct drm_encoder *encoder);
1045
extern int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
1296
extern int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc,
Line 1104... Line 1355...
1104
				   int hpref, int vpref);
1355
				   int hpref, int vpref);
Line 1105... Line 1356...
1105
 
1356
 
1106
extern int drm_edid_header_is_valid(const u8 *raw_edid);
1357
extern int drm_edid_header_is_valid(const u8 *raw_edid);
1107
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);
1358
extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid);
-
 
1359
extern bool drm_edid_is_valid(struct edid *edid);
-
 
1360
 
-
 
1361
extern struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev,
-
 
1362
							 char topology[8]);
-
 
1363
extern struct drm_tile_group *drm_mode_get_tile_group(struct drm_device *dev,
-
 
1364
					       char topology[8]);
-
 
1365
extern void drm_mode_put_tile_group(struct drm_device *dev,
1108
extern bool drm_edid_is_valid(struct edid *edid);
1366
				   struct drm_tile_group *tg);
1109
struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
1367
struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
1110
					   int hsize, int vsize, int fresh,
1368
					   int hsize, int vsize, int fresh,
Line 1111... Line 1369...
1111
					   bool rb);
1369
					   bool rb);
Line 1118... Line 1376...
1118
				      void *data, struct drm_file *file_priv);
1376
				      void *data, struct drm_file *file_priv);
1119
extern int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
1377
extern int drm_mode_obj_get_properties_ioctl(struct drm_device *dev, void *data,
1120
					     struct drm_file *file_priv);
1378
					     struct drm_file *file_priv);
1121
extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
1379
extern int drm_mode_obj_set_property_ioctl(struct drm_device *dev, void *data,
1122
					   struct drm_file *file_priv);
1380
					   struct drm_file *file_priv);
-
 
1381
extern int drm_mode_plane_set_obj_prop(struct drm_plane *plane,
-
 
1382
				       struct drm_property *property,
-
 
1383
				       uint64_t value);
Line 1123... Line 1384...
1123
 
1384
 
1124
extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
1385
extern void drm_fb_get_bpp_depth(uint32_t format, unsigned int *depth,
1125
				 int *bpp);
1386
				 int *bpp);
1126
extern int drm_format_num_planes(uint32_t format);
1387
extern int drm_format_num_planes(uint32_t format);