Subversion Repositories Kolibri OS

Rev

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

Rev 5346 Rev 6104
Line 256... Line 256...
256
	uint64_t *chunk_array_ptr;
256
	uint64_t *chunk_array_ptr;
257
	unsigned size, i;
257
	unsigned size, i;
258
	u32 ring = RADEON_CS_RING_GFX;
258
	u32 ring = RADEON_CS_RING_GFX;
259
	s32 priority = 0;
259
	s32 priority = 0;
Line -... Line 260...
-
 
260
 
-
 
261
	INIT_LIST_HEAD(&p->validated);
260
 
262
 
261
	if (!cs->num_chunks) {
263
	if (!cs->num_chunks) {
262
		return 0;
264
		return 0;
-
 
265
	}
263
	}
266
 
264
	/* get chunks */
-
 
265
	INIT_LIST_HEAD(&p->validated);
267
	/* get chunks */
266
	p->idx = 0;
268
	p->idx = 0;
267
	p->ib.sa_bo = NULL;
269
	p->ib.sa_bo = NULL;
268
	p->const_ib.sa_bo = NULL;
270
	p->const_ib.sa_bo = NULL;
269
	p->chunk_ib = NULL;
271
	p->chunk_ib = NULL;
Line 708... Line 710...
708
			   unsigned idx)
710
			   unsigned idx)
709
{
711
{
710
	struct radeon_cs_chunk *ib_chunk = p->chunk_ib;
712
	struct radeon_cs_chunk *ib_chunk = p->chunk_ib;
711
	struct radeon_device *rdev = p->rdev;
713
	struct radeon_device *rdev = p->rdev;
712
	uint32_t header;
714
	uint32_t header;
-
 
715
	int ret = 0, i;
Line 713... Line 716...
713
 
716
 
714
	if (idx >= ib_chunk->length_dw) {
717
	if (idx >= ib_chunk->length_dw) {
715
		DRM_ERROR("Can not parse packet at %d after CS end %d !\n",
718
		DRM_ERROR("Can not parse packet at %d after CS end %d !\n",
716
			  idx, ib_chunk->length_dw);
719
			  idx, ib_chunk->length_dw);
Line 736... Line 739...
736
	case RADEON_PACKET_TYPE2:
739
	case RADEON_PACKET_TYPE2:
737
		pkt->count = -1;
740
		pkt->count = -1;
738
		break;
741
		break;
739
	default:
742
	default:
740
		DRM_ERROR("Unknown packet type %d at %d !\n", pkt->type, idx);
743
		DRM_ERROR("Unknown packet type %d at %d !\n", pkt->type, idx);
741
		return -EINVAL;
744
		ret = -EINVAL;
-
 
745
		goto dump_ib;
742
	}
746
	}
743
	if ((pkt->count + 1 + pkt->idx) >= ib_chunk->length_dw) {
747
	if ((pkt->count + 1 + pkt->idx) >= ib_chunk->length_dw) {
744
		DRM_ERROR("Packet (%d:%d:%d) end after CS buffer (%d) !\n",
748
		DRM_ERROR("Packet (%d:%d:%d) end after CS buffer (%d) !\n",
745
			  pkt->idx, pkt->type, pkt->count, ib_chunk->length_dw);
749
			  pkt->idx, pkt->type, pkt->count, ib_chunk->length_dw);
746
		return -EINVAL;
750
		ret = -EINVAL;
-
 
751
		goto dump_ib;
747
	}
752
	}
748
	return 0;
753
	return 0;
-
 
754
 
-
 
755
dump_ib:
-
 
756
	for (i = 0; i < ib_chunk->length_dw; i++) {
-
 
757
		if (i == idx)
-
 
758
			printk("\t0x%08x <---\n", radeon_get_ib_value(p, i));
-
 
759
		else
-
 
760
			printk("\t0x%08x\n", radeon_get_ib_value(p, i));
-
 
761
	}
-
 
762
	return ret;
749
}
763
}
Line 750... Line 764...
750
 
764
 
751
/**
765
/**
752
 * radeon_cs_packet_next_is_pkt3_nop() - test if the next packet is P3 NOP
766
 * radeon_cs_packet_next_is_pkt3_nop() - test if the next packet is P3 NOP