Subversion Repositories Kolibri OS

Rev

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

Rev 1321 Rev 1403
Line 95... Line 95...
95
extern int radeon_benchmarking;
95
extern int radeon_benchmarking;
96
extern int radeon_testing;
96
extern int radeon_testing;
97
extern int radeon_connector_table;
97
extern int radeon_connector_table;
98
extern int radeon_tv;
98
extern int radeon_tv;
99
extern int radeon_new_pll;
99
extern int radeon_new_pll;
100
 
-
 
-
 
100
extern int radeon_audio;
Line 101... Line 101...
101
 
101
 
102
typedef struct
102
typedef struct
103
{
103
{
104
  int width;
104
  int width;
Line 223... Line 223...
223
//	wait_queue_head_t		queue;
223
//	wait_queue_head_t		queue;
224
	rwlock_t			lock;
224
	rwlock_t			lock;
225
	struct list_head		created;
225
	struct list_head		created;
226
	struct list_head		emited;
226
	struct list_head		emited;
227
	struct list_head		signaled;
227
	struct list_head		signaled;
-
 
228
	bool				initialized;
228
};
229
};
Line 229... Line 230...
229
 
230
 
230
struct radeon_fence {
231
struct radeon_fence {
231
	struct radeon_device		*rdev;
232
	struct radeon_device		*rdev;
Line 263... Line 264...
263
 * TTM.
264
 * TTM.
264
 */
265
 */
265
struct radeon_mman {
266
struct radeon_mman {
266
	struct ttm_bo_global_ref        bo_global_ref;
267
	struct ttm_bo_global_ref        bo_global_ref;
267
	struct ttm_global_reference	mem_global_ref;
268
	struct ttm_global_reference	mem_global_ref;
268
	bool				mem_global_referenced;
-
 
269
	struct ttm_bo_device		bdev;
269
	struct ttm_bo_device		bdev;
-
 
270
	bool				mem_global_referenced;
-
 
271
	bool				initialized;
270
};
272
};
Line 271... Line 273...
271
 
273
 
272
struct radeon_bo {
274
struct radeon_bo {
273
	/* Protected by gem.mutex */
275
	/* Protected by gem.mutex */
Line 377... Line 379...
377
	u64			vram_end;
379
	u64			vram_end;
378
    unsigned            vram_width;
380
    unsigned            vram_width;
379
	u64			real_vram_size;
381
	u64			real_vram_size;
380
    int                 vram_mtrr;
382
    int                 vram_mtrr;
381
    bool                vram_is_ddr;
383
    bool                vram_is_ddr;
-
 
384
	bool                    igp_sideport_enabled;
382
};
385
};
Line 383... Line 386...
383
 
386
 
384
int radeon_mc_setup(struct radeon_device *rdev);
-
 
-
 
387
int radeon_mc_setup(struct radeon_device *rdev);
-
 
388
bool radeon_combios_sideport_present(struct radeon_device *rdev);
Line 385... Line 389...
385
 
389
bool radeon_atombios_sideport_present(struct radeon_device *rdev);
386
 
390
 
387
/*
391
/*
388
 * GPU scratch registers structures, functions & helpers
392
 * GPU scratch registers structures, functions & helpers
Line 466... Line 470...
466
    unsigned            rptr;
470
    unsigned            rptr;
467
    unsigned            wptr;
471
    unsigned            wptr;
468
    unsigned            wptr_old;
472
    unsigned            wptr_old;
469
    unsigned            ring_size;
473
    unsigned            ring_size;
470
    uint64_t            gpu_addr;
474
    uint64_t            gpu_addr;
471
    uint32_t            align_mask;
-
 
472
    uint32_t            ptr_mask;
475
    uint32_t            ptr_mask;
473
    spinlock_t              lock;
476
    spinlock_t              lock;
474
    bool                enabled;
477
    bool                enabled;
475
};
478
};
Line 688... Line 691...
688
	int (*set_surface_reg)(struct radeon_device *rdev, int reg,
691
	int (*set_surface_reg)(struct radeon_device *rdev, int reg,
689
			       uint32_t tiling_flags, uint32_t pitch,
692
			       uint32_t tiling_flags, uint32_t pitch,
690
			       uint32_t offset, uint32_t obj_size);
693
			       uint32_t offset, uint32_t obj_size);
691
	int (*clear_surface_reg)(struct radeon_device *rdev, int reg);
694
	int (*clear_surface_reg)(struct radeon_device *rdev, int reg);
692
	void (*bandwidth_update)(struct radeon_device *rdev);
695
	void (*bandwidth_update)(struct radeon_device *rdev);
693
	void (*hdp_flush)(struct radeon_device *rdev);
-
 
694
	void (*hpd_init)(struct radeon_device *rdev);
696
	void (*hpd_init)(struct radeon_device *rdev);
695
	void (*hpd_fini)(struct radeon_device *rdev);
697
	void (*hpd_fini)(struct radeon_device *rdev);
696
	bool (*hpd_sense)(struct radeon_device *rdev, enum radeon_hpd_id hpd);
698
	bool (*hpd_sense)(struct radeon_device *rdev, enum radeon_hpd_id hpd);
697
	void (*hpd_set_polarity)(struct radeon_device *rdev, enum radeon_hpd_id hpd);
699
	void (*hpd_set_polarity)(struct radeon_device *rdev, enum radeon_hpd_id hpd);
698
};
700
};
Line 701... Line 703...
701
 * Asic structures
703
 * Asic structures
702
 */
704
 */
703
struct r100_asic {
705
struct r100_asic {
704
	const unsigned	*reg_safe_bm;
706
	const unsigned	*reg_safe_bm;
705
	unsigned	reg_safe_bm_size;
707
	unsigned	reg_safe_bm_size;
-
 
708
	u32		hdp_cntl;
706
};
709
};
Line 707... Line 710...
707
 
710
 
708
struct r300_asic {
711
struct r300_asic {
709
	const unsigned	*reg_safe_bm;
712
	const unsigned	*reg_safe_bm;
-
 
713
	unsigned	reg_safe_bm_size;
-
 
714
	u32		resync_scratch;
710
	unsigned	reg_safe_bm_size;
715
	u32		hdp_cntl;
Line 711... Line 716...
711
};
716
};
712
 
717
 
713
struct r600_asic {
718
struct r600_asic {
Line 820... Line 825...
820
	bool				need_dma32;
825
	bool				need_dma32;
821
	bool				accel_working;
826
	bool				accel_working;
822
	struct radeon_surface_reg surface_regs[RADEON_GEM_MAX_SURFACES];
827
	struct radeon_surface_reg surface_regs[RADEON_GEM_MAX_SURFACES];
823
	const struct firmware *me_fw;	/* all family ME firmware */
828
	const struct firmware *me_fw;	/* all family ME firmware */
824
	const struct firmware *pfp_fw;	/* r6/700 PFP firmware */
829
	const struct firmware *pfp_fw;	/* r6/700 PFP firmware */
-
 
830
	const struct firmware *rlc_fw;	/* r6/700 RLC firmware */
825
	struct r600_blit r600_blit;
831
	struct r600_blit r600_blit;
826
	int msi_enabled; /* msi enabled */
832
	int msi_enabled; /* msi enabled */
-
 
833
 
-
 
834
	/* audio stuff */
-
 
835
//   struct timer_list   audio_timer;
-
 
836
	int			audio_channels;
-
 
837
	int			audio_rate;
-
 
838
	int			audio_bits_per_sample;
-
 
839
	uint8_t			audio_status_bits;
-
 
840
	uint8_t			audio_category_code;
827
};
841
};
Line 828... Line 842...
828
 
842
 
829
int radeon_device_init(struct radeon_device *rdev,
843
int radeon_device_init(struct radeon_device *rdev,
830
		       struct drm_device *ddev,
844
		       struct drm_device *ddev,
Line 840... Line 854...
840
			u64 src_gpu_addr, u64 dst_gpu_addr,
854
			u64 src_gpu_addr, u64 dst_gpu_addr,
841
			int size_bytes);
855
			int size_bytes);
Line 842... Line 856...
842
 
856
 
843
static inline uint32_t r100_mm_rreg(struct radeon_device *rdev, uint32_t reg)
857
static inline uint32_t r100_mm_rreg(struct radeon_device *rdev, uint32_t reg)
844
{
858
{
845
	if (reg < 0x10000)
859
	if (reg < rdev->rmmio_size)
846
		return readl(((void __iomem *)rdev->rmmio) + reg);
860
		return readl(((void __iomem *)rdev->rmmio) + reg);
847
	else {
861
	else {
848
		writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
862
		writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
849
		return readl(((void __iomem *)rdev->rmmio) + RADEON_MM_DATA);
863
		return readl(((void __iomem *)rdev->rmmio) + RADEON_MM_DATA);
850
	}
864
	}
Line 851... Line 865...
851
}
865
}
852
 
866
 
853
static inline void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
867
static inline void r100_mm_wreg(struct radeon_device *rdev, uint32_t reg, uint32_t v)
854
{
868
{
855
	if (reg < 0x10000)
869
	if (reg < rdev->rmmio_size)
856
		writel(v, ((void __iomem *)rdev->rmmio) + reg);
870
		writel(v, ((void __iomem *)rdev->rmmio) + reg);
857
	else {
871
	else {
858
		writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
872
		writel(reg, ((void __iomem *)rdev->rmmio) + RADEON_MM_INDEX);
Line 1002... Line 1016...
1002
#define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l))
1016
#define radeon_set_pcie_lanes(rdev, l) (rdev)->asic->set_pcie_lanes((rdev), (l))
1003
#define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e))
1017
#define radeon_set_clock_gating(rdev, e) (rdev)->asic->set_clock_gating((rdev), (e))
1004
#define radeon_set_surface_reg(rdev, r, f, p, o, s) ((rdev)->asic->set_surface_reg((rdev), (r), (f), (p), (o), (s)))
1018
#define radeon_set_surface_reg(rdev, r, f, p, o, s) ((rdev)->asic->set_surface_reg((rdev), (r), (f), (p), (o), (s)))
1005
#define radeon_clear_surface_reg(rdev, r) ((rdev)->asic->clear_surface_reg((rdev), (r)))
1019
#define radeon_clear_surface_reg(rdev, r) ((rdev)->asic->clear_surface_reg((rdev), (r)))
1006
#define radeon_bandwidth_update(rdev) (rdev)->asic->bandwidth_update((rdev))
1020
#define radeon_bandwidth_update(rdev) (rdev)->asic->bandwidth_update((rdev))
1007
#define radeon_hdp_flush(rdev) (rdev)->asic->hdp_flush((rdev))
-
 
1008
#define radeon_hpd_init(rdev) (rdev)->asic->hpd_init((rdev))
1021
#define radeon_hpd_init(rdev) (rdev)->asic->hpd_init((rdev))
1009
#define radeon_hpd_fini(rdev) (rdev)->asic->hpd_fini((rdev))
1022
#define radeon_hpd_fini(rdev) (rdev)->asic->hpd_fini((rdev))
1010
#define radeon_hpd_sense(rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd))
1023
#define radeon_hpd_sense(rdev, hpd) (rdev)->asic->hpd_sense((rdev), (hpd))
1011
#define radeon_hpd_set_polarity(rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd))
1024
#define radeon_hpd_set_polarity(rdev, hpd) (rdev)->asic->hpd_set_polarity((rdev), (hpd))
Line 1012... Line 1025...
1012
 
1025
 
-
 
1026
/* Common functions */
-
 
1027
/* AGP */
1013
/* Common functions */
1028
extern void radeon_agp_disable(struct radeon_device *rdev);
1014
extern int radeon_gart_table_vram_pin(struct radeon_device *rdev);
1029
extern int radeon_gart_table_vram_pin(struct radeon_device *rdev);
1015
extern int radeon_modeset_init(struct radeon_device *rdev);
1030
extern int radeon_modeset_init(struct radeon_device *rdev);
1016
extern void radeon_modeset_fini(struct radeon_device *rdev);
1031
extern void radeon_modeset_fini(struct radeon_device *rdev);
1017
extern bool radeon_card_posted(struct radeon_device *rdev);
1032
extern bool radeon_card_posted(struct radeon_device *rdev);
Line 1022... Line 1037...
1022
extern void radeon_surface_init(struct radeon_device *rdev);
1037
extern void radeon_surface_init(struct radeon_device *rdev);
1023
extern int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data);
1038
extern int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data);
1024
extern void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable);
1039
extern void radeon_legacy_set_clock_gating(struct radeon_device *rdev, int enable);
1025
extern void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
1040
extern void radeon_atom_set_clock_gating(struct radeon_device *rdev, int enable);
1026
extern void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain);
1041
extern void radeon_ttm_placement_from_domain(struct radeon_bo *rbo, u32 domain);
-
 
1042
extern bool radeon_ttm_bo_is_radeon_bo(struct ttm_buffer_object *bo);
Line 1027... Line 1043...
1027
 
1043
 
1028
/* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */
1044
/* r100,rv100,rs100,rv200,rs200,r200,rv250,rs300,rv280 */
1029
struct r100_mc_save {
1045
struct r100_mc_save {
1030
	u32	GENMO_WT;
1046
	u32	GENMO_WT;
Line 1151... Line 1167...
1151
/* r600 irq */
1167
/* r600 irq */
1152
extern int r600_irq_init(struct radeon_device *rdev);
1168
extern int r600_irq_init(struct radeon_device *rdev);
1153
extern void r600_irq_fini(struct radeon_device *rdev);
1169
extern void r600_irq_fini(struct radeon_device *rdev);
1154
extern void r600_ih_ring_init(struct radeon_device *rdev, unsigned ring_size);
1170
extern void r600_ih_ring_init(struct radeon_device *rdev, unsigned ring_size);
1155
extern int r600_irq_set(struct radeon_device *rdev);
1171
extern int r600_irq_set(struct radeon_device *rdev);
-
 
1172
extern void r600_irq_suspend(struct radeon_device *rdev);
-
 
1173
/* r600 audio */
-
 
1174
extern int r600_audio_init(struct radeon_device *rdev);
-
 
1175
extern int r600_audio_tmds_index(struct drm_encoder *encoder);
-
 
1176
extern void r600_audio_set_clock(struct drm_encoder *encoder, int clock);
-
 
1177
extern void r600_audio_fini(struct radeon_device *rdev);
-
 
1178
extern void r600_hdmi_init(struct drm_encoder *encoder);
-
 
1179
extern void r600_hdmi_enable(struct drm_encoder *encoder, int enable);
-
 
1180
extern void r600_hdmi_setmode(struct drm_encoder *encoder, struct drm_display_mode *mode);
-
 
1181
extern int r600_hdmi_buffer_status_changed(struct drm_encoder *encoder);
-
 
1182
extern void r600_hdmi_update_audio_settings(struct drm_encoder *encoder,
-
 
1183
					    int channels,
-
 
1184
					    int rate,
-
 
1185
					    int bps,
-
 
1186
					    uint8_t status_bits,
-
 
1187
					    uint8_t category_code);
Line 1156... Line 1188...
1156
 
1188
 
Line 1157... Line 1189...
1157
#include "radeon_object.h"
1189
#include "radeon_object.h"
Line 1162... Line 1194...
1162
drm_get_resource_start(struct drm_device *dev, unsigned int resource);
1194
drm_get_resource_start(struct drm_device *dev, unsigned int resource);
1163
resource_size_t
1195
resource_size_t
1164
drm_get_resource_len(struct drm_device *dev, unsigned int resource);
1196
drm_get_resource_len(struct drm_device *dev, unsigned int resource);
Line 1165... Line 1197...
1165
 
1197
 
1166
bool set_mode(struct drm_device *dev, struct drm_connector *connector,
1198
bool set_mode(struct drm_device *dev, struct drm_connector *connector,
Line 1167... Line 1199...
1167
              mode_t *mode, bool strict);
1199
              videomode_t *mode, bool strict);