Subversion Repositories Kolibri OS

Rev

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

Rev 1125 Rev 1128
Line 44... Line 44...
44
int r100_mc_wait_for_idle(struct radeon_device *rdev);
44
int r100_mc_wait_for_idle(struct radeon_device *rdev);
45
void r100_gpu_wait_for_vsync(struct radeon_device *rdev);
45
void r100_gpu_wait_for_vsync(struct radeon_device *rdev);
46
void r100_gpu_wait_for_vsync2(struct radeon_device *rdev);
46
void r100_gpu_wait_for_vsync2(struct radeon_device *rdev);
47
int r100_debugfs_mc_info_init(struct radeon_device *rdev);
47
int r100_debugfs_mc_info_init(struct radeon_device *rdev);
Line 48... Line -...
48
 
-
 
49
#if 0
48
 
50
/*
49
/*
51
 * PCI GART
50
 * PCI GART
52
 */
51
 */
53
void r100_pci_gart_tlb_flush(struct radeon_device *rdev)
52
void r100_pci_gart_tlb_flush(struct radeon_device *rdev)
Line 103... Line 102...
103
	WREG32(RADEON_AIC_CNTL, tmp & ~RADEON_PCIGART_TRANSLATE_EN);
102
	WREG32(RADEON_AIC_CNTL, tmp & ~RADEON_PCIGART_TRANSLATE_EN);
104
	WREG32(RADEON_AIC_LO_ADDR, 0);
103
	WREG32(RADEON_AIC_LO_ADDR, 0);
105
	WREG32(RADEON_AIC_HI_ADDR, 0);
104
	WREG32(RADEON_AIC_HI_ADDR, 0);
106
}
105
}
Line -... Line 106...
-
 
106
 
107
 
107
 
108
int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
108
int r100_pci_gart_set_page(struct radeon_device *rdev, int i, uint64_t addr)
109
{
109
{
110
	if (i < 0 || i > rdev->gart.num_gpu_pages) {
110
	if (i < 0 || i > rdev->gart.num_gpu_pages) {
111
		return -EINVAL;
111
		return -EINVAL;
Line 130... Line 130...
130
void r100_mc_disable_clients(struct radeon_device *rdev)
130
void r100_mc_disable_clients(struct radeon_device *rdev)
131
{
131
{
132
	uint32_t ov0_scale_cntl, crtc_ext_cntl, crtc_gen_cntl, crtc2_gen_cntl;
132
	uint32_t ov0_scale_cntl, crtc_ext_cntl, crtc_gen_cntl, crtc2_gen_cntl;
Line 133... Line 133...
133
 
133
 
134
	/* FIXME: is this function correct for rs100,rs200,rs300 ? */
134
	/* FIXME: is this function correct for rs100,rs200,rs300 ? */
135
//   if (r100_gui_wait_for_idle(rdev)) {
135
	if (r100_gui_wait_for_idle(rdev)) {
136
//       printk(KERN_WARNING "Failed to wait GUI idle while "
136
		printk(KERN_WARNING "Failed to wait GUI idle while "
137
//              "programming pipes. Bad things might happen.\n");
137
		       "programming pipes. Bad things might happen.\n");
Line 138... Line 138...
138
//   }
138
	}
139
 
139
 
140
	/* stop display and memory access */
140
	/* stop display and memory access */
141
	ov0_scale_cntl = RREG32(RADEON_OV0_SCALE_CNTL);
141
	ov0_scale_cntl = RREG32(RADEON_OV0_SCALE_CNTL);
Line 166... Line 166...
166
void r100_mc_setup(struct radeon_device *rdev)
166
void r100_mc_setup(struct radeon_device *rdev)
167
{
167
{
168
	uint32_t tmp;
168
	uint32_t tmp;
169
	int r;
169
	int r;
Line 170... Line 170...
170
 
170
 
171
	r = r100_debugfs_mc_info_init(rdev);
171
//   r = r100_debugfs_mc_info_init(rdev);
172
	if (r) {
172
//   if (r) {
173
		DRM_ERROR("Failed to register debugfs file for R100 MC !\n");
173
//       DRM_ERROR("Failed to register debugfs file for R100 MC !\n");
174
	}
174
//   }
175
	/* Write VRAM size in case we are limiting it */
175
	/* Write VRAM size in case we are limiting it */
176
	WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size);
176
	WREG32(RADEON_CONFIG_MEMSIZE, rdev->mc.vram_size);
177
	tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1;
177
	tmp = rdev->mc.vram_location + rdev->mc.vram_size - 1;
178
	tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16);
178
	tmp = REG_SET(RADEON_MC_FB_TOP, tmp >> 16);
Line 204... Line 204...
204
 
204
 
205
int r100_mc_init(struct radeon_device *rdev)
205
int r100_mc_init(struct radeon_device *rdev)
206
{
206
{
Line 207... Line 207...
207
	int r;
207
	int r;
208
 
208
 
209
	if (r100_debugfs_rbbm_init(rdev)) {
209
//   if (r100_debugfs_rbbm_init(rdev)) {
Line 210... Line 210...
210
		DRM_ERROR("Failed to register debugfs file for RBBM !\n");
210
//       DRM_ERROR("Failed to register debugfs file for RBBM !\n");
211
	}
211
//   }
212
 
212
 
Line 243... Line 243...
243
}
243
}
Line 244... Line 244...
244
 
244
 
245
void r100_mc_fini(struct radeon_device *rdev)
245
void r100_mc_fini(struct radeon_device *rdev)
246
{
246
{
247
	r100_pci_gart_disable(rdev);
247
	r100_pci_gart_disable(rdev);
248
	radeon_gart_table_ram_free(rdev);
248
//   radeon_gart_table_ram_free(rdev);
249
	radeon_gart_fini(rdev);
249
//   radeon_gart_fini(rdev);
Line 250... Line -...
250
}
-
 
251
 
250
}
252
 
251
 
253
/*
252
/*
254
 * Fence emission
253
 * Fence emission
255
 */
254
 */
Line 266... Line 265...
266
	radeon_ring_write(rdev, fence->seq);
265
	radeon_ring_write(rdev, fence->seq);
267
	radeon_ring_write(rdev, PACKET0(RADEON_GEN_INT_STATUS, 0));
266
	radeon_ring_write(rdev, PACKET0(RADEON_GEN_INT_STATUS, 0));
268
	radeon_ring_write(rdev, RADEON_SW_INT_FIRE);
267
	radeon_ring_write(rdev, RADEON_SW_INT_FIRE);
269
}
268
}
Line 270... Line 269...
270
 
269
 
271
#endif
-
 
272
 
270
#if 0
273
/*
271
/*
274
 * Writeback
272
 * Writeback
275
 */
273
 */
276
int r100_wb_init(struct radeon_device *rdev)
274
int r100_wb_init(struct radeon_device *rdev)
Line 315... Line 313...
315
		rdev->wb.wb_obj = NULL;
313
		rdev->wb.wb_obj = NULL;
316
	}
314
	}
317
}
315
}
Line 318... Line -...
318
 
-
 
319
 
316
 
320
#if 0
317
 
321
int r100_copy_blit(struct radeon_device *rdev,
318
int r100_copy_blit(struct radeon_device *rdev,
322
		   uint64_t src_offset,
319
		   uint64_t src_offset,
323
		   uint64_t dst_offset,
320
		   uint64_t dst_offset,
Line 389... Line 386...
389
	}
386
	}
390
	radeon_ring_unlock_commit(rdev);
387
	radeon_ring_unlock_commit(rdev);
391
	return r;
388
	return r;
392
}
389
}
Line -... Line 390...
-
 
390
 
Line 393... Line 391...
393
 
391
#endif
394
 
392
 
395
/*
393
/*
396
 * CP
394
 * CP
Line 410... Line 408...
410
			  RADEON_ISYNC_WAIT_IDLEGUI |
408
			  RADEON_ISYNC_WAIT_IDLEGUI |
411
			  RADEON_ISYNC_CPSCRATCH_IDLEGUI);
409
			  RADEON_ISYNC_CPSCRATCH_IDLEGUI);
412
	radeon_ring_unlock_commit(rdev);
410
	radeon_ring_unlock_commit(rdev);
413
}
411
}
Line 414... Line -...
414
 
-
 
415
#endif
-
 
416
 
412
 
417
static void r100_cp_load_microcode(struct radeon_device *rdev)
413
static void r100_cp_load_microcode(struct radeon_device *rdev)
418
{
414
{
Line 419... Line -...
419
	int i;
-
 
420
 
-
 
421
    dbgprintf("%s\n",__FUNCTION__);
415
	int i;
422
 
416
 
423
	if (r100_gui_wait_for_idle(rdev)) {
417
	if (r100_gui_wait_for_idle(rdev)) {
424
		printk(KERN_WARNING "Failed to wait GUI idle while "
418
		printk(KERN_WARNING "Failed to wait GUI idle while "
Line 594... Line 588...
594
	}
588
	}
595
	rdev->cp.ready = true;
589
	rdev->cp.ready = true;
596
	return 0;
590
	return 0;
597
}
591
}
Line 598... Line -...
598
 
-
 
Line 599... Line 592...
599
#if 0
592
 
600
 
593
 
601
void r100_cp_fini(struct radeon_device *rdev)
594
void r100_cp_fini(struct radeon_device *rdev)
602
{
595
{
Line 617... Line 610...
617
		printk(KERN_WARNING "Failed to wait GUI idle while "
610
		printk(KERN_WARNING "Failed to wait GUI idle while "
618
		       "programming pipes. Bad things might happen.\n");
611
		       "programming pipes. Bad things might happen.\n");
619
	}
612
	}
620
}
613
}
Line 621... Line -...
621
 
-
 
Line 622... Line 614...
622
#endif
614
 
623
 
615
 
624
int r100_cp_reset(struct radeon_device *rdev)
616
int r100_cp_reset(struct radeon_device *rdev)
625
{
617
{
Line 1045... Line 1037...
1045
		}
1037
		}
1046
	} while (p->idx < p->chunks[p->chunk_ib_idx].length_dw);
1038
	} while (p->idx < p->chunks[p->chunk_ib_idx].length_dw);
1047
	return 0;
1039
	return 0;
1048
}
1040
}
Line -... Line 1041...
-
 
1041
 
Line 1049... Line 1042...
1049
 
1042
#endif
1050
 
1043
 
1051
/*
1044
/*
1052
 * Global GPU functions
1045
 * Global GPU functions
Line 1064... Line 1057...
1064
	    rdev->family == CHIP_RS200) {
1057
	    rdev->family == CHIP_RS200) {
1065
		rdev->pll_errata |= CHIP_ERRATA_PLL_DELAY;
1058
		rdev->pll_errata |= CHIP_ERRATA_PLL_DELAY;
1066
	}
1059
	}
1067
}
1060
}
Line 1068... Line -...
1068
 
-
 
Line 1069... Line 1061...
1069
#endif
1061
 
1070
 
1062
 
1071
 
1063
 
Line 1210... Line 1202...
1210
	tmp = RREG32(RADEON_RBBM_STATUS);
1202
	tmp = RREG32(RADEON_RBBM_STATUS);
1211
	DRM_ERROR("Failed to reset RB2D (RBBM_STATUS=0x%08X)!\n", tmp);
1203
	DRM_ERROR("Failed to reset RB2D (RBBM_STATUS=0x%08X)!\n", tmp);
1212
	return -1;
1204
	return -1;
1213
}
1205
}
Line 1214... Line -...
1214
 
-
 
1215
#if 0
-
 
1216
 
1206
 
1217
int r100_gpu_reset(struct radeon_device *rdev)
1207
int r100_gpu_reset(struct radeon_device *rdev)
1218
{
1208
{
Line 1219... Line 1209...
1219
	uint32_t status;
1209
	uint32_t status;
Line 1304... Line 1294...
1304
 
1294
 
1305
	rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
1295
	rdev->mc.aper_base = drm_get_resource_start(rdev->ddev, 0);
1306
	rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
1296
	rdev->mc.aper_size = drm_get_resource_len(rdev->ddev, 0);
Line 1307... Line -...
1307
}
-
 
1308
 
-
 
1309
#endif
1297
}
1310
 
1298
 
1311
/*
1299
/*
1312
 * Indirect registers accessor
1300
 * Indirect registers accessor
1313
 */
1301
 */