Subversion Repositories Kolibri OS

Rev

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

Rev 2160 Rev 2997
Line 28... Line 28...
28
 */
28
 */
Line 29... Line 29...
29
 
29
 
30
#ifndef RADEON_MODE_H
30
#ifndef RADEON_MODE_H
Line 31... Line 31...
31
#define RADEON_MODE_H
31
#define RADEON_MODE_H
32
 
-
 
33
#include 
32
 
34
#include 
33
#include 
35
#include 
34
#include 
36
#include 
35
#include 
37
#include 
36
#include 
38
#include 
37
#include 
Line 39... Line 38...
39
#include 
38
#include 
40
#include 
39
#include 
Line 208... Line 207...
208
	CT_IMAC_G5_ISIGHT,
207
	CT_IMAC_G5_ISIGHT,
209
	CT_EMAC,
208
	CT_EMAC,
210
	CT_RN50_POWER,
209
	CT_RN50_POWER,
211
	CT_MAC_X800,
210
	CT_MAC_X800,
212
	CT_MAC_G5_9600,
211
	CT_MAC_G5_9600,
-
 
212
	CT_SAM440EP
213
};
213
};
Line 214... Line 214...
214
 
214
 
215
enum radeon_dvo_chip {
215
enum radeon_dvo_chip {
216
	DVO_SIL164,
216
	DVO_SIL164,
217
	DVO_SIL1178,
217
	DVO_SIL1178,
Line 218... Line 218...
218
};
218
};
Line -... Line 219...
-
 
219
 
-
 
220
struct radeon_fbdev;
-
 
221
 
-
 
222
struct radeon_afmt {
-
 
223
	bool enabled;
-
 
224
	int offset;
-
 
225
	bool last_buffer_filled_status;
219
 
226
	int id;
220
struct radeon_fbdev;
227
};
221
 
228
 
222
struct radeon_mode_info {
229
struct radeon_mode_info {
223
	struct atom_context *atom_context;
230
	struct atom_context *atom_context;
224
	struct card_info *atom_card_info;
231
	struct card_info *atom_card_info;
-
 
232
	enum radeon_connector_table connector_table;
225
	enum radeon_connector_table connector_table;
233
	bool mode_config_initialized;
226
	bool mode_config_initialized;
234
	struct radeon_crtc *crtcs[6];
227
	struct radeon_crtc *crtcs[6];
235
	struct radeon_afmt *afmt[6];
228
	/* DVI-I properties */
236
	/* DVI-I properties */
229
	struct drm_property *coherent_mode_property;
237
	struct drm_property *coherent_mode_property;
Line 241... Line 249...
241
	struct edid *bios_hardcoded_edid;
249
	struct edid *bios_hardcoded_edid;
242
	int bios_hardcoded_edid_size;
250
	int bios_hardcoded_edid_size;
Line 243... Line 251...
243
 
251
 
244
	/* pointer to fbdev info structure */
252
	/* pointer to fbdev info structure */
-
 
253
	struct radeon_fbdev *rfbdev;
-
 
254
	/* firmware flags */
-
 
255
	u16 firmware_flags;
-
 
256
	/* pointer to backlight encoder */
245
	struct radeon_fbdev *rfbdev;
257
	struct radeon_encoder *bl_encoder;
Line -... Line 258...
-
 
258
};
-
 
259
 
-
 
260
#define RADEON_MAX_BL_LEVEL 0xFF
-
 
261
 
-
 
262
#if defined(CONFIG_BACKLIGHT_CLASS_DEVICE) || defined(CONFIG_BACKLIGHT_CLASS_DEVICE_MODULE)
-
 
263
 
-
 
264
struct radeon_backlight_privdata {
-
 
265
	struct radeon_encoder *encoder;
-
 
266
	uint8_t negative;
-
 
267
};
-
 
268
 
246
};
269
#endif
247
 
270
 
Line 248... Line 271...
248
#define MAX_H_CODE_TIMING_LEN 32
271
#define MAX_H_CODE_TIMING_LEN 32
249
#define MAX_V_CODE_TIMING_LEN 32
272
#define MAX_V_CODE_TIMING_LEN 32
Line 258... Line 281...
258
	uint32_t frestart;
281
	uint32_t frestart;
259
	uint16_t h_code_timing[MAX_H_CODE_TIMING_LEN];
282
	uint16_t h_code_timing[MAX_H_CODE_TIMING_LEN];
260
	uint16_t v_code_timing[MAX_V_CODE_TIMING_LEN];
283
	uint16_t v_code_timing[MAX_V_CODE_TIMING_LEN];
261
};
284
};
Line -... Line 285...
-
 
285
 
-
 
286
struct radeon_atom_ss {
-
 
287
	uint16_t percentage;
-
 
288
	uint8_t type;
-
 
289
	uint16_t step;
-
 
290
	uint8_t delay;
-
 
291
	uint8_t range;
-
 
292
	uint8_t refdiv;
-
 
293
	/* asic_ss */
-
 
294
	uint16_t rate;
-
 
295
	uint16_t amount;
-
 
296
};
262
 
297
 
263
struct radeon_crtc {
298
struct radeon_crtc {
264
	struct drm_crtc base;
299
	struct drm_crtc base;
265
	int crtc_id;
300
	int crtc_id;
266
	u16 lut_r[256], lut_g[256], lut_b[256];
301
	u16 lut_r[256], lut_g[256], lut_b[256];
267
	bool enabled;
302
	bool enabled;
-
 
303
	bool can_tile;
268
	bool can_tile;
304
	bool in_mode_set;
269
	uint32_t crtc_offset;
305
	uint32_t crtc_offset;
270
	struct drm_gem_object *cursor_bo;
306
	struct drm_gem_object *cursor_bo;
271
	uint64_t cursor_addr;
307
	uint64_t cursor_addr;
272
	int cursor_width;
308
	int cursor_width;
Line 279... Line 315...
279
	fixed20_12 vsc;
315
	fixed20_12 vsc;
280
	fixed20_12 hsc;
316
	fixed20_12 hsc;
281
	struct drm_display_mode native_mode;
317
	struct drm_display_mode native_mode;
282
	int pll_id;
318
	int pll_id;
283
	int deferred_flip_completion;
319
	int deferred_flip_completion;
-
 
320
	/* pll sharing */
-
 
321
	struct radeon_atom_ss ss;
-
 
322
	bool ss_enabled;
-
 
323
	u32 adjusted_clock;
-
 
324
	int bpc;
-
 
325
	u32 pll_reference_div;
-
 
326
	u32 pll_post_div;
-
 
327
	u32 pll_flags;
-
 
328
	struct drm_encoder *encoder;
-
 
329
	struct drm_connector *connector;
284
};
330
};
Line 285... Line 331...
285
 
331
 
286
struct radeon_encoder_primary_dac {
332
struct radeon_encoder_primary_dac {
287
	/* legacy primary dac */
333
	/* legacy primary dac */
Line 332... Line 378...
332
	uint8_t slave_addr;
378
	uint8_t slave_addr;
333
	enum radeon_dvo_chip dvo_chip;
379
	enum radeon_dvo_chip dvo_chip;
334
};
380
};
Line 335... Line 381...
335
 
381
 
336
/* spread spectrum */
-
 
337
struct radeon_atom_ss {
-
 
338
	uint16_t percentage;
-
 
339
	uint8_t type;
-
 
340
	uint16_t step;
-
 
341
	uint8_t delay;
-
 
342
	uint8_t range;
-
 
343
	uint8_t refdiv;
-
 
344
	/* asic_ss */
-
 
345
	uint16_t rate;
-
 
346
	uint16_t amount;
-
 
347
};
-
 
348
 
382
/* spread spectrum */
349
struct radeon_encoder_atom_dig {
383
struct radeon_encoder_atom_dig {
350
	bool linkb;
384
	bool linkb;
351
	/* atom dig */
385
	/* atom dig */
352
	bool coherent_mode;
386
	bool coherent_mode;
Line 358... Line 392...
358
	/* panel mode */
392
	/* panel mode */
359
	struct drm_display_mode native_mode;
393
	struct drm_display_mode native_mode;
360
	struct backlight_device *bl_dev;
394
	struct backlight_device *bl_dev;
361
	int dpms_mode;
395
	int dpms_mode;
362
	uint8_t backlight_level;
396
	uint8_t backlight_level;
-
 
397
	int panel_mode;
-
 
398
	struct radeon_afmt *afmt;
363
};
399
};
Line 364... Line 400...
364
 
400
 
365
struct radeon_encoder_atom_dac {
401
struct radeon_encoder_atom_dac {
366
	enum radeon_tv_std tv_std;
402
	enum radeon_tv_std tv_std;
Line 379... Line 415...
379
	uint32_t underscan_hborder;
415
	uint32_t underscan_hborder;
380
	uint32_t underscan_vborder;
416
	uint32_t underscan_vborder;
381
	struct drm_display_mode native_mode;
417
	struct drm_display_mode native_mode;
382
	void *enc_priv;
418
	void *enc_priv;
383
	int audio_polling_active;
419
	int audio_polling_active;
384
	int hdmi_offset;
-
 
385
	int hdmi_config_offset;
-
 
386
	int hdmi_audio_workaround;
-
 
387
	int hdmi_buffer_status;
-
 
388
	bool is_ext_encoder;
420
	bool is_ext_encoder;
389
	u16 caps;
421
	u16 caps;
390
};
422
};
Line 391... Line 423...
391
 
423
 
Line 434... Line 466...
434
	uint32_t connector_id;
466
	uint32_t connector_id;
435
	uint32_t devices;
467
	uint32_t devices;
436
	struct radeon_i2c_chan *ddc_bus;
468
	struct radeon_i2c_chan *ddc_bus;
437
	/* some systems have an hdmi and vga port with a shared ddc line */
469
	/* some systems have an hdmi and vga port with a shared ddc line */
438
	bool shared_ddc;
470
	bool shared_ddc;
439
	/* for some Radeon chip families we apply an additional EDID header
-
 
440
	   check as part of the DDC probe */
-
 
441
	bool requires_extended_probe;
-
 
442
	bool use_digital;
471
	bool use_digital;
443
	/* we need to mind the EDID between detect
472
	/* we need to mind the EDID between detect
444
	   and get modes due to analog/digital/tvencoder */
473
	   and get modes due to analog/digital/tvencoder */
445
	struct edid *edid;
474
	struct edid *edid;
446
	void *con_priv;
475
	void *con_priv;
447
	bool dac_load_detect;
476
	bool dac_load_detect;
-
 
477
	bool detected_by_load; /* if the connection status was determined by load */
448
	uint16_t connector_object_id;
478
	uint16_t connector_object_id;
449
	struct radeon_hpd hpd;
479
	struct radeon_hpd hpd;
450
	struct radeon_router router;
480
	struct radeon_router router;
451
	struct radeon_i2c_chan *router_bus;
481
	struct radeon_i2c_chan *router_bus;
452
};
482
};
Line 454... Line 484...
454
struct radeon_framebuffer {
484
struct radeon_framebuffer {
455
   struct drm_framebuffer base;
485
   struct drm_framebuffer base;
456
   struct drm_gem_object *obj;
486
   struct drm_gem_object *obj;
457
};
487
};
Line -... Line 488...
-
 
488
 
-
 
489
#define ENCODER_MODE_IS_DP(em) (((em) == ATOM_ENCODER_MODE_DP) || \
Line 458... Line 490...
458
 
490
				((em) == ATOM_ENCODER_MODE_DP_MST))
459
 
491
 
460
extern enum radeon_tv_std
492
extern enum radeon_tv_std
461
radeon_combios_get_tv_info(struct radeon_device *rdev);
493
radeon_combios_get_tv_info(struct radeon_device *rdev);
Line 462... Line 494...
462
extern enum radeon_tv_std
494
extern enum radeon_tv_std
463
radeon_atombios_get_tv_info(struct radeon_device *rdev);
495
radeon_atombios_get_tv_info(struct radeon_device *rdev);
-
 
496
 
-
 
497
extern struct drm_connector *
-
 
498
radeon_get_connector_for_encoder(struct drm_encoder *encoder);
-
 
499
extern struct drm_connector *
Line 464... Line 500...
464
 
500
radeon_get_connector_for_encoder_init(struct drm_encoder *encoder);
465
extern struct drm_connector *
501
extern bool radeon_dig_monitor_is_duallink(struct drm_encoder *encoder,
466
radeon_get_connector_for_encoder(struct drm_encoder *encoder);
502
				    u32 pixel_clock);
467
 
503
 
-
 
504
extern u16 radeon_encoder_get_dp_bridge_encoder_id(struct drm_encoder *encoder);
Line 468... Line 505...
468
extern bool radeon_encoder_is_dp_bridge(struct drm_encoder *encoder);
505
extern u16 radeon_connector_encoder_get_dp_bridge_encoder_id(struct drm_connector *connector);
469
extern bool radeon_connector_encoder_is_dp_bridge(struct drm_connector *connector);
506
extern bool radeon_connector_encoder_is_hbr2(struct drm_connector *connector);
470
extern bool radeon_connector_encoder_is_hbr2(struct drm_connector *connector);
507
extern bool radeon_connector_is_dp12_capable(struct drm_connector *connector);
471
extern bool radeon_connector_is_dp12_capable(struct drm_connector *connector);
508
extern int radeon_get_monitor_bpc(struct drm_connector *connector);
472
 
509
 
473
extern void radeon_connector_hotplug(struct drm_connector *connector);
510
extern void radeon_connector_hotplug(struct drm_connector *connector);
474
extern int radeon_dp_mode_valid_helper(struct drm_connector *connector,
511
extern int radeon_dp_mode_valid_helper(struct drm_connector *connector,
-
 
512
				       struct drm_display_mode *mode);
475
				       struct drm_display_mode *mode);
513
extern void radeon_dp_set_link_config(struct drm_connector *connector,
476
extern void radeon_dp_set_link_config(struct drm_connector *connector,
514
				      const struct drm_display_mode *mode);
-
 
515
extern void radeon_dp_link_train(struct drm_encoder *encoder,
-
 
516
			  struct drm_connector *connector);
477
				      struct drm_display_mode *mode);
517
extern bool radeon_dp_needs_link_train(struct radeon_connector *radeon_connector);
478
extern void radeon_dp_link_train(struct drm_encoder *encoder,
518
extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector);
-
 
519
extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector);
479
			  struct drm_connector *connector);
520
extern int radeon_dp_get_panel_mode(struct drm_encoder *encoder,
480
extern u8 radeon_dp_getsinktype(struct radeon_connector *radeon_connector);
521
				    struct drm_connector *connector);
481
extern bool radeon_dp_getdpcd(struct radeon_connector *radeon_connector);
522
extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode);
482
extern void atombios_dig_encoder_setup(struct drm_encoder *encoder, int action, int panel_mode);
523
extern void radeon_atom_encoder_init(struct radeon_device *rdev);
483
extern void radeon_atom_encoder_init(struct radeon_device *rdev);
524
extern void radeon_atom_disp_eng_pll_init(struct radeon_device *rdev);
484
extern void atombios_dig_transmitter_setup(struct drm_encoder *encoder,
525
extern void atombios_dig_transmitter_setup(struct drm_encoder *encoder,
485
					   int action, uint8_t lane_num,
526
					   int action, uint8_t lane_num,
Line 486... Line 527...
486
					   uint8_t lane_set);
527
					   uint8_t lane_set);
487
extern void radeon_atom_ext_encoder_setup_ddc(struct drm_encoder *encoder);
528
extern void radeon_atom_ext_encoder_setup_ddc(struct drm_encoder *encoder);
Line 513... Line 554...
513
				   u8 slave_addr,
554
				   u8 slave_addr,
514
				   u8 addr,
555
				   u8 addr,
515
				   u8 val);
556
				   u8 val);
516
extern void radeon_router_select_ddc_port(struct radeon_connector *radeon_connector);
557
extern void radeon_router_select_ddc_port(struct radeon_connector *radeon_connector);
517
extern void radeon_router_select_cd_port(struct radeon_connector *radeon_connector);
558
extern void radeon_router_select_cd_port(struct radeon_connector *radeon_connector);
518
extern bool radeon_ddc_probe(struct radeon_connector *radeon_connector,
559
extern bool radeon_ddc_probe(struct radeon_connector *radeon_connector);
519
			bool requires_extended_probe);
-
 
520
extern int radeon_ddc_get_modes(struct radeon_connector *radeon_connector);
560
extern int radeon_ddc_get_modes(struct radeon_connector *radeon_connector);
Line 521... Line 561...
521
 
561
 
Line 522... Line 562...
522
extern struct drm_encoder *radeon_best_encoder(struct drm_connector *connector);
562
extern struct drm_encoder *radeon_best_encoder(struct drm_connector *connector);
Line 637... Line 677...
637
radeon_combios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on);
677
radeon_combios_encoder_dpms_scratch_regs(struct drm_encoder *encoder, bool on);
638
extern void radeon_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
678
extern void radeon_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
639
				     u16 blue, int regno);
679
				     u16 blue, int regno);
640
extern void radeon_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
680
extern void radeon_crtc_fb_gamma_get(struct drm_crtc *crtc, u16 *red, u16 *green,
641
				     u16 *blue, int regno);
681
				     u16 *blue, int regno);
642
void radeon_framebuffer_init(struct drm_device *dev,
682
int radeon_framebuffer_init(struct drm_device *dev,
643
			     struct radeon_framebuffer *rfb,
683
			     struct radeon_framebuffer *rfb,
644
						  struct drm_mode_fb_cmd *mode_cmd,
684
			     struct drm_mode_fb_cmd2 *mode_cmd,
645
						  struct drm_gem_object *obj);
685
						  struct drm_gem_object *obj);
Line 646... Line 686...
646
 
686
 
647
int radeonfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
687
int radeonfb_remove(struct drm_device *dev, struct drm_framebuffer *fb);
648
bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev);
688
bool radeon_get_legacy_connector_info_from_bios(struct drm_device *dev);
Line 659... Line 699...
659
 
699
 
660
void radeon_enc_destroy(struct drm_encoder *encoder);
700
void radeon_enc_destroy(struct drm_encoder *encoder);
661
void radeon_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj);
701
void radeon_copy_fb(struct drm_device *dev, struct drm_gem_object *dst_obj);
662
void radeon_combios_asic_init(struct drm_device *dev);
702
void radeon_combios_asic_init(struct drm_device *dev);
663
bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
703
bool radeon_crtc_scaling_mode_fixup(struct drm_crtc *crtc,
664
					struct drm_display_mode *mode,
704
					const struct drm_display_mode *mode,
665
					struct drm_display_mode *adjusted_mode);
705
					struct drm_display_mode *adjusted_mode);
666
void radeon_panel_mode_fixup(struct drm_encoder *encoder,
706
void radeon_panel_mode_fixup(struct drm_encoder *encoder,
667
			     struct drm_display_mode *adjusted_mode);
707
			     struct drm_display_mode *adjusted_mode);