replace common qcom sources with samsung ones
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2022-2025, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
* Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
|
||||
*/
|
||||
|
||||
#include "adreno.h"
|
||||
@@ -423,8 +423,6 @@ static int hwsched_sendcmd(struct adreno_device *adreno_dev,
|
||||
struct kgsl_context *context = drawobj->context;
|
||||
int ret;
|
||||
struct cmd_list_obj *obj;
|
||||
int is_current_rt = rt_task(current);
|
||||
int nice = task_nice(current);
|
||||
|
||||
obj = kmem_cache_alloc(obj_cache, GFP_KERNEL);
|
||||
if (!obj)
|
||||
@@ -432,18 +430,17 @@ static int hwsched_sendcmd(struct adreno_device *adreno_dev,
|
||||
|
||||
mutex_lock(&device->mutex);
|
||||
|
||||
/* Elevating thread’s priority to avoid context switch with holding device mutex */
|
||||
if (!is_current_rt)
|
||||
sched_set_fifo(current);
|
||||
|
||||
if (_abort_submission(adreno_dev)) {
|
||||
ret = -EBUSY;
|
||||
goto done;
|
||||
mutex_unlock(&device->mutex);
|
||||
kmem_cache_free(obj_cache, obj);
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
|
||||
if (kgsl_context_detached(context)) {
|
||||
ret = -ENOENT;
|
||||
goto done;
|
||||
mutex_unlock(&device->mutex);
|
||||
kmem_cache_free(obj_cache, obj);
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
hwsched->inflight++;
|
||||
@@ -453,7 +450,9 @@ static int hwsched_sendcmd(struct adreno_device *adreno_dev,
|
||||
ret = adreno_active_count_get(adreno_dev);
|
||||
if (ret) {
|
||||
hwsched->inflight--;
|
||||
goto done;
|
||||
mutex_unlock(&device->mutex);
|
||||
kmem_cache_free(obj_cache, obj);
|
||||
return ret;
|
||||
}
|
||||
set_bit(ADRENO_HWSCHED_POWER, &hwsched->flags);
|
||||
}
|
||||
@@ -470,7 +469,9 @@ static int hwsched_sendcmd(struct adreno_device *adreno_dev,
|
||||
}
|
||||
|
||||
hwsched->inflight--;
|
||||
goto done;
|
||||
kmem_cache_free(obj_cache, obj);
|
||||
mutex_unlock(&device->mutex);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if ((hwsched->inflight == 1) &&
|
||||
@@ -497,13 +498,9 @@ static int hwsched_sendcmd(struct adreno_device *adreno_dev,
|
||||
list_add_tail(&obj->node, &hwsched->cmd_list);
|
||||
|
||||
done:
|
||||
if (!is_current_rt)
|
||||
sched_set_normal(current, nice);
|
||||
mutex_unlock(&device->mutex);
|
||||
if (ret)
|
||||
kmem_cache_free(obj_cache, obj);
|
||||
|
||||
return ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1700,7 +1697,7 @@ static void adreno_hwsched_reset_and_snapshot_legacy(struct adreno_device *adren
|
||||
* faulted.
|
||||
*/
|
||||
obj = get_fault_cmdobj(adreno_dev, cmd->ctxt_id, cmd->ts);
|
||||
if (!obj && (fault & ADRENO_IOMMU_STALL_ON_PAGE_FAULT))
|
||||
if (!obj && (fault & ADRENO_IOMMU_PAGE_FAULT))
|
||||
obj = get_active_cmdobj(adreno_dev);
|
||||
|
||||
if (obj) {
|
||||
@@ -1785,7 +1782,7 @@ static void adreno_hwsched_reset_and_snapshot(struct adreno_device *adreno_dev,
|
||||
obj = get_fault_cmdobj(adreno_dev, cmd->gc.ctxt_id, cmd->gc.ts);
|
||||
obj_lpac = get_fault_cmdobj(adreno_dev, cmd->lpac.ctxt_id, cmd->lpac.ts);
|
||||
|
||||
if (!obj && (fault & ADRENO_IOMMU_STALL_ON_PAGE_FAULT))
|
||||
if (!obj && (fault & ADRENO_IOMMU_PAGE_FAULT))
|
||||
obj = get_active_cmdobj(adreno_dev);
|
||||
|
||||
if (obj) {
|
||||
@@ -1801,7 +1798,7 @@ static void adreno_hwsched_reset_and_snapshot(struct adreno_device *adreno_dev,
|
||||
|
||||
do_fault_header(adreno_dev, drawobj, fault);
|
||||
|
||||
if (!obj_lpac && (fault & ADRENO_IOMMU_STALL_ON_PAGE_FAULT))
|
||||
if (!obj_lpac && (fault & ADRENO_IOMMU_PAGE_FAULT))
|
||||
obj_lpac = get_active_cmdobj_lpac(adreno_dev);
|
||||
|
||||
if (!obj && !obj_lpac) {
|
||||
@@ -2185,6 +2182,7 @@ static int hwsched_idle(struct adreno_device *adreno_dev)
|
||||
|
||||
if (adreno_gpu_fault(adreno_dev)) {
|
||||
ret = -EDEADLK;
|
||||
|
||||
} else {
|
||||
|
||||
ret = wait_for_completion_timeout(&hwsched->idle_gate,
|
||||
@@ -2557,7 +2555,6 @@ void adreno_hwsched_remove_hw_fence_entry(struct adreno_device *adreno_dev,
|
||||
kmem_cache_free(hwsched->hw_fence_cache, entry);
|
||||
kgsl_context_put_deferred(&drawctxt->base);
|
||||
}
|
||||
|
||||
void adreno_hwsched_add_profile_events(struct adreno_device *adreno_dev,
|
||||
struct kgsl_drawobj_cmd *cmdobj, struct adreno_submit_time *time)
|
||||
{
|
||||
|
Reference in New Issue
Block a user