Subversion Repositories Kolibri OS

Rev

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

Rev 3266 Rev 3291
Line 30... Line 30...
30
#endif
30
#endif
Line 31... Line 31...
31
 
31
 
32
#include "sna.h"
32
#include "sna.h"
Line -... Line 33...
-
 
33
#include "sna_reg.h"
-
 
34
 
-
 
35
static inline
-
 
36
int user_free(void *mem)
-
 
37
{
-
 
38
    int  val;
-
 
39
    __asm__ __volatile__(
-
 
40
    "int $0x40"
-
 
41
    :"=a"(val)
-
 
42
    :"a"(68),"b"(12),"c"(mem));
-
 
43
    return val;
-
 
44
}
Line 33... Line 45...
33
#include "sna_reg.h"
45
 
Line 34... Line 46...
34
 
46
 
35
 
47
 
Line 967... Line 979...
967
    }
979
    }
Line 968... Line 980...
968
 
980
 
969
    DBG(("%s: maximum batch size? %d\n", __FUNCTION__,
981
    DBG(("%s: maximum batch size? %d\n", __FUNCTION__,
Line 970... Line 982...
970
         kgem->batch_size));
982
         kgem->batch_size));
971
 
983
 
972
    kgem->min_alignment = 4;
984
    kgem->min_alignment = 16;
Line 973... Line 985...
973
    if (gen < 040)
985
    if (gen < 040)
974
        kgem->min_alignment = 64;
986
        kgem->min_alignment = 64;
Line 1313... Line 1325...
1313
	DBG(("%s: releasing %s vma for handle=%d, count=%d\n",
1325
	DBG(("%s: releasing %s vma for handle=%d, count=%d\n",
1314
	     __FUNCTION__, type ? "CPU" : "GTT",
1326
	     __FUNCTION__, type ? "CPU" : "GTT",
1315
	     bo->handle, kgem->vma[type].count));
1327
	     bo->handle, kgem->vma[type].count));
Line 1316... Line 1328...
1316
 
1328
 
1317
	VG(if (type) VALGRIND_MAKE_MEM_NOACCESS(MAP(bo->map), bytes(bo)));
1329
	VG(if (type) VALGRIND_MAKE_MEM_NOACCESS(MAP(bo->map), bytes(bo)));
1318
//	munmap(MAP(bo->map), bytes(bo));
1330
	user_free(MAP(bo->map));
Line 1319... Line 1331...
1319
	bo->map = NULL;
1331
	bo->map = NULL;
1320
 
1332
 
1321
	if (!list_is_empty(&bo->vma)) {
1333
	if (!list_is_empty(&bo->vma)) {
Line 1325... Line 1337...
1325
}
1337
}
Line 1326... Line 1338...
1326
 
1338
 
1327
static void kgem_bo_free(struct kgem *kgem, struct kgem_bo *bo)
1339
static void kgem_bo_free(struct kgem *kgem, struct kgem_bo *bo)
1328
{
1340
{
-
 
1341
	DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
-
 
1342
	printf("%s: handle=%d\n", __FUNCTION__, bo->handle);
1329
	DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
1343
 
1330
	assert(bo->refcnt == 0);
1344
	assert(bo->refcnt == 0);
1331
	assert(bo->exec == NULL);
1345
	assert(bo->exec == NULL);
Line 1332... Line 1346...
1332
	assert(!bo->snoop || bo->rq == NULL);
1346
	assert(!bo->snoop || bo->rq == NULL);
Line 1585... Line 1599...
1585
 
1599
 
1586
static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
1600
static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
1587
{
1601
{
Line -... Line 1602...
-
 
1602
	DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
-
 
1603
 
1588
	DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
1604
	printf("%s: handle=%d\n", __FUNCTION__, bo->handle);
1589
 
1605
		
1590
	assert(list_is_empty(&bo->list));
1606
	assert(list_is_empty(&bo->list));
1591
	assert(bo->refcnt == 0);
1607
	assert(bo->refcnt == 0);
Line 4196... Line 4212...
4196
            fb->width, fb->height, fb->pitch, fb->fb_bo);
4212
            fb->width, fb->height, fb->pitch, fb->fb_bo);
Line 4197... Line 4213...
4197
            
4213
            
4198
    return 1;
4214
    return 1;
Line -... Line 4215...
-
 
4215
};
-
 
4216
 
-
 
4217
void kgem_close_batches(struct kgem *kgem)
Line -... Line 4218...
-
 
4218
{
-
 
4219
    int n;
-
 
4220
 
-
 
4221
	for (n = 0; n < ARRAY_SIZE(kgem->pinned_batches); n++) {
-
 
4222
		while (!list_is_empty(&kgem->pinned_batches[n])) {
-
 
4223
			kgem_bo_destroy(kgem,
-
 
4224
					list_first_entry(&kgem->pinned_batches[n],
-
 
4225
							 struct kgem_bo, list));