Loading drivers/gpu/msm/adreno_debugfs.c +5 −2 Original line number Diff line number Diff line Loading @@ -130,8 +130,11 @@ static void sync_event_print(struct seq_file *s, break; } case KGSL_CMD_SYNCPOINT_TYPE_FENCE: { seq_printf(s, "sync: [%pK] %s", sync_event->handle, sync_event->fence_name); int i; for (i = 0; i < sync_event->info.num_fences; i++) seq_printf(s, "sync: %s", sync_event->info.fences[i].name); break; } default: Loading drivers/gpu/msm/adreno_drawctxt.c +5 −8 Original line number Diff line number Diff line Loading @@ -464,6 +464,7 @@ void adreno_drawctxt_detach(struct kgsl_context *context) { struct kgsl_device *device; struct adreno_device *adreno_dev; struct adreno_gpudev *gpudev; struct adreno_context *drawctxt; struct adreno_ringbuffer *rb; int ret, count, i; Loading @@ -474,6 +475,7 @@ void adreno_drawctxt_detach(struct kgsl_context *context) device = context->device; adreno_dev = ADRENO_DEVICE(device); gpudev = ADRENO_GPU_DEVICE(adreno_dev); drawctxt = ADRENO_CONTEXT(context); rb = drawctxt->rb; Loading Loading @@ -554,6 +556,9 @@ void adreno_drawctxt_detach(struct kgsl_context *context) mutex_unlock(&device->mutex); if (gpudev->preemption_context_destroy) gpudev->preemption_context_destroy(context); /* wake threads waiting to submit commands from this context */ wake_up_all(&drawctxt->waiting); wake_up_all(&drawctxt->wq); Loading @@ -562,18 +567,10 @@ void adreno_drawctxt_detach(struct kgsl_context *context) void adreno_drawctxt_destroy(struct kgsl_context *context) { struct adreno_context *drawctxt; struct adreno_device *adreno_dev; struct adreno_gpudev *gpudev; if (context == NULL) return; adreno_dev = ADRENO_DEVICE(context->device); gpudev = ADRENO_GPU_DEVICE(adreno_dev); if (gpudev->preemption_context_destroy) gpudev->preemption_context_destroy(context); drawctxt = ADRENO_CONTEXT(context); kfree(drawctxt); } Loading drivers/gpu/msm/adreno_sysfs.c +12 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,9 @@ static int _preemption_store(struct adreno_device *adreno_dev, unsigned int val) { struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct kgsl_context *context; struct adreno_context *drawctxt; int id; mutex_lock(&device->mutex); Loading @@ -221,6 +224,15 @@ static int _preemption_store(struct adreno_device *adreno_dev, kgsl_pwrctrl_change_state(device, KGSL_STATE_SUSPEND); change_bit(ADRENO_DEVICE_PREEMPTION, &adreno_dev->priv); adreno_dev->cur_rb = &(adreno_dev->ringbuffers[0]); /* Update the ringbuffer for each draw context */ write_lock(&device->context_lock); idr_for_each_entry(&device->context_idr, context, id) { drawctxt = ADRENO_CONTEXT(context); drawctxt->rb = adreno_ctx_get_rb(adreno_dev, drawctxt); } write_unlock(&device->context_lock); kgsl_pwrctrl_change_state(device, KGSL_STATE_SLUMBER); mutex_unlock(&device->mutex); Loading drivers/gpu/msm/kgsl.c +11 −2 Original line number Diff line number Diff line Loading @@ -501,6 +501,10 @@ static void kgsl_mem_entry_detach_process(struct kgsl_mem_entry *entry) type = kgsl_memdesc_usermem_type(&entry->memdesc); entry->priv->stats[type].cur -= entry->memdesc.size; if (type != KGSL_MEM_ENTRY_ION) entry->priv->gpumem_mapped -= entry->memdesc.mapsize; spin_unlock(&entry->priv->mem_lock); kgsl_mmu_put_gpuaddr(&entry->memdesc); Loading Loading @@ -2060,7 +2064,7 @@ static long gpuobj_free_on_fence(struct kgsl_device_private *dev_priv, } handle = kgsl_sync_fence_async_wait(event.fd, gpuobj_free_fence_func, entry, NULL, 0); gpuobj_free_fence_func, entry, NULL); if (IS_ERR(handle)) { kgsl_mem_entry_unset_pend(entry); Loading Loading @@ -4206,13 +4210,18 @@ static int kgsl_gpumem_vm_fault(struct vm_fault *vmf) { struct kgsl_mem_entry *entry = vmf->vma->vm_private_data; int ret; if (!entry) return VM_FAULT_SIGBUS; if (!entry->memdesc.ops || !entry->memdesc.ops->vmfault) return VM_FAULT_SIGBUS; return entry->memdesc.ops->vmfault(&entry->memdesc, vmf->vma, vmf); ret = entry->memdesc.ops->vmfault(&entry->memdesc, vmf->vma, vmf); if ((ret == 0) || (ret == VM_FAULT_NOPAGE)) entry->priv->gpumem_mapped += PAGE_SIZE; return ret; } static void Loading drivers/gpu/msm/kgsl_device.h +2 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,7 @@ struct kgsl_context { * @kobj: Pointer to a kobj for the sysfs directory for this process * @debug_root: Pointer to the debugfs root for this process * @stats: Memory allocation statistics for this process * @gpumem_mapped: KGSL memory mapped in the process address space * @syncsource_idr: sync sources created by this process * @syncsource_lock: Spinlock to protect the syncsource idr * @fd_count: Counter for the number of FDs for this process Loading @@ -453,6 +454,7 @@ struct kgsl_process_private { uint64_t cur; uint64_t max; } stats[KGSL_MEM_ENTRY_MAX]; uint64_t gpumem_mapped; struct idr syncsource_idr; spinlock_t syncsource_lock; int fd_count; Loading Loading
drivers/gpu/msm/adreno_debugfs.c +5 −2 Original line number Diff line number Diff line Loading @@ -130,8 +130,11 @@ static void sync_event_print(struct seq_file *s, break; } case KGSL_CMD_SYNCPOINT_TYPE_FENCE: { seq_printf(s, "sync: [%pK] %s", sync_event->handle, sync_event->fence_name); int i; for (i = 0; i < sync_event->info.num_fences; i++) seq_printf(s, "sync: %s", sync_event->info.fences[i].name); break; } default: Loading
drivers/gpu/msm/adreno_drawctxt.c +5 −8 Original line number Diff line number Diff line Loading @@ -464,6 +464,7 @@ void adreno_drawctxt_detach(struct kgsl_context *context) { struct kgsl_device *device; struct adreno_device *adreno_dev; struct adreno_gpudev *gpudev; struct adreno_context *drawctxt; struct adreno_ringbuffer *rb; int ret, count, i; Loading @@ -474,6 +475,7 @@ void adreno_drawctxt_detach(struct kgsl_context *context) device = context->device; adreno_dev = ADRENO_DEVICE(device); gpudev = ADRENO_GPU_DEVICE(adreno_dev); drawctxt = ADRENO_CONTEXT(context); rb = drawctxt->rb; Loading Loading @@ -554,6 +556,9 @@ void adreno_drawctxt_detach(struct kgsl_context *context) mutex_unlock(&device->mutex); if (gpudev->preemption_context_destroy) gpudev->preemption_context_destroy(context); /* wake threads waiting to submit commands from this context */ wake_up_all(&drawctxt->waiting); wake_up_all(&drawctxt->wq); Loading @@ -562,18 +567,10 @@ void adreno_drawctxt_detach(struct kgsl_context *context) void adreno_drawctxt_destroy(struct kgsl_context *context) { struct adreno_context *drawctxt; struct adreno_device *adreno_dev; struct adreno_gpudev *gpudev; if (context == NULL) return; adreno_dev = ADRENO_DEVICE(context->device); gpudev = ADRENO_GPU_DEVICE(adreno_dev); if (gpudev->preemption_context_destroy) gpudev->preemption_context_destroy(context); drawctxt = ADRENO_CONTEXT(context); kfree(drawctxt); } Loading
drivers/gpu/msm/adreno_sysfs.c +12 −0 Original line number Diff line number Diff line Loading @@ -208,6 +208,9 @@ static int _preemption_store(struct adreno_device *adreno_dev, unsigned int val) { struct kgsl_device *device = KGSL_DEVICE(adreno_dev); struct kgsl_context *context; struct adreno_context *drawctxt; int id; mutex_lock(&device->mutex); Loading @@ -221,6 +224,15 @@ static int _preemption_store(struct adreno_device *adreno_dev, kgsl_pwrctrl_change_state(device, KGSL_STATE_SUSPEND); change_bit(ADRENO_DEVICE_PREEMPTION, &adreno_dev->priv); adreno_dev->cur_rb = &(adreno_dev->ringbuffers[0]); /* Update the ringbuffer for each draw context */ write_lock(&device->context_lock); idr_for_each_entry(&device->context_idr, context, id) { drawctxt = ADRENO_CONTEXT(context); drawctxt->rb = adreno_ctx_get_rb(adreno_dev, drawctxt); } write_unlock(&device->context_lock); kgsl_pwrctrl_change_state(device, KGSL_STATE_SLUMBER); mutex_unlock(&device->mutex); Loading
drivers/gpu/msm/kgsl.c +11 −2 Original line number Diff line number Diff line Loading @@ -501,6 +501,10 @@ static void kgsl_mem_entry_detach_process(struct kgsl_mem_entry *entry) type = kgsl_memdesc_usermem_type(&entry->memdesc); entry->priv->stats[type].cur -= entry->memdesc.size; if (type != KGSL_MEM_ENTRY_ION) entry->priv->gpumem_mapped -= entry->memdesc.mapsize; spin_unlock(&entry->priv->mem_lock); kgsl_mmu_put_gpuaddr(&entry->memdesc); Loading Loading @@ -2060,7 +2064,7 @@ static long gpuobj_free_on_fence(struct kgsl_device_private *dev_priv, } handle = kgsl_sync_fence_async_wait(event.fd, gpuobj_free_fence_func, entry, NULL, 0); gpuobj_free_fence_func, entry, NULL); if (IS_ERR(handle)) { kgsl_mem_entry_unset_pend(entry); Loading Loading @@ -4206,13 +4210,18 @@ static int kgsl_gpumem_vm_fault(struct vm_fault *vmf) { struct kgsl_mem_entry *entry = vmf->vma->vm_private_data; int ret; if (!entry) return VM_FAULT_SIGBUS; if (!entry->memdesc.ops || !entry->memdesc.ops->vmfault) return VM_FAULT_SIGBUS; return entry->memdesc.ops->vmfault(&entry->memdesc, vmf->vma, vmf); ret = entry->memdesc.ops->vmfault(&entry->memdesc, vmf->vma, vmf); if ((ret == 0) || (ret == VM_FAULT_NOPAGE)) entry->priv->gpumem_mapped += PAGE_SIZE; return ret; } static void Loading
drivers/gpu/msm/kgsl_device.h +2 −0 Original line number Diff line number Diff line Loading @@ -432,6 +432,7 @@ struct kgsl_context { * @kobj: Pointer to a kobj for the sysfs directory for this process * @debug_root: Pointer to the debugfs root for this process * @stats: Memory allocation statistics for this process * @gpumem_mapped: KGSL memory mapped in the process address space * @syncsource_idr: sync sources created by this process * @syncsource_lock: Spinlock to protect the syncsource idr * @fd_count: Counter for the number of FDs for this process Loading @@ -453,6 +454,7 @@ struct kgsl_process_private { uint64_t cur; uint64_t max; } stats[KGSL_MEM_ENTRY_MAX]; uint64_t gpumem_mapped; struct idr syncsource_idr; spinlock_t syncsource_lock; int fd_count; Loading