Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 4396 → Rev 4397

/contrib/sdk/sources/Intel-2D/sna/gen6_render.c
3327,9 → 3327,7
 
static void gen6_render_fini(struct sna *sna)
{
ENTER();
kgem_bo_destroy(&sna->kgem, sna->render_state.gen6.general_bo);
LEAVE();
}
 
static bool is_gt2(struct sna *sna)
/contrib/sdk/sources/Intel-2D/sna/kgem.c
2937,8 → 2937,6
unsigned int i;
int n;
 
ENTER();
 
/* sync to the most recent request */
for (n = 0; n < ARRAY_SIZE(kgem->requests); n++) {
if (!list_is_empty(&kgem->requests[n])) {
2986,8 → 2984,6
 
kgem->need_purge = false;
kgem->need_expire = false;
 
LEAVE();
}
 
static struct kgem_bo *
5324,6 → 5320,9
int kgem_init_fb(struct kgem *kgem, struct sna_fb *fb)
{
struct kgem_bo *bo;
struct drm_gem_open open_arg;
struct drm_i915_gem_get_tiling get_tiling;
 
size_t size;
int ret;
 
5331,22 → 5330,37
if( ret != 0 )
return 0;
 
size = fb->pitch * fb->height / PAGE_SIZE;
open_arg.name = fb->name;
ret = drmIoctl(kgem->fd, DRM_IOCTL_GEM_OPEN, &open_arg);
if (ret != 0) {
printf("Couldn't reference %s handle 0x%08x\n",
fb->name, fb->name);
return NULL;
}
size = open_arg.size / PAGE_SIZE;
 
bo = __kgem_bo_alloc(-2, size);
bo = __kgem_bo_alloc(open_arg.handle, size);
if (!bo) {
return 0;
}
 
get_tiling.handle = bo->handle;
ret = drmIoctl(kgem->fd,DRM_IOCTL_I915_GEM_GET_TILING,&get_tiling);
if (ret != 0) {
printf("%s: couldn't get tiling for handle %d\n", __FUNCTION__, bo->handle);
// drm_intel_gem_bo_unreference(&bo_gem->bo);
return 0;
}
 
bo->domain = DOMAIN_GTT;
bo->unique_id = kgem_get_unique_id(kgem);
bo->pitch = fb->pitch;
bo->tiling = I915_TILING_X;
bo->tiling = get_tiling.tiling_mode;
bo->scanout = 1;
fb->fb_bo = bo;
 
// printf("fb width %d height %d pitch %d bo %p\n",
// fb->width, fb->height, fb->pitch, fb->fb_bo);
printf("fb handle %d w: %d h: %d pitch %d tilng %d bo %p\n",
bo->handle, fb->width, fb->height, fb->pitch, fb->tiling, fb->fb_bo);
 
return 1;
};
5393,7 → 5407,6
void kgem_close_batches(struct kgem *kgem)
{
int n;
ENTER();
for (n = 0; n < ARRAY_SIZE(kgem->pinned_batches); n++) {
while (!list_is_empty(&kgem->pinned_batches[n]))
{
5404,7 → 5417,6
kgem_bo_destroy(kgem,bo);
}
}
LEAVE();
};
 
struct kgem_bo *kgem_bo_from_handle(struct kgem *kgem, int handle,