Re: [PATCH v2] drm/panthor: Make the timeout per-queue instead of per-job

2025-04-05 Thread Adrian Larumbe
don't get > + * called again. > + */ > + queue->scheduler.timeout = MAX_SCHEDULE_TIMEOUT; > + > return DRM_GPU_SCHED_STAT_NOMINAL; > } > > @@ -3283,6 +3371,17 @@ static u32 calc_profiling_ringbuf_num_slots(struct > panthor_device *ptdev, > return DIV_ROUND_UP(cs_ringbuf_size, min_profiled_job_instrs * > sizeof(u64)); > } > > +static void queue_timeout_work(struct work_struct *work) > +{ > + struct panthor_queue *queue = container_of(work, struct panthor_queue, > +timeout.work.work); > + bool progress; > + > + progress = queue_check_job_completion(queue); > + if (!progress) > + drm_sched_fault(&queue->scheduler); > +} > + > static struct panthor_queue * > group_create_queue(struct panthor_group *group, > const struct drm_panthor_queue_create *args) > @@ -3298,7 +3397,7 @@ group_create_queue(struct panthor_group *group, >* their profiling status. >*/ > .credit_limit = args->ringbuf_size / sizeof(u64), > - .timeout = msecs_to_jiffies(JOB_TIMEOUT_MS), > + .timeout = MAX_SCHEDULE_TIMEOUT, > .timeout_wq = group->ptdev->reset.wq, > .name = "panthor-queue", > .dev = group->ptdev->base.dev, > @@ -3321,6 +3420,8 @@ group_create_queue(struct panthor_group *group, > if (!queue) > return ERR_PTR(-ENOMEM); > > + queue->timeout.remaining = msecs_to_jiffies(JOB_TIMEOUT_MS); > + INIT_DELAYED_WORK(&queue->timeout.work, queue_timeout_work); > queue->fence_ctx.id = dma_fence_context_alloc(1); > spin_lock_init(&queue->fence_ctx.lock); > INIT_LIST_HEAD(&queue->fence_ctx.in_flight_jobs); > > base-commit: b72f66f22c0e39ae6684c43fead774c13db24e73 > -- > 2.43.0 > Cheers, Adrian Larumbe

Re: [PATCH v4 4/6] drm/panfrost: Add support for AARCH64_4K page table format

2025-03-22 Thread Adrian Larumbe
RMODE_AARCH64_64K(8 << 0) > +#define AS_TRANSCFG_INA_BITS(x)((x) << 6) > +#define AS_TRANSCFG_OUTA_BITS(x) ((x) << 14) > +#define AS_TRANSCFG_SL_CONCAT BIT(22) > +#define AS_TRANSCF

Re: [PATCH v4 3/6] drm/panfrost: Set HW_FEATURE_AARCH64_MMU feature flag on Bifrost models

2025-03-22 Thread Adrian Larumbe
; BIT_ULL(HW_FEATURE_PROTECTED_MODE) | \ > BIT_ULL(HW_FEATURE_PROTECTED_DEBUG_MODE) | \ > BIT_ULL(HW_FEATURE_IDVS_GROUP_SIZE) | \ > + BIT_ULL(HW_FEATURE_AARCH64_MMU) | \ > BIT_ULL(HW_FEATURE_COHERENCY_REG)) > > #define hw_features_g76 (\ > -- > 2.47.2 Adrian Larumbe

Re: [PATCH v4 1/6] drm/panfrost: Set IOMMU_CACHE flag

2025-03-22 Thread Adrian Larumbe
, sgt); > +IOMMU_WRITE | IOMMU_READ | IOMMU_CACHE | IOMMU_NOEXEC, sgt); > > bomapping->active = true; > bo->heap_rss_size += SZ_2M; > -- > 2.47.2 Adrian Larumbe

Re: [PATCH v4 2/6] drm/panfrost: Use GPU_MMU_FEATURES_VA_BITS/PA_BITS macros

2025-03-22 Thread Adrian Larumbe
GPU_MMU_FEATURES_VA_BITS(x) ((x) & GENMASK(7, 0)) > +#define GPU_MMU_FEATURES_PA_BITS(x) (((x) >> 8) & GENMASK(7, 0)) > #define GPU_AS_PRESENT 0x018 /* (RO) Address space > slots present */ > #define GPU_JS_PRESENT 0x01C /* (RO) Job slots > present */ > > -- > 2.47.2 Adrian Larumbe

Re: [RFC PATCH 4/5] drm/panthor: Add support for protected memory allocation in panthor

2025-03-12 Thread Adrian Larumbe
> DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED, > PANTHOR_VM_KERNEL_AUTO_VA); > @@ -3328,6 +3329,7 @@ group_create_queue(struct panthor_group *group, >queue->profiling.slot_count * >sizeof(struct > panthor_job_profiling_data), >DRM_PANTHOR_BO_NO_MMAP, > + 0, >DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC | >DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED, >PANTHOR_VM_KERNEL_AUTO_VA); > @@ -3435,7 +3437,7 @@ int panthor_group_create(struct panthor_file *pfile, > } > > suspend_size = csg_iface->control->protm_suspend_size; > - group->protm_suspend_buf = panthor_fw_alloc_suspend_buf_mem(ptdev, > suspend_size); > + group->protm_suspend_buf = > panthor_fw_alloc_protm_suspend_buf_mem(ptdev, suspend_size); I think you could reuse panthor_fw_alloc_suspend_buf_mem() and extend its interface so that it takes a boolean for the case you want to allocate a protected buffer. > if (IS_ERR(group->protm_suspend_buf)) { > ret = PTR_ERR(group->protm_suspend_buf); > group->protm_suspend_buf = NULL; > @@ -3446,6 +3448,7 @@ int panthor_group_create(struct panthor_file *pfile, > group_args->queues.count * > sizeof(struct > panthor_syncobj_64b), > DRM_PANTHOR_BO_NO_MMAP, > +0, > > DRM_PANTHOR_VM_BIND_OP_MAP_NOEXEC | > > DRM_PANTHOR_VM_BIND_OP_MAP_UNCACHED, > PANTHOR_VM_KERNEL_AUTO_VA); > -- > 2.34.1 Adrian Larumbe

Re: [PATCH v2] drm/panthor: Update CS_STATUS_ defines to correct values

2025-03-03 Thread Adrian Larumbe
ason; > u32 status_wait_sync_value_hi; > > base-commit: 16e57a72780931c3c70dbc928aeee4a0518075de > -- > 2.43.0 Adrian Larumbe

Re: [RFC v2 3/8] drm/panthor: Add panthor_perf_init and panthor_perf_unplug

2025-01-27 Thread adrian . larumbe
_destroy(&perf->sessions); > + > + devm_kfree(ptdev->base.dev, ptdev->perf); > + > + ptdev->perf = NULL; I thought this could be racy with the perfcnt IRQ handler, but maybe if the sessions array is already empty by then then it doesn't matter. > +} > diff --git a/drivers/gpu/drm/panthor/panthor_perf.h > b/drivers/gpu/drm/panthor/panthor_perf.h > index cff537a370c9..90af8b18358c 100644 > --- a/drivers/gpu/drm/panthor/panthor_perf.h > +++ b/drivers/gpu/drm/panthor/panthor_perf.h > @@ -9,4 +9,7 @@ struct panthor_device; > > void panthor_perf_info_init(struct panthor_device *ptdev); > > +int panthor_perf_init(struct panthor_device *ptdev); > +void panthor_perf_unplug(struct panthor_device *ptdev); > + > #endif /* __PANTHOR_PERF_H__ */ > -- > 2.25.1 Adrian Larumbe

Re: [PATCH v2 RESEND 4/5] drm: panthor: add debugfs knob to dump successful jobs

2024-08-22 Thread Adrian Larumbe
Hi Daniel, > On 21.08.2024 11:37, Daniel Almeida wrote: > It can be advantageous for userspace to have access to successful jobs. While it's true that perhaps having additional jobs as part of the same devcoredump file could provide further information as to why a later job failed, I see a few

Re: [PATCH v2 RESEND 2/5] drm: panthor: add devcoredump support

2024-08-22 Thread Adrian Larumbe
> On 21.08.2024 11:37, Daniel Almeida wrote: > Dump the GPU state using devcoredump. This is useful for debugging > purposes. > > Signed-off-by: Daniel Almeida Reviewed-by: Adrian Larumbe > --- > drivers/gpu/drm/panthor/Kconfig | 1 + > drivers/gpu/drm/panth

Re: [PATCH v2 RESEND 1/5] drm: panthor: expose some fw information through the query ioctl

2024-08-22 Thread Adrian Larumbe
> On 21.08.2024 11:37, Daniel Almeida wrote: > This is of interest to userspace, and similar in nature to the GPU > and CSIF information we already return in the query ioctl. > > Signed-off-by: Daniel Almeida Reviewed-by: Adrian Larumbe > --- > drivers/gpu/drm/panthor/

Re: [PATCH v2] drm/panthor: Add DEV_QUERY_TIMESTAMP_INFO dev query

2024-08-14 Thread Adrian Larumbe
+380,22 @@ struct drm_panthor_csif_info { > __u32 pad; > }; > > +/** > + * struct drm_panthor_timestamp_info - Timestamp information > + * > + * Structure grouping all queryable information relating to the GPU > timestamp. > + */ > +struct drm_panthor_timestamp_info { > + /** @timestamp_frequency: The frequency of the timestamp timer. */ > + __u64 timestamp_frequency; > + > + /** @current_timestamp: The current timestamp. */ > + __u64 current_timestamp; > + > + /** @timestamp_offset: The offset of the timestamp timer. */ > + __u64 timestamp_offset; > +}; > + > /** > * struct drm_panthor_dev_query - Arguments passed to > DRM_PANTHOR_IOCTL_DEV_QUERY > */ > > base-commit: 219b45d023ed0902b05c5902a4f31c2c38bcf68c > -- > 2.45.2 Adrian Larumbe

[PATCH 1/2] drm/i915: Change semantics of context isolation reporting to UM

2022-07-29 Thread Adrian Larumbe
isolation is supported, and IGT gem_ctx_isolation was exploiting this wrong semantics when making decisions about which engines support it. This is a uAPI documentation change that precedes the actual change in the getparam ioctl. Signed-off-by: Adrian Larumbe --- include/uapi/drm/i915_drm.h

[PATCH 0/2] Context isolation uAPI fixes

2022-07-29 Thread Adrian Larumbe
...@collabora.com Adrian Larumbe (2): drm/i915: Change semantics of context isolation reporting to UM drm/i915: force getparam ioctl return bool for HAS_CONTEXT_ISOLATION drivers/gpu/drm/i915/gt/intel_engine_user.c | 14 ++ drivers/gpu/drm/i915/gt/intel_engine_user.h | 1 + drivers/gpu/drm

[PATCH 2/2] drm/i915: force getparam ioctl return bool for HAS_CONTEXT_ISOLATION

2022-07-29 Thread Adrian Larumbe
In a previous commit, the uAPI documentation for this param was updated to reflect the actual usage expected by Iris. Now make sure the driver does indeed return a boolean value rather than an engine bitmask. Signed-off-by: Adrian Larumbe --- drivers/gpu/drm/i915/gt/intel_engine_user.c | 14

[PATCH] drm/i915/dg2: make GuC FW a requirement for Gen12 and beyond devices

2021-12-07 Thread Adrian Larumbe
Beginning with DG2, all successive devices will require GuC FW to be present and loaded at probe() time. This change alters error handling in the FW init and load functions so that the driver's probe() function will fail if GuC could not be loaded. Signed-off-by: Adrian Larumbe --- driver