Subversion Repositories Kolibri OS

Rev

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

Rev 4371 Rev 4392
Line 31... Line 31...
31
#include "i915_drv.h"
31
#include "i915_drv.h"
32
#include "i915_trace.h"
32
#include "i915_trace.h"
33
#include "intel_drv.h"
33
#include "intel_drv.h"
34
//#include 
34
//#include 
Line 35... Line -...
35
 
-
 
36
#define I915_EXEC_SECURE        (1<<9)
-
 
37
#define I915_EXEC_IS_PINNED     (1<<10)
-
 
38
#define I915_EXEC_VEBOX         (4<<0)
-
 
39
 
-
 
40
 
-
 
41
struct drm_i915_gem_object *get_fb_obj();
-
 
Line 42... Line 35...
42
 
35
 
43
 
36
 
44
static unsigned long
37
static unsigned long
45
copy_to_user(void __user *to, const void *from, unsigned long n)
38
copy_to_user(void __user *to, const void *from, unsigned long n)
Line 113... Line 106...
113
 
106
 
114
	spin_lock(&file->table_lock);
107
	spin_lock(&file->table_lock);
115
	for (i = 0; i < args->buffer_count; i++) {
108
	for (i = 0; i < args->buffer_count; i++) {
Line 116... Line -...
116
		struct drm_i915_gem_object *obj;
-
 
117
 
-
 
118
        if(exec[i].handle == -2)
-
 
119
            obj = get_fb_obj();
109
		struct drm_i915_gem_object *obj;
120
        else
110
 
121
		    obj = to_intel_bo(idr_find(&file->object_idr, exec[i].handle));
111
		    obj = to_intel_bo(idr_find(&file->object_idr, exec[i].handle));
122
		if (obj == NULL) {
112
		if (obj == NULL) {
123
			spin_unlock(&file->table_lock);
113
			spin_unlock(&file->table_lock);
Line 135... Line 125...
135
 
125
 
136
		drm_gem_object_reference(&obj->base);
126
		drm_gem_object_reference(&obj->base);
Line 137... Line 127...
137
		list_add_tail(&obj->exec_list, &eb->objects);
127
		list_add_tail(&obj->exec_list, &eb->objects);
138
 
-
 
139
		obj->exec_entry = &exec[i];
-
 
140
 
-
 
141
        if(exec[i].handle == -2)
-
 
142
            continue;
128
 
143
 
129
		obj->exec_entry = &exec[i];
144
		if (eb->and < 0) {
130
		if (eb->and < 0) {
145
			eb->lut[i] = obj;
131
			eb->lut[i] = obj;
146
		} else {
132
		} else {
Line 156... Line 142...
156
}
142
}
Line 157... Line 143...
157
 
143
 
158
static struct drm_i915_gem_object *
144
static struct drm_i915_gem_object *
159
eb_get_object(struct eb_objects *eb, unsigned long handle)
145
eb_get_object(struct eb_objects *eb, unsigned long handle)
160
{
-
 
161
 
-
 
162
    if(handle == -2)
-
 
163
        return get_fb_obj();
-
 
164
 
146
{
165
	if (eb->and < 0) {
147
	if (eb->and < 0) {
166
		if (handle >= -eb->and)
148
		if (handle >= -eb->and)
167
			return NULL;
149
			return NULL;
168
		return eb->lut[handle];
150
		return eb->lut[handle];
Line 379... Line 361...
379
			ret = i915_gem_execbuffer_relocate_entry(obj, eb, r,
361
			ret = i915_gem_execbuffer_relocate_entry(obj, eb, r,
380
								 vm);
362
								 vm);
381
			if (ret)
363
			if (ret)
382
				return ret;
364
				return ret;
Line -... Line 365...
-
 
365
 
-
 
366
		if (r->presumed_offset != offset)
383
 
367
		{
384
            memcpy(&user_relocs->presumed_offset,
368
            memcpy(&user_relocs->presumed_offset,
385
                   &r->presumed_offset,
369
                   &r->presumed_offset,
-
 
370
                   sizeof(r->presumed_offset));
Line 386... Line 371...
386
                   sizeof(r->presumed_offset));
371
		}
387
 
372
 
388
			user_relocs++;
373
			user_relocs++;
389
			r++;
374
			r++;
Line 821... Line 806...
821
		/*
806
		/*
822
		 * We must check that the entire relocation array is safe
807
		 * We must check that the entire relocation array is safe
823
		 * to read, but since we may need to update the presumed
808
		 * to read, but since we may need to update the presumed
824
		 * offsets during execution, check for full write access.
809
		 * offsets during execution, check for full write access.
825
		 */
810
		 */
826
//       if (!access_ok(VERIFY_WRITE, ptr, length))
-
 
827
//           return -EFAULT;
-
 
Line 828... Line -...
828
 
-
 
829
//       if (fault_in_multipages_readable(ptr, length))
-
 
830
//           return -EFAULT;
811
 
Line 831... Line 812...
831
	}
812
	}
832
 
813