/drivers/video/drm/i915/i915_dma.c |
---|
912,6 → 912,7 |
return ret; |
} |
#endif |
static int i915_getparam(struct drm_device *dev, void *data, |
struct drm_file *file_priv) |
991,7 → 992,7 |
value = 1; |
break; |
case I915_PARAM_HAS_SECURE_BATCHES: |
value = capable(CAP_SYS_ADMIN); |
value = 1; |
break; |
case I915_PARAM_HAS_PINNED_BATCHES: |
value = 1; |
1002,14 → 1003,17 |
return -EINVAL; |
} |
if (DRM_COPY_TO_USER(param->value, &value, sizeof(int))) { |
DRM_ERROR("DRM_COPY_TO_USER failed\n"); |
return -EFAULT; |
} |
// if (DRM_COPY_TO_USER(param->value, &value, sizeof(int))) { |
// DRM_ERROR("DRM_COPY_TO_USER failed\n"); |
// return -EFAULT; |
// } |
*param->value = value; |
return 0; |
} |
#if 0 |
static int i915_setparam(struct drm_device *dev, void *data, |
struct drm_file *file_priv) |
{ |
1672,3 → 1676,9 |
return 1; |
} |
#endif |
int gem_getparam(struct drm_device *dev, void *data) |
{ |
return i915_getparam(dev, data, NULL); |
}; |
/drivers/video/drm/i915/i915_drv.c |
---|
49,6 → 49,8 |
struct drm_device *main_device; |
struct drm_file *drm_file_handlers[256]; |
static int i915_modeset __read_mostly = 1; |
MODULE_PARM_DESC(modeset, |
"Use kernel modesetting [KMS] (0=DRM_I915_KMS from .config, " |
481,15 → 483,20 |
int drm_get_dev(struct pci_dev *pdev, const struct pci_device_id *ent) |
{ |
struct drm_device *dev; |
static struct drm_driver driver; |
static struct drm_device drm_dev; |
static struct drm_file drm_file; |
struct drm_device *dev; |
struct drm_file *priv; |
int ret; |
dev = kzalloc(sizeof(*dev), 0); |
if (!dev) |
return -ENOMEM; |
dev = &drm_dev; |
priv = &drm_file; |
drm_file_handlers[0] = priv; |
// ret = pci_enable_device(pdev); |
// if (ret) |
// goto err_g1; |
514,6 → 521,15 |
mutex_init(&dev->struct_mutex); |
mutex_init(&dev->ctxlist_mutex); |
INIT_LIST_HEAD(&priv->lhead); |
INIT_LIST_HEAD(&priv->fbs); |
INIT_LIST_HEAD(&priv->event_list); |
init_waitqueue_head(&priv->event_wait); |
priv->event_space = 4096; /* set aside 4k for event buffer */ |
idr_init(&priv->object_idr); |
spin_lock_init(&priv->table_lock); |
dev->driver = &driver; |
ret = i915_driver_load(dev, ent->driver_data ); |
529,7 → 545,6 |
return 0; |
err_g4: |
// drm_put_minor(&dev->primary); |
//err_g3: |
// if (drm_core_check_feature(dev, DRIVER_MODESET)) |
// drm_put_minor(&dev->control); |
536,7 → 551,6 |
//err_g2: |
// pci_disable_device(pdev); |
//err_g1: |
free(dev); |
return ret; |
} |
/drivers/video/drm/i915/i915_gem.c |
---|
138,7 → 138,6 |
dev_priv->mm.object_memory -= size; |
} |
#if 0 |
static int |
i915_gem_wait_for_error(struct drm_device *dev) |
150,7 → 149,7 |
if (!atomic_read(&dev_priv->mm.wedged)) |
return 0; |
#if 0 |
/* |
* Only wait 10 seconds for the gpu reset to complete to avoid hanging |
* userspace. If it takes that long something really bad is going on and |
174,6 → 173,8 |
x->done++; |
spin_unlock_irqrestore(&x->wait.lock, flags); |
} |
#endif |
return 0; |
} |
185,14 → 186,11 |
if (ret) |
return ret; |
ret = mutex_lock_interruptible(&dev->struct_mutex); |
if (ret) |
return ret; |
mutex_lock(&dev->struct_mutex); |
WARN_ON(i915_verify_lists(dev)); |
return 0; |
} |
#endif |
static inline bool |
i915_gem_object_is_inactive(struct drm_i915_gem_object *obj) |
251,7 → 249,6 |
return 0; |
} |
#if 0 |
static int |
i915_gem_create(struct drm_file *file, |
struct drm_device *dev, |
284,6 → 281,7 |
trace_i915_gem_object_create(obj); |
*handle_p = handle; |
return 0; |
} |
319,6 → 317,8 |
args->size, &args->handle); |
} |
#if 0 |
static int i915_gem_object_needs_bit17_swizzle(struct drm_i915_gem_object *obj) |
{ |
drm_i915_private_t *dev_priv = obj->base.dev->dev_private; |
1473,7 → 1473,7 |
* Fail silently without starting the shrinker |
*/ |
for_each_sg(st->sgl, sg, page_count, i) { |
page = AllocPage(); // oh-oh |
page = (struct page *)AllocPage(); // oh-oh |
if ( page == 0 ) |
goto err_pages; |
3054,7 → 3054,6 |
obj->pin_mappable = false; |
} |
#if 0 |
int |
i915_gem_pin_ioctl(struct drm_device *dev, void *data, |
struct drm_file *file) |
3107,6 → 3106,8 |
return ret; |
} |
#if 0 |
int |
i915_gem_unpin_ioctl(struct drm_device *dev, void *data, |
struct drm_file *file) |
/drivers/video/drm/i915/main.c |
---|
13,7 → 13,21 |
#include "bitmap.h" |
struct pci_device { |
uint16_t domain; |
uint8_t bus; |
uint8_t dev; |
uint8_t func; |
uint16_t vendor_id; |
uint16_t device_id; |
uint16_t subvendor_id; |
uint16_t subdevice_id; |
uint32_t device_class; |
uint8_t revision; |
}; |
extern struct drm_device *main_device; |
extern struct drm_file *drm_file_handlers[256]; |
void cpu_detect(); |
30,6 → 44,10 |
int blit_tex(u32 hbitmap, int dst_x, int dst_y, |
int src_x, int src_y, u32 w, u32 h); |
void get_pci_info(struct pci_device *dev); |
int gem_getparam(struct drm_device *dev, void *data); |
static char log[256]; |
int x86_clflush_size; |
38,7 → 56,6 |
u32_t drvEntry(int action, char *cmdline) |
{ |
struct pci_device_id *ent; |
int err = 0; |
105,6 → 122,12 |
#define SRV_BLIT_TEXTURE 16 |
#define SRV_BLIT_VIDEO 17 |
#define SRV_PCI_INFO 20 |
#define SRV_GET_PARAM 21 |
#define SRV_I915_GEM_CREATE 22 |
#define SRV_DRM_GEM_CLOSE 23 |
#define SRV_I915_GEM_PIN 24 |
#define check_input(size) \ |
if( unlikely((inp==NULL)||(io->inp_size != (size))) ) \ |
break; |
115,6 → 138,8 |
int _stdcall display_handler(ioctl_t *io) |
{ |
struct drm_file *file; |
int retval = -1; |
u32_t *inp; |
u32_t *outp; |
122,6 → 147,8 |
inp = io->input; |
outp = io->output; |
file = drm_file_handlers[0]; |
switch(io->io_code) |
{ |
case SRV_GETVERSION: |
164,7 → 191,7 |
// retval = resize_surface((struct io_call_14*)inp); |
break; |
// case SRV_BLIT_BITMAP: |
case SRV_BLIT_BITMAP: |
// srv_blit_bitmap( inp[0], inp[1], inp[2], |
// inp[3], inp[4], inp[5], inp[6]); |
171,10 → 198,28 |
// blit_tex( inp[0], inp[1], inp[2], |
// inp[3], inp[4], inp[5], inp[6]); |
break; |
case SRV_PCI_INFO: |
get_pci_info((struct pci_device *)inp); |
retval = 0; |
break; |
case SRV_GET_PARAM: |
retval = gem_getparam(main_device, inp); |
break; |
case SRV_I915_GEM_CREATE: |
retval = i915_gem_create_ioctl(main_device, inp, file); |
break; |
case SRV_DRM_GEM_CLOSE: |
retval = drm_gem_close_ioctl(main_device, inp, file); |
break; |
case SRV_I915_GEM_PIN: |
retval = i915_gem_pin_ioctl(main_device, inp, file); |
break; |
}; |
return retval; |
302,3 → 347,18 |
return ret; |
} |
void get_pci_info(struct pci_device *dev) |
{ |
struct pci_dev *pdev = main_device->pdev; |
memset(dev, sizeof(*dev), 0); |
dev->domain = 0; |
dev->bus = pdev->busnr; |
dev->dev = pdev->devfn >> 3; |
dev->func = pdev->devfn & 7; |
dev->vendor_id = pdev->vendor; |
dev->device_id = pdev->device; |
dev->revision = pdev->revision; |
}; |