Loading drivers/gpu/msm/kgsl.c +8 −0 Original line number Diff line number Diff line Loading @@ -532,14 +532,21 @@ int kgsl_context_init(struct kgsl_device_private *dev_priv, int ret = 0, id; struct kgsl_process_private *proc_priv = dev_priv->process_priv; /* * Read and increment the context count under lock to make sure * no process goes beyond the specified context limit. */ spin_lock(&proc_priv->ctxt_count_lock); if (atomic_read(&proc_priv->ctxt_count) > KGSL_MAX_CONTEXTS_PER_PROC) { KGSL_DRV_ERR(device, "Per process context limit reached for pid %u", dev_priv->process_priv->pid); spin_unlock(&proc_priv->ctxt_count_lock); return -ENOSPC; } atomic_inc(&proc_priv->ctxt_count); spin_unlock(&proc_priv->ctxt_count_lock); id = _kgsl_get_context_id(device); if (id == -ENOSPC) { Loading Loading @@ -919,6 +926,7 @@ static struct kgsl_process_private *kgsl_process_private_new( spin_lock_init(&private->mem_lock); spin_lock_init(&private->syncsource_lock); spin_lock_init(&private->ctxt_count_lock); idr_init(&private->mem_idr); idr_init(&private->syncsource_idr); Loading drivers/gpu/msm/kgsl_device.h +2 −0 Original line number Diff line number Diff line Loading @@ -443,6 +443,7 @@ struct kgsl_context { * @syncsource_lock: Spinlock to protect the syncsource idr * @fd_count: Counter for the number of FDs for this process * @ctxt_count: Count for the number of contexts for this process * @ctxt_count_lock: Spinlock to protect ctxt_count */ struct kgsl_process_private { unsigned long priv; Loading @@ -463,6 +464,7 @@ struct kgsl_process_private { spinlock_t syncsource_lock; int fd_count; atomic_t ctxt_count; spinlock_t ctxt_count_lock; }; /** Loading Loading
drivers/gpu/msm/kgsl.c +8 −0 Original line number Diff line number Diff line Loading @@ -532,14 +532,21 @@ int kgsl_context_init(struct kgsl_device_private *dev_priv, int ret = 0, id; struct kgsl_process_private *proc_priv = dev_priv->process_priv; /* * Read and increment the context count under lock to make sure * no process goes beyond the specified context limit. */ spin_lock(&proc_priv->ctxt_count_lock); if (atomic_read(&proc_priv->ctxt_count) > KGSL_MAX_CONTEXTS_PER_PROC) { KGSL_DRV_ERR(device, "Per process context limit reached for pid %u", dev_priv->process_priv->pid); spin_unlock(&proc_priv->ctxt_count_lock); return -ENOSPC; } atomic_inc(&proc_priv->ctxt_count); spin_unlock(&proc_priv->ctxt_count_lock); id = _kgsl_get_context_id(device); if (id == -ENOSPC) { Loading Loading @@ -919,6 +926,7 @@ static struct kgsl_process_private *kgsl_process_private_new( spin_lock_init(&private->mem_lock); spin_lock_init(&private->syncsource_lock); spin_lock_init(&private->ctxt_count_lock); idr_init(&private->mem_idr); idr_init(&private->syncsource_idr); Loading
drivers/gpu/msm/kgsl_device.h +2 −0 Original line number Diff line number Diff line Loading @@ -443,6 +443,7 @@ struct kgsl_context { * @syncsource_lock: Spinlock to protect the syncsource idr * @fd_count: Counter for the number of FDs for this process * @ctxt_count: Count for the number of contexts for this process * @ctxt_count_lock: Spinlock to protect ctxt_count */ struct kgsl_process_private { unsigned long priv; Loading @@ -463,6 +464,7 @@ struct kgsl_process_private { spinlock_t syncsource_lock; int fd_count; atomic_t ctxt_count; spinlock_t ctxt_count_lock; }; /** Loading