diff options
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/i915_drv.c | 321 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_drv.h | 32 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_irq.c | 34 |
3 files changed, 192 insertions, 195 deletions
diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index 3c065de9c1b..b1f651d3105 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -68,53 +68,53 @@ int inteldrm_ioctl(struct drm_device *, u_long, caddr_t, struct drm_file *); int inteldrm_intr(void *); void inteldrm_lastclose(struct drm_device *); -void inteldrm_wrap_ring(struct drm_i915_private *); +void inteldrm_wrap_ring(struct inteldrm_softc *); int inteldrm_gmch_match(struct pci_attach_args *); -void inteldrm_chipset_flush(struct drm_i915_private *); +void inteldrm_chipset_flush(struct inteldrm_softc *); void inteldrm_timeout(void *); void inteldrm_hangcheck(void *); void inteldrm_hung(void *, void *); -void inteldrm_965_reset(struct drm_i915_private *, u_int8_t); +void inteldrm_965_reset(struct inteldrm_softc *, u_int8_t); int inteldrm_fault(struct drm_obj *, struct uvm_faultinfo *, off_t, vaddr_t, vm_page_t *, int, int, vm_prot_t, int ); void inteldrm_wipe_mappings(struct drm_obj *); void inteldrm_purge_obj(struct drm_obj *); -void inteldrm_set_max_obj_size(struct drm_i915_private *); +void inteldrm_set_max_obj_size(struct inteldrm_softc *); /* For reset and suspend */ -int inteldrm_save_state(struct drm_i915_private *); -int inteldrm_restore_state(struct drm_i915_private *); -int inteldrm_save_display(struct drm_i915_private *); -int inteldrm_restore_display(struct drm_i915_private *); -void i915_save_vga(struct drm_i915_private *); -void i915_restore_vga(struct drm_i915_private *); -void i915_save_modeset_reg(struct drm_i915_private *); -void i915_restore_modeset_reg(struct drm_i915_private *); -u_int8_t i915_read_indexed(struct drm_i915_private *, u_int16_t, +int inteldrm_save_state(struct inteldrm_softc *); +int inteldrm_restore_state(struct inteldrm_softc *); +int inteldrm_save_display(struct inteldrm_softc *); +int inteldrm_restore_display(struct inteldrm_softc *); +void i915_save_vga(struct inteldrm_softc *); +void i915_restore_vga(struct inteldrm_softc *); +void i915_save_modeset_reg(struct inteldrm_softc *); +void i915_restore_modeset_reg(struct inteldrm_softc *); +u_int8_t i915_read_indexed(struct inteldrm_softc *, u_int16_t, u_int16_t, u_int8_t); -void i915_write_indexed(struct drm_i915_private *, u_int16_t, +void i915_write_indexed(struct inteldrm_softc *, u_int16_t, u_int16_t, u_int8_t, u_int8_t); -void i915_write_ar(struct drm_i915_private *, u_int16_t, u_int8_t, +void i915_write_ar(struct inteldrm_softc *, u_int16_t, u_int8_t, u_int8_t, u_int16_t); -u_int8_t i915_read_ar(struct drm_i915_private *, u_int16_t, +u_int8_t i915_read_ar(struct inteldrm_softc *, u_int16_t, u_int8_t, u_int16_t); -void i915_save_palette(struct drm_i915_private *, enum pipe); -void i915_restore_palette(struct drm_i915_private *, enum pipe); +void i915_save_palette(struct inteldrm_softc *, enum pipe); +void i915_restore_palette(struct inteldrm_softc *, enum pipe); -void i915_alloc_ifp(struct drm_i915_private *, struct pci_attach_args *); -void i965_alloc_ifp(struct drm_i915_private *, struct pci_attach_args *); +void i915_alloc_ifp(struct inteldrm_softc *, struct pci_attach_args *); +void i965_alloc_ifp(struct inteldrm_softc *, struct pci_attach_args *); -void inteldrm_detect_bit_6_swizzle(drm_i915_private_t *, +void inteldrm_detect_bit_6_swizzle(struct inteldrm_softc *, struct pci_attach_args *); -int inteldrm_setup_mchbar(struct drm_i915_private *, +int inteldrm_setup_mchbar(struct inteldrm_softc *, struct pci_attach_args *); -void inteldrm_teardown_mchbar(struct drm_i915_private *, +void inteldrm_teardown_mchbar(struct inteldrm_softc *, struct pci_attach_args *, int); /* Ioctls */ -int inteldrm_getparam(struct drm_i915_private *dev_priv, void *data); -int inteldrm_setparam(struct drm_i915_private *dev_priv, void *data); +int inteldrm_getparam(struct inteldrm_softc *dev_priv, void *data); +int inteldrm_setparam(struct inteldrm_softc *dev_priv, void *data); int i915_gem_init_ioctl(struct drm_device *, void *, struct drm_file *); int i915_gem_create_ioctl(struct drm_device *, void *, struct drm_file *); int i915_gem_pread_ioctl(struct drm_device *, void *, struct drm_file *); @@ -139,26 +139,26 @@ int i915_gem_init_object(struct drm_obj *); void i915_gem_free_object(struct drm_obj *); int i915_gem_object_pin(struct drm_obj *, uint32_t, int); void i915_gem_object_unpin(struct drm_obj *); -void i915_gem_retire_requests(struct drm_i915_private *); -void i915_gem_retire_request(struct drm_i915_private *, +void i915_gem_retire_requests(struct inteldrm_softc *); +void i915_gem_retire_request(struct inteldrm_softc *, struct inteldrm_request *); void i915_gem_retire_work_handler(void *, void*); -int i915_gem_idle(struct drm_i915_private *); +int i915_gem_idle(struct inteldrm_softc *); void i915_gem_object_move_to_active(struct drm_obj *); void i915_gem_object_move_off_active(struct drm_obj *); void i915_gem_object_move_to_inactive(struct drm_obj *); void i915_gem_object_move_to_inactive_locked(struct drm_obj *); -uint32_t i915_add_request(struct drm_i915_private *); -void inteldrm_process_flushing(struct drm_i915_private *, u_int32_t); +uint32_t i915_add_request(struct inteldrm_softc *); +void inteldrm_process_flushing(struct inteldrm_softc *, u_int32_t); void i915_move_to_tail(struct inteldrm_obj *, struct i915_gem_list *); void i915_list_remove(struct inteldrm_obj *); -int i915_gem_init_hws(struct drm_i915_private *); -void i915_gem_cleanup_hws(struct drm_i915_private *); -int i915_gem_init_ringbuffer(struct drm_i915_private *); -int inteldrm_start_ring(struct drm_i915_private *); -void i915_gem_cleanup_ringbuffer(struct drm_i915_private *); +int i915_gem_init_hws(struct inteldrm_softc *); +void i915_gem_cleanup_hws(struct inteldrm_softc *); +int i915_gem_init_ringbuffer(struct inteldrm_softc *); +int inteldrm_start_ring(struct inteldrm_softc *); +void i915_gem_cleanup_ringbuffer(struct inteldrm_softc *); int i915_gem_ring_throttle(struct drm_device *, struct drm_file *); -int i915_gem_evict_inactive(struct drm_i915_private *); +int i915_gem_evict_inactive(struct inteldrm_softc *); int i915_gem_get_relocs_from_user(struct drm_i915_gem_exec_object2 *, u_int32_t, struct drm_i915_gem_relocation_entry **); int i915_gem_put_relocs_to_user(struct drm_i915_gem_exec_object2 *, @@ -170,15 +170,15 @@ int i915_gem_object_pin_and_relocate(struct drm_obj *, struct drm_file *, struct drm_i915_gem_exec_object2 *, struct drm_i915_gem_relocation_entry *); int i915_gem_object_bind_to_gtt(struct drm_obj *, bus_size_t, int); -int i915_wait_request(struct drm_i915_private *, uint32_t, int); -u_int32_t i915_gem_flush(struct drm_i915_private *, uint32_t, uint32_t); +int i915_wait_request(struct inteldrm_softc *, uint32_t, int); +u_int32_t i915_gem_flush(struct inteldrm_softc *, uint32_t, uint32_t); int i915_gem_object_unbind(struct drm_obj *, int); -struct drm_obj *i915_gem_find_inactive_object(struct drm_i915_private *, +struct drm_obj *i915_gem_find_inactive_object(struct inteldrm_softc *, size_t); -int i915_gem_evict_everything(struct drm_i915_private *, int); -int i915_gem_evict_something(struct drm_i915_private *, size_t, int); +int i915_gem_evict_everything(struct inteldrm_softc *, int); +int i915_gem_evict_something(struct inteldrm_softc *, size_t, int); int i915_gem_object_set_to_gtt_domain(struct drm_obj *, int, int); int i915_gem_object_set_to_cpu_domain(struct drm_obj *, int, int); int i915_gem_object_flush_gpu_write_domain(struct drm_obj *, int, int, int); @@ -186,7 +186,7 @@ int i915_gem_get_fence_reg(struct drm_obj *, int); int i915_gem_object_put_fence_reg(struct drm_obj *, int); bus_size_t i915_gem_get_gtt_alignment(struct drm_obj *); -bus_size_t i915_get_fence_size(struct drm_i915_private *, bus_size_t); +bus_size_t i915_get_fence_size(struct inteldrm_softc *, bus_size_t); int i915_tiling_ok(struct drm_device *, int, int, int); int i915_gem_object_fence_offset_ok(struct drm_obj *, int); void i965_write_fence_reg(struct inteldrm_fence *); @@ -205,7 +205,7 @@ void i915_batchbuffer_info(int); void i915_ringbuffer_data(int); void i915_ringbuffer_info(int); #ifdef WATCH_INACTIVE -void inteldrm_verify_inactive(struct drm_i915_private *, char *, int); +void inteldrm_verify_inactive(struct inteldrm_softc *, char *, int); #else #define inteldrm_verify_inactive(dev,file,line) #endif @@ -291,8 +291,7 @@ static const struct drm_driver_info inteldrm_driver = { .patchlevel = DRIVER_PATCHLEVEL, .flags = DRIVER_AGP | DRIVER_AGP_REQUIRE | - DRIVER_MTRR | DRIVER_IRQ - | DRIVER_GEM, + DRIVER_MTRR | DRIVER_IRQ | DRIVER_GEM, }; int @@ -320,7 +319,7 @@ inteldrm_gmch_match(struct pci_attach_args *pa) void inteldrm_attach(struct device *parent, struct device *self, void *aux) { - struct drm_i915_private *dev_priv = (struct drm_i915_private *)self; + struct inteldrm_softc *dev_priv = (struct inteldrm_softc *)self; struct pci_attach_args *pa = aux, bpa; struct vga_pci_bar *bar; struct drm_device *dev; @@ -483,7 +482,7 @@ inteldrm_attach(struct device *parent, struct device *self, void *aux) int inteldrm_detach(struct device *self, int flags) { - struct drm_i915_private *dev_priv = (struct drm_i915_private *)self; + struct inteldrm_softc *dev_priv = (struct inteldrm_softc *)self; /* this will quiesce any dma that's going on and kill the timeouts. */ if (dev_priv->drmdev != NULL) { @@ -499,7 +498,6 @@ inteldrm_detach(struct device *self, int flags) dev_priv->hw_status_page = NULL; } - if (IS_I9XX(dev_priv) && dev_priv->ifp.i9xx.bsh != NULL) { bus_space_unmap(dev_priv->ifp.i9xx.bst, dev_priv->ifp.i9xx.bsh, PAGE_SIZE); @@ -521,7 +519,7 @@ inteldrm_detach(struct device *self, int flags) int inteldrm_activate(struct device *arg, int act) { - struct drm_i915_private *dev_priv = (struct drm_i915_private *)arg; + struct inteldrm_softc *dev_priv = (struct inteldrm_softc *)arg; switch (act) { case DVACT_SUSPEND: @@ -536,7 +534,7 @@ inteldrm_activate(struct device *arg, int act) } struct cfattach inteldrm_ca = { - sizeof(struct drm_i915_private), inteldrm_probe, inteldrm_attach, + sizeof(struct inteldrm_softc), inteldrm_probe, inteldrm_attach, inteldrm_detach, inteldrm_activate }; @@ -548,7 +546,7 @@ int inteldrm_ioctl(struct drm_device *dev, u_long cmd, caddr_t data, struct drm_file *file_priv) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; if (file_priv->authenticated == 1) { switch (cmd) { @@ -607,7 +605,7 @@ inteldrm_ioctl(struct drm_device *dev, u_long cmd, caddr_t data, int inteldrm_intr(void *arg) { - drm_i915_private_t *dev_priv = arg; + struct inteldrm_softc *dev_priv = arg; struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; u_int32_t iir, pipea_stats = 0, pipeb_stats = 0; @@ -659,7 +657,7 @@ inteldrm_intr(void *arg) } u_int32_t -inteldrm_read_hws(struct drm_i915_private *dev_priv, int reg) +inteldrm_read_hws(struct inteldrm_softc *dev_priv, int reg) { struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; struct inteldrm_obj *obj_priv; @@ -688,7 +686,7 @@ inteldrm_read_hws(struct drm_i915_private *dev_priv, int reg) * These five ring manipulation functions are protected by dev->dev_lock. */ int -inteldrm_wait_ring(struct drm_i915_private *dev_priv, int n) +inteldrm_wait_ring(struct inteldrm_softc *dev_priv, int n) { struct inteldrm_ring *ring = &dev_priv->ring; u_int32_t acthd_reg, acthd, last_acthd, last_head; @@ -724,7 +722,7 @@ inteldrm_wait_ring(struct drm_i915_private *dev_priv, int n) } void -inteldrm_wrap_ring(struct drm_i915_private *dev_priv) +inteldrm_wrap_ring(struct inteldrm_softc *dev_priv) { u_int32_t rem;; @@ -742,7 +740,7 @@ inteldrm_wrap_ring(struct drm_i915_private *dev_priv) } void -inteldrm_begin_ring(struct drm_i915_private *dev_priv, int ncmd) +inteldrm_begin_ring(struct inteldrm_softc *dev_priv, int ncmd) { int bytes = 4 * ncmd; @@ -758,7 +756,7 @@ inteldrm_begin_ring(struct drm_i915_private *dev_priv, int ncmd) } void -inteldrm_out_ring(struct drm_i915_private *dev_priv, u_int32_t cmd) +inteldrm_out_ring(struct inteldrm_softc *dev_priv, u_int32_t cmd) { INTELDRM_VPRINTF("%s: %x\n", __func__, cmd); bus_space_write_4(dev_priv->bst, dev_priv->ring.bsh, @@ -771,7 +769,7 @@ inteldrm_out_ring(struct drm_i915_private *dev_priv, u_int32_t cmd) } void -inteldrm_advance_ring(struct drm_i915_private *dev_priv) +inteldrm_advance_ring(struct inteldrm_softc *dev_priv) { INTELDRM_VPRINTF("%s: %x, %x\n", __func__, dev_priv->ring.wspace, dev_priv->ring.woffset); @@ -780,7 +778,7 @@ inteldrm_advance_ring(struct drm_i915_private *dev_priv) } void -inteldrm_update_ring(struct drm_i915_private *dev_priv) +inteldrm_update_ring(struct inteldrm_softc *dev_priv) { struct inteldrm_ring *ring = &dev_priv->ring; @@ -798,7 +796,7 @@ inteldrm_update_ring(struct drm_i915_private *dev_priv) * in the register. */ int -i915_init_phys_hws(drm_i915_private_t *dev_priv, bus_dma_tag_t dmat) +i915_init_phys_hws(struct inteldrm_softc *dev_priv, bus_dma_tag_t dmat) { /* Program Hardware Status Page */ if ((dev_priv->hws_dmamem = drm_dmamem_alloc(dmat, PAGE_SIZE, @@ -818,7 +816,7 @@ i915_init_phys_hws(drm_i915_private_t *dev_priv, bus_dma_tag_t dmat) } void -i915_alloc_ifp(struct drm_i915_private *dev_priv, struct pci_attach_args *bpa) +i915_alloc_ifp(struct inteldrm_softc *dev_priv, struct pci_attach_args *bpa) { bus_addr_t addr; u_int32_t reg; @@ -849,7 +847,7 @@ nope: } void -i965_alloc_ifp(struct drm_i915_private *dev_priv, struct pci_attach_args *bpa) +i965_alloc_ifp(struct inteldrm_softc *dev_priv, struct pci_attach_args *bpa) { bus_addr_t addr; u_int32_t lo, hi; @@ -884,7 +882,7 @@ nope: } void -inteldrm_chipset_flush(struct drm_i915_private *dev_priv) +inteldrm_chipset_flush(struct inteldrm_softc *dev_priv) { /* * Write to this flush page flushes the chipset write cache. @@ -912,7 +910,7 @@ inteldrm_chipset_flush(struct drm_i915_private *dev_priv) void inteldrm_lastclose(struct drm_device *dev) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct vm_page *p; int ret; @@ -937,7 +935,7 @@ inteldrm_lastclose(struct drm_device *dev) } int -inteldrm_getparam(struct drm_i915_private *dev_priv, void *data) +inteldrm_getparam(struct inteldrm_softc *dev_priv, void *data) { drm_i915_getparam_t *param = data; int value; @@ -963,7 +961,7 @@ inteldrm_getparam(struct drm_i915_private *dev_priv, void *data) } int -inteldrm_setparam(struct drm_i915_private *dev_priv, void *data) +inteldrm_setparam(struct inteldrm_softc *dev_priv, void *data) { drm_i915_setparam_t *param = data; @@ -988,8 +986,8 @@ int i915_gem_init_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_i915_private_t *dev_priv = dev->dev_private; - struct drm_i915_gem_init *args = data; + struct inteldrm_softc *dev_priv = dev->dev_private; + struct drm_i915_gem_init *args = data; DRM_LOCK(); @@ -1025,7 +1023,7 @@ i915_gem_init_ioctl(struct drm_device *dev, void *data, } void -inteldrm_set_max_obj_size(struct drm_i915_private *dev_priv) +inteldrm_set_max_obj_size(struct inteldrm_softc *dev_priv) { struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; @@ -1061,7 +1059,7 @@ int i915_gem_create_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_i915_gem_create *args = data; struct drm_obj *obj; int handle, ret; @@ -1101,7 +1099,7 @@ int i915_gem_pread_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_i915_gem_pread *args = data; struct drm_obj *obj; struct inteldrm_obj *obj_priv; @@ -1172,7 +1170,7 @@ int i915_gem_pwrite_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_i915_gem_pwrite *args = data; struct drm_obj *obj; struct inteldrm_obj *obj_priv; @@ -1330,7 +1328,7 @@ void i915_gem_object_move_to_active(struct drm_obj *obj) { struct drm_device *dev = obj->dev; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; struct inteldrm_fence *reg; u_int32_t seqno = dev_priv->mm.next_gem_seqno; @@ -1360,7 +1358,7 @@ void i915_gem_object_move_off_active(struct drm_obj *obj) { struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; struct inteldrm_fence *reg; @@ -1384,7 +1382,7 @@ void i915_gem_object_move_to_inactive(struct drm_obj *obj) { struct drm_device *dev = obj->dev; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; mtx_enter(&dev_priv->list_lock); drm_lock_obj(obj); @@ -1397,7 +1395,7 @@ void i915_gem_object_move_to_inactive_locked(struct drm_obj *obj) { struct drm_device *dev = obj->dev; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; MUTEX_ASSERT_LOCKED(&dev_priv->list_lock); @@ -1449,7 +1447,7 @@ inteldrm_purge_obj(struct drm_obj *obj) } void -inteldrm_process_flushing(struct drm_i915_private *dev_priv, +inteldrm_process_flushing(struct inteldrm_softc *dev_priv, u_int32_t flush_domains) { struct inteldrm_obj *obj_priv, *next; @@ -1496,7 +1494,7 @@ inteldrm_process_flushing(struct drm_i915_private *dev_priv, * Returned sequence numbers are nonzero on success. */ uint32_t -i915_add_request(struct drm_i915_private *dev_priv) +i915_add_request(struct inteldrm_softc *dev_priv) { struct inteldrm_request *request; uint32_t seqno; @@ -1549,7 +1547,7 @@ i915_add_request(struct drm_i915_private *dev_priv) * called with and sleeps with the drm_lock. */ void -i915_gem_retire_request(struct drm_i915_private *dev_priv, +i915_gem_retire_request(struct inteldrm_softc *dev_priv, struct inteldrm_request *request) { struct inteldrm_obj *obj_priv; @@ -1593,7 +1591,7 @@ i915_gem_retire_request(struct drm_i915_private *dev_priv, * This function clears the request list as sequence numbers are passed. */ void -i915_gem_retire_requests(struct drm_i915_private *dev_priv) +i915_gem_retire_requests(struct inteldrm_softc *dev_priv) { struct inteldrm_request *request; uint32_t seqno; @@ -1622,7 +1620,7 @@ i915_gem_retire_requests(struct drm_i915_private *dev_priv) void i915_gem_retire_work_handler(void *arg1, void *unused) { - drm_i915_private_t *dev_priv = arg1; + struct inteldrm_softc *dev_priv = arg1; i915_gem_retire_requests(dev_priv); if (!TAILQ_EMPTY(&dev_priv->mm.request_list)) @@ -1636,7 +1634,7 @@ i915_gem_retire_work_handler(void *arg1, void *unused) * Called locked, sleeps with it. */ int -i915_wait_request(struct drm_i915_private *dev_priv, uint32_t seqno, +i915_wait_request(struct inteldrm_softc *dev_priv, uint32_t seqno, int interruptible) { int ret = 0; @@ -1686,7 +1684,7 @@ i915_wait_request(struct drm_i915_private *dev_priv, uint32_t seqno, * the request. else (failed or just cpu flushed) we return 0. */ u_int32_t -i915_gem_flush(struct drm_i915_private *dev_priv, uint32_t invalidate_domains, +i915_gem_flush(struct inteldrm_softc *dev_priv, uint32_t invalidate_domains, uint32_t flush_domains) { uint32_t cmd; @@ -1763,7 +1761,7 @@ int i915_gem_object_unbind(struct drm_obj *obj, int interruptible) { struct drm_device *dev = obj->dev; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; int ret = 0; @@ -1825,7 +1823,7 @@ i915_gem_object_unbind(struct drm_obj *obj, int interruptible) } int -i915_gem_evict_something(struct drm_i915_private *dev_priv, size_t min_size, +i915_gem_evict_something(struct inteldrm_softc *dev_priv, size_t min_size, int interruptible) { struct drm_obj *obj; @@ -1912,7 +1910,7 @@ i915_gem_evict_something(struct drm_i915_private *dev_priv, size_t min_size, } struct drm_obj * -i915_gem_find_inactive_object(struct drm_i915_private *dev_priv, +i915_gem_find_inactive_object(struct inteldrm_softc *dev_priv, size_t min_size) { struct drm_obj *obj, *best = NULL, *first = NULL; @@ -1955,7 +1953,7 @@ i915_gem_find_inactive_object(struct drm_i915_private *dev_priv, } int -i915_gem_evict_everything(struct drm_i915_private *dev_priv, int interruptible) +i915_gem_evict_everything(struct inteldrm_softc *dev_priv, int interruptible) { u_int32_t seqno; int ret; @@ -1992,7 +1990,7 @@ bus_size_t i915_gem_get_gtt_alignment(struct drm_obj *obj) { struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; bus_size_t start, i; @@ -2023,7 +2021,7 @@ i965_write_fence_reg(struct inteldrm_fence *reg) { struct drm_obj *obj = reg->obj; struct drm_device *dev = obj->dev; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; int regnum = obj_priv->fence_reg; u_int64_t val; @@ -2044,7 +2042,7 @@ i915_write_fence_reg(struct inteldrm_fence *reg) { struct drm_obj *obj = reg->obj; struct drm_device *dev = obj->dev; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; bus_size_t fence_reg; u_int32_t val; @@ -2094,7 +2092,7 @@ i830_write_fence_reg(struct inteldrm_fence *reg) { struct drm_obj *obj = reg->obj; struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; int regnum = obj_priv->fence_reg; u_int32_t pitch_val, val; @@ -2135,7 +2133,7 @@ int i915_gem_get_fence_reg(struct drm_obj *obj, int interruptible) { struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; struct inteldrm_obj *old_obj_priv = NULL; struct drm_obj *old_obj = NULL; @@ -2250,7 +2248,7 @@ int i915_gem_object_put_fence_reg(struct drm_obj *obj, int interruptible) { struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; struct inteldrm_fence *reg; int ret; @@ -2432,7 +2430,7 @@ inteldrm_wipe_mappings(struct drm_obj *obj) { struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct vm_page *pg; DRM_ASSERT_HELD(obj); @@ -2454,7 +2452,7 @@ i915_gem_object_bind_to_gtt(struct drm_obj *obj, bus_size_t alignment, int interruptible) { struct drm_device *dev = obj->dev; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; int ret; @@ -2542,7 +2540,7 @@ i915_gem_object_flush_gpu_write_domain(struct drm_obj *obj, int pipelined, int interruptible, int write) { struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; u_int32_t seqno; int ret = 0; @@ -2582,7 +2580,7 @@ i915_gem_object_set_to_gtt_domain(struct drm_obj *obj, int write, int interruptible) { struct drm_device *dev = (struct drm_device *)obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; int ret; @@ -2642,7 +2640,7 @@ i915_gem_object_set_to_cpu_domain(struct drm_obj *obj, int write, int interruptible) { struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; int ret; @@ -2808,7 +2806,7 @@ void i915_gem_object_set_to_gpu_domain(struct drm_obj *obj) { struct drm_device *dev = obj->dev; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; u_int32_t invalidate_domains = 0; u_int32_t flush_domains = 0; @@ -2876,13 +2874,12 @@ i915_gem_object_pin_and_relocate(struct drm_obj *obj, struct drm_file *file_priv, struct drm_i915_gem_exec_object2 *entry, struct drm_i915_gem_relocation_entry *relocs) { - struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; - struct drm_obj *target_obj; - struct inteldrm_obj *obj_priv = - (struct inteldrm_obj *)obj; - bus_space_handle_t bsh; - int i, ret, needs_fence; + struct drm_device *dev = obj->dev; + struct inteldrm_softc *dev_priv = dev->dev_private; + struct drm_obj *target_obj; + struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; + bus_space_handle_t bsh; + int i, ret, needs_fence; DRM_ASSERT_HELD(obj); needs_fence = ((entry->flags & EXEC_OBJECT_NEEDS_FENCE) && @@ -3033,7 +3030,7 @@ void i915_dispatch_gem_execbuffer(struct drm_device *dev, struct drm_i915_gem_execbuffer2 *exec, uint64_t exec_offset) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; uint32_t exec_start, exec_len; MUTEX_ASSERT_LOCKED(&dev_priv->request_lock); @@ -3164,7 +3161,7 @@ int i915_gem_execbuffer2(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_i915_gem_execbuffer2 *args = data; struct drm_i915_gem_exec_object2 *exec_list = NULL; struct drm_i915_gem_relocation_entry *relocs = NULL; @@ -3509,7 +3506,7 @@ int i915_gem_pin_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_i915_gem_pin *args = data; struct drm_obj *obj; struct inteldrm_obj *obj_priv; @@ -3552,7 +3549,7 @@ int i915_gem_unpin_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_i915_gem_pin *args = data; struct inteldrm_obj *obj_priv; struct drm_obj *obj; @@ -3586,7 +3583,7 @@ int i915_gem_busy_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_i915_gem_busy *args = data; struct drm_obj *obj; struct inteldrm_obj *obj_priv; @@ -3723,7 +3720,7 @@ i915_gem_free_object(struct drm_obj *obj) /* Clear out the inactive list and unbind everything in it. */ int -i915_gem_evict_inactive(struct drm_i915_private *dev_priv) +i915_gem_evict_inactive(struct inteldrm_softc *dev_priv) { struct inteldrm_obj *obj_priv; int ret = 0; @@ -3753,7 +3750,7 @@ i915_gem_evict_inactive(struct drm_i915_private *dev_priv) } int -i915_gem_idle(struct drm_i915_private *dev_priv) +i915_gem_idle(struct inteldrm_softc *dev_priv) { struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; int ret; @@ -3791,7 +3788,7 @@ i915_gem_idle(struct drm_i915_private *dev_priv) } int -i915_gem_init_hws(struct drm_i915_private *dev_priv) +i915_gem_init_hws(struct inteldrm_softc *dev_priv) { struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; struct drm_obj *obj; @@ -3847,7 +3844,7 @@ i915_gem_init_hws(struct drm_i915_private *dev_priv) } void -i915_gem_cleanup_hws(struct drm_i915_private *dev_priv) +i915_gem_cleanup_hws(struct inteldrm_softc *dev_priv) { struct drm_obj *obj; @@ -3869,7 +3866,7 @@ i915_gem_cleanup_hws(struct drm_i915_private *dev_priv) } int -i915_gem_init_ringbuffer(struct drm_i915_private *dev_priv) +i915_gem_init_ringbuffer(struct inteldrm_softc *dev_priv) { struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; struct drm_obj *obj; @@ -3922,7 +3919,7 @@ delhws: } int -inteldrm_start_ring(struct drm_i915_private *dev_priv) +inteldrm_start_ring(struct inteldrm_softc *dev_priv) { struct drm_obj *obj = dev_priv->ring.ring_obj; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; @@ -3970,7 +3967,7 @@ inteldrm_start_ring(struct drm_i915_private *dev_priv) } void -i915_gem_cleanup_ringbuffer(struct drm_i915_private *dev_priv) +i915_gem_cleanup_ringbuffer(struct inteldrm_softc *dev_priv) { if (dev_priv->ring.ring_obj == NULL) return; @@ -3989,7 +3986,7 @@ int i915_gem_entervt_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; int ret; if (dev_priv->mm.wedged) { @@ -4022,7 +4019,7 @@ int i915_gem_leavevt_ioctl(struct drm_device *dev, void *data, struct drm_file *file_priv) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; int ret; /* don't unistall if we fail, repeat calls on failure will screw us */ @@ -4034,7 +4031,7 @@ i915_gem_leavevt_ioctl(struct drm_device *dev, void *data, void inteldrm_timeout(void *arg) { - drm_i915_private_t *dev_priv = arg; + struct inteldrm_softc *dev_priv = arg; if (workq_add_task(dev_priv->workq, 0, i915_gem_retire_work_handler, dev_priv, NULL) == ENOMEM) @@ -4045,7 +4042,7 @@ inteldrm_timeout(void *arg) * handle hung hardware, or error interrupts. for now print debug info. */ void -inteldrm_error(struct drm_i915_private *dev_priv) +inteldrm_error(struct inteldrm_softc *dev_priv) { u_int32_t eir, ipeir, pgtbl_err, pipea_stats, pipeb_stats; u_int8_t reset = GDRST_RENDER; @@ -4170,7 +4167,7 @@ inteldrm_error(struct drm_i915_private *dev_priv) void inteldrm_hung(void *arg, void *reset_type) { - struct drm_i915_private *dev_priv = arg; + struct inteldrm_softc *dev_priv = arg; struct drm_device *dev = (struct drm_device *)dev_priv->drmdev; struct inteldrm_obj *obj_priv; u_int8_t reset = (u_int8_t)(uintptr_t)reset_type; @@ -4235,7 +4232,7 @@ inteldrm_hung(void *arg, void *reset_type) void inteldrm_hangcheck(void *arg) { - struct drm_i915_private *dev_priv = arg; + struct inteldrm_softc *dev_priv = arg; u_int32_t acthd; /* are we idle? no requests, or ring is empty */ @@ -4358,7 +4355,7 @@ i915_list_remove(struct inteldrm_obj *obj_priv) * 2 = enabled, needs disable and free. */ int -inteldrm_setup_mchbar(struct drm_i915_private *dev_priv, +inteldrm_setup_mchbar(struct inteldrm_softc *dev_priv, struct pci_attach_args *bpa) { u_int64_t mchbar_addr; @@ -4426,7 +4423,7 @@ inteldrm_setup_mchbar(struct drm_i915_private *dev_priv, * it. */ void -inteldrm_teardown_mchbar(struct drm_i915_private *dev_priv, +inteldrm_teardown_mchbar(struct inteldrm_softc *dev_priv, struct pci_attach_args *bpa, int disable) { u_int64_t mchbar_addr; @@ -4464,7 +4461,7 @@ inteldrm_teardown_mchbar(struct drm_i915_private *dev_priv, * access through main memory. */ void -inteldrm_detect_bit_6_swizzle(drm_i915_private_t *dev_priv, +inteldrm_detect_bit_6_swizzle(struct inteldrm_softc *dev_priv, struct pci_attach_args *bpa) { uint32_t swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN; @@ -4596,7 +4593,7 @@ void i915_gem_bit_17_swizzle(struct drm_obj *obj) { struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; struct vm_page *pg; bus_dma_segment_t *segp; @@ -4637,7 +4634,7 @@ void i915_gem_save_bit_17_swizzle(struct drm_obj *obj) { struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; bus_dma_segment_t *segp; int page_count = obj->size >> PAGE_SHIFT, i, n; @@ -4675,7 +4672,7 @@ i915_gem_save_bit_17_swizzle(struct drm_obj *obj) } bus_size_t -i915_get_fence_size(struct drm_i915_private *dev_priv, bus_size_t size) +i915_get_fence_size(struct inteldrm_softc *dev_priv, bus_size_t size) { bus_size_t i, start; @@ -4702,7 +4699,7 @@ i915_get_fence_size(struct drm_i915_private *dev_priv, bus_size_t size) int i915_tiling_ok(struct drm_device *dev, int stride, int size, int tiling_mode) { - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; int tile_width; /* Linear is always ok */ @@ -4745,7 +4742,7 @@ int i915_gem_object_fence_offset_ok(struct drm_obj *obj, int tiling_mode) { struct drm_device *dev = obj->dev; - struct drm_i915_private *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct inteldrm_obj *obj_priv = (struct inteldrm_obj *)obj; if (obj_priv->dmamap == NULL || tiling_mode == I915_TILING_NONE) @@ -4773,7 +4770,7 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_i915_gem_set_tiling *args = data; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_obj *obj; struct inteldrm_obj *obj_priv; int ret = 0; @@ -4841,7 +4838,7 @@ i915_gem_get_tiling(struct drm_device *dev, void *data, struct drm_file *file_priv) { struct drm_i915_gem_get_tiling *args = data; - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_obj *obj; struct inteldrm_obj *obj_priv; @@ -4882,7 +4879,7 @@ i915_gem_get_tiling(struct drm_device *dev, void *data, * before reading such registers if unsure. */ int -inteldrm_pipe_enabled(struct drm_i915_private *dev_priv, int pipe) +inteldrm_pipe_enabled(struct inteldrm_softc *dev_priv, int pipe) { bus_size_t pipeconf = pipe ? PIPEBCONF : PIPEACONF; @@ -4893,7 +4890,7 @@ inteldrm_pipe_enabled(struct drm_i915_private *dev_priv, int pipe) * Register save/restore for various instances */ void -i915_save_palette(struct drm_i915_private *dev_priv, enum pipe pipe) +i915_save_palette(struct inteldrm_softc *dev_priv, enum pipe pipe) { u_int32_t *array; bus_size_t reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B); @@ -4912,7 +4909,7 @@ i915_save_palette(struct drm_i915_private *dev_priv, enum pipe pipe) } void -i915_restore_palette(struct drm_i915_private *dev_priv, enum pipe pipe) +i915_restore_palette(struct inteldrm_softc *dev_priv, enum pipe pipe) { u_int32_t *array; bus_size_t reg = (pipe == PIPE_A ? PALETTE_A : PALETTE_B); @@ -4931,7 +4928,7 @@ i915_restore_palette(struct drm_i915_private *dev_priv, enum pipe pipe) } u_int8_t -i915_read_ar(struct drm_i915_private *dev_priv, u_int16_t st01, +i915_read_ar(struct inteldrm_softc *dev_priv, u_int16_t st01, u_int8_t reg, u_int16_t palette_enable) { I915_READ8(st01); @@ -4940,7 +4937,7 @@ i915_read_ar(struct drm_i915_private *dev_priv, u_int16_t st01, } void -i915_write_ar(struct drm_i915_private *dev_priv, u_int16_t st01, u_int8_t reg, +i915_write_ar(struct inteldrm_softc *dev_priv, u_int16_t st01, u_int8_t reg, u_int8_t val, u_int16_t palette_enable) { I915_READ8(st01); @@ -4949,7 +4946,7 @@ i915_write_ar(struct drm_i915_private *dev_priv, u_int16_t st01, u_int8_t reg, } u_int8_t -i915_read_indexed(struct drm_i915_private *dev_priv, u_int16_t index_port, +i915_read_indexed(struct inteldrm_softc *dev_priv, u_int16_t index_port, u_int16_t data_port, u_int8_t reg) { I915_WRITE8(index_port, reg); @@ -4957,7 +4954,7 @@ i915_read_indexed(struct drm_i915_private *dev_priv, u_int16_t index_port, } void -i915_write_indexed(struct drm_i915_private *dev_priv, u_int16_t index_port, +i915_write_indexed(struct inteldrm_softc *dev_priv, u_int16_t index_port, u_int16_t data_port, u_int8_t reg, u_int8_t val) { I915_WRITE8(index_port, reg); @@ -4965,7 +4962,7 @@ i915_write_indexed(struct drm_i915_private *dev_priv, u_int16_t index_port, } void -i915_save_vga(struct drm_i915_private *dev_priv) +i915_save_vga(struct inteldrm_softc *dev_priv) { int i; u16 cr_index, cr_data, st01; @@ -5022,7 +5019,7 @@ i915_save_vga(struct drm_i915_private *dev_priv) } void -i915_restore_vga(struct drm_i915_private *dev_priv) +i915_restore_vga(struct inteldrm_softc *dev_priv) { u_int16_t cr_index, cr_data, st01; int i; @@ -5077,7 +5074,7 @@ i915_restore_vga(struct drm_i915_private *dev_priv) } void -i915_save_modeset_reg(struct drm_i915_private *dev_priv) +i915_save_modeset_reg(struct inteldrm_softc *dev_priv) { /* Pipe & plane A info */ dev_priv->savePIPEACONF = I915_READ(PIPEACONF); @@ -5137,7 +5134,7 @@ i915_save_modeset_reg(struct drm_i915_private *dev_priv) } void -i915_restore_modeset_reg(struct drm_i915_private *dev_priv) +i915_restore_modeset_reg(struct inteldrm_softc *dev_priv) { /* Pipe & plane A info */ /* Prime the clock */ @@ -5226,7 +5223,7 @@ i915_restore_modeset_reg(struct drm_i915_private *dev_priv) } int -inteldrm_save_display(struct drm_i915_private *dev_priv) +inteldrm_save_display(struct inteldrm_softc *dev_priv) { /* Display arbitration control */ dev_priv->saveDSPARB = I915_READ(DSPARB); @@ -5281,7 +5278,7 @@ inteldrm_save_display(struct drm_i915_private *dev_priv) } int -inteldrm_restore_display(struct drm_i915_private *dev_priv) +inteldrm_restore_display(struct inteldrm_softc *dev_priv) { /* Display arbitration */ I915_WRITE(DSPARB, dev_priv->saveDSPARB); @@ -5338,7 +5335,7 @@ inteldrm_restore_display(struct drm_i915_private *dev_priv) } int -inteldrm_save_state(struct drm_i915_private *dev_priv) +inteldrm_save_state(struct inteldrm_softc *dev_priv) { int i; @@ -5442,7 +5439,7 @@ inteldrm_save_state(struct drm_i915_private *dev_priv) } int -inteldrm_restore_state(struct drm_i915_private *dev_priv) +inteldrm_restore_state(struct inteldrm_softc *dev_priv) { int i; @@ -5553,7 +5550,7 @@ inteldrm_restore_state(struct drm_i915_private *dev_priv) * - re-init display */ void -inteldrm_965_reset(struct drm_i915_private *dev_priv, u_int8_t flags) +inteldrm_965_reset(struct inteldrm_softc *dev_priv, u_int8_t flags) { pcireg_t reg; int i = 0; @@ -5621,7 +5618,7 @@ inteldrm_965_reset(struct drm_i915_private *dev_priv, u_int8_t flags) */ #ifdef WATCH_INACTIVE void -inteldrm_verify_inactive(struct drm_i915_private *dev_priv, char *file, +inteldrm_verify_inactive(struct inteldrm_softc *dev_priv, char *file, int line) { struct drm_obj *obj; @@ -5662,8 +5659,8 @@ static const char *get_tiling_flag(struct inteldrm_obj *obj_priv) void i915_gem_seqno_info(int kdev) { - struct drm_device *dev = drm_get_device_from_kdev(kdev); - drm_i915_private_t *dev_priv = dev->dev_private; + struct drm_device *dev = drm_get_device_from_kdev(kdev); + struct inteldrm_softc *dev_priv = dev->dev_private; if (dev_priv->hw_status_page != NULL) { printf("Current sequence: %d\n", i915_get_gem_seqno(dev_priv)); @@ -5676,8 +5673,8 @@ i915_gem_seqno_info(int kdev) void i915_interrupt_info(int kdev) { - struct drm_device *dev = drm_get_device_from_kdev(kdev); - drm_i915_private_t *dev_priv = dev->dev_private; + struct drm_device *dev = drm_get_device_from_kdev(kdev); + struct inteldrm_softc *dev_priv = dev->dev_private; printf("Interrupt enable: %08x\n", I915_READ(IER)); @@ -5701,8 +5698,8 @@ i915_interrupt_info(int kdev) void i915_gem_fence_regs_info(int kdev) { - struct drm_device *dev = drm_get_device_from_kdev(kdev); - drm_i915_private_t *dev_priv = dev->dev_private; + struct drm_device *dev = drm_get_device_from_kdev(kdev); + struct inteldrm_softc *dev_priv = dev->dev_private; int i; printf("Reserved fences = %d\n", dev_priv->fence_reg_start); @@ -5734,8 +5731,8 @@ i915_gem_fence_regs_info(int kdev) void i915_hws_info(int kdev) { - struct drm_device *dev = drm_get_device_from_kdev(kdev); - drm_i915_private_t *dev_priv = dev->dev_private; + struct drm_device *dev = drm_get_device_from_kdev(kdev); + struct inteldrm_softc *dev_priv = dev->dev_private; int i; volatile u32 *hws; @@ -5773,7 +5770,7 @@ void i915_batchbuffer_info(int kdev) { struct drm_device *dev = drm_get_device_from_kdev(kdev); - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; struct drm_obj *obj; struct inteldrm_obj *obj_priv; bus_space_handle_t bsh; @@ -5800,7 +5797,7 @@ void i915_ringbuffer_data(int kdev) { struct drm_device *dev = drm_get_device_from_kdev(kdev); - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; bus_size_t off; if (!dev_priv->ring.ring_obj) { @@ -5817,7 +5814,7 @@ void i915_ringbuffer_info(int kdev) { struct drm_device *dev = drm_get_device_from_kdev(kdev); - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; u_int32_t head, tail; head = I915_READ(PRB0_HEAD) & HEAD_ADDR; diff --git a/sys/dev/pci/drm/i915_drv.h b/sys/dev/pci/drm/i915_drv.h index faee5a65a07..cf9c317cf3f 100644 --- a/sys/dev/pci/drm/i915_drv.h +++ b/sys/dev/pci/drm/i915_drv.h @@ -84,7 +84,7 @@ struct inteldrm_fence { * * XXX fence lock ,object lock */ -typedef struct drm_i915_private { +struct inteldrm_softc { struct device dev; struct device *drmdev; bus_dma_tag_t agpdmat; /* tag from intagp for GEM */ @@ -335,7 +335,7 @@ typedef struct drm_i915_private { /** Bit 6 swizzling required for Y tiling */ uint32_t bit_6_swizzle_y; } mm; -} drm_i915_private_t; +}; struct inteldrm_file { struct drm_file file_priv; @@ -425,15 +425,15 @@ struct inteldrm_request { uint32_t seqno; }; -u_int32_t inteldrm_read_hws(struct drm_i915_private *, int); -int inteldrm_wait_ring(struct drm_i915_private *dev, int n); -void inteldrm_begin_ring(struct drm_i915_private *, int); -void inteldrm_out_ring(struct drm_i915_private *, u_int32_t); -void inteldrm_advance_ring(struct drm_i915_private *); -void inteldrm_update_ring(struct drm_i915_private *); -void inteldrm_error(struct drm_i915_private *); -int inteldrm_pipe_enabled(struct drm_i915_private *, int); -int i915_init_phys_hws(drm_i915_private_t *, bus_dma_tag_t); +u_int32_t inteldrm_read_hws(struct inteldrm_softc *, int); +int inteldrm_wait_ring(struct inteldrm_softc *dev, int n); +void inteldrm_begin_ring(struct inteldrm_softc *, int); +void inteldrm_out_ring(struct inteldrm_softc *, u_int32_t); +void inteldrm_advance_ring(struct inteldrm_softc *); +void inteldrm_update_ring(struct inteldrm_softc *); +void inteldrm_error(struct inteldrm_softc *); +int inteldrm_pipe_enabled(struct inteldrm_softc *, int); +int i915_init_phys_hws(struct inteldrm_softc *, bus_dma_tag_t); /* i915_irq.c */ @@ -442,12 +442,12 @@ extern void i915_driver_irq_uninstall(struct drm_device * dev); extern int i915_enable_vblank(struct drm_device *dev, int crtc); extern void i915_disable_vblank(struct drm_device *dev, int crtc); extern u32 i915_get_vblank_counter(struct drm_device *dev, int crtc); -extern void i915_user_irq_get(struct drm_i915_private *); -extern void i915_user_irq_put(struct drm_i915_private *); +extern void i915_user_irq_get(struct inteldrm_softc *); +extern void i915_user_irq_put(struct inteldrm_softc *); /* XXX need bus_space_write_8, this evaluated arguments twice */ static __inline void -write64(struct drm_i915_private *dev_priv, bus_size_t off, u_int64_t reg) +write64(struct inteldrm_softc *dev_priv, bus_size_t off, u_int64_t reg) { bus_space_write_4(dev_priv->regs->bst, dev_priv->regs->bsh, off, (u_int32_t)reg); @@ -456,7 +456,7 @@ write64(struct drm_i915_private *dev_priv, bus_size_t off, u_int64_t reg) } static __inline u_int64_t -read64(struct drm_i915_private *dev_priv, bus_size_t off) +read64(struct inteldrm_softc *dev_priv, bus_size_t off) { u_int32_t low, high; @@ -2354,7 +2354,7 @@ i915_seqno_passed(uint32_t seq1, uint32_t seq2) * Read seqence number from the Hardware status page. */ static __inline u_int32_t -i915_get_gem_seqno(struct drm_i915_private *dev_priv) +i915_get_gem_seqno(struct inteldrm_softc *dev_priv) { return (READ_HWSP(dev_priv, I915_GEM_HWS_INDEX)); } diff --git a/sys/dev/pci/drm/i915_irq.c b/sys/dev/pci/drm/i915_irq.c index 24add612c20..85a93ad50d7 100644 --- a/sys/dev/pci/drm/i915_irq.c +++ b/sys/dev/pci/drm/i915_irq.c @@ -32,13 +32,13 @@ #include "i915_drv.h" int inteldrm_intr(void *); -void i915_enable_irq(drm_i915_private_t *, u_int32_t); -void i915_disable_irq(drm_i915_private_t *, u_int32_t); -void i915_enable_pipestat(drm_i915_private_t *, int, u_int32_t); -void i915_disable_pipestat(drm_i915_private_t *, int, u_int32_t); +void i915_enable_irq(struct inteldrm_softc *, u_int32_t); +void i915_disable_irq(struct inteldrm_softc *, u_int32_t); +void i915_enable_pipestat(struct inteldrm_softc *, int, u_int32_t); +void i915_disable_pipestat(struct inteldrm_softc *, int, u_int32_t); -inline void -i915_enable_irq(drm_i915_private_t *dev_priv, u_int32_t mask) +void +i915_enable_irq(struct inteldrm_softc *dev_priv, u_int32_t mask) { if ((dev_priv->irq_mask_reg & mask) != 0) { dev_priv->irq_mask_reg &= ~mask; @@ -47,8 +47,8 @@ i915_enable_irq(drm_i915_private_t *dev_priv, u_int32_t mask) } } -inline void -i915_disable_irq(drm_i915_private_t *dev_priv, u_int32_t mask) +void +i915_disable_irq(struct inteldrm_softc *dev_priv, u_int32_t mask) { if ((dev_priv->irq_mask_reg & mask) != mask) { dev_priv->irq_mask_reg |= mask; @@ -58,7 +58,7 @@ i915_disable_irq(drm_i915_private_t *dev_priv, u_int32_t mask) } void -i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u_int32_t mask) +i915_enable_pipestat(struct inteldrm_softc *dev_priv, int pipe, u_int32_t mask) { if ((dev_priv->pipestat[pipe] & mask) != mask) { bus_size_t reg = pipe == 0 ? PIPEASTAT : PIPEBSTAT; @@ -71,7 +71,7 @@ i915_enable_pipestat(drm_i915_private_t *dev_priv, int pipe, u_int32_t mask) } void -i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u_int32_t mask) +i915_disable_pipestat(struct inteldrm_softc *dev_priv, int pipe, u_int32_t mask) { if ((dev_priv->pipestat[pipe] & mask) != 0) { bus_size_t reg = pipe == 0 ? PIPEASTAT : PIPEBSTAT; @@ -85,7 +85,7 @@ i915_disable_pipestat(drm_i915_private_t *dev_priv, int pipe, u_int32_t mask) u_int32_t i915_get_vblank_counter(struct drm_device *dev, int pipe) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; bus_size_t high_frame, low_frame; u_int32_t high1, high2, low; @@ -122,14 +122,14 @@ i915_get_vblank_counter(struct drm_device *dev, int pipe) } void -i915_user_irq_get(struct drm_i915_private *dev_priv) +i915_user_irq_get(struct inteldrm_softc *dev_priv) { if (++dev_priv->user_irq_refcount == 1) i915_enable_irq(dev_priv, I915_USER_INTERRUPT); } void -i915_user_irq_put(struct drm_i915_private *dev_priv) +i915_user_irq_put(struct inteldrm_softc *dev_priv) { if (--dev_priv->user_irq_refcount == 0) i915_disable_irq(dev_priv, I915_USER_INTERRUPT); @@ -138,7 +138,7 @@ i915_user_irq_put(struct drm_i915_private *dev_priv) int i915_enable_vblank(struct drm_device *dev, int pipe) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; if (inteldrm_pipe_enabled(dev_priv, pipe) == 0) return (EINVAL); @@ -154,7 +154,7 @@ i915_enable_vblank(struct drm_device *dev, int pipe) void i915_disable_vblank(struct drm_device *dev, int pipe) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; mtx_enter(&dev_priv->user_irq_lock); i915_disable_pipestat(dev_priv, pipe, @@ -167,7 +167,7 @@ i915_disable_vblank(struct drm_device *dev, int pipe) int i915_driver_irq_install(struct drm_device *dev) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; I915_WRITE(HWSTAM, 0xeffe); I915_WRITE(PIPEASTAT, 0); @@ -212,7 +212,7 @@ i915_driver_irq_install(struct drm_device *dev) void i915_driver_irq_uninstall(struct drm_device *dev) { - drm_i915_private_t *dev_priv = dev->dev_private; + struct inteldrm_softc *dev_priv = dev->dev_private; I915_WRITE(HWSTAM, 0xffffffff); I915_WRITE(PIPEASTAT, 0); |