diff mbox series

media: platform: s5p-mfc: properly assign device to both vb2 queues

Message ID 20201124084143.12545-1-m.szyprowski@samsung.com (mailing list archive)
State New, archived
Headers show
Series media: platform: s5p-mfc: properly assign device to both vb2 queues | expand

Commit Message

Marek Szyprowski Nov. 24, 2020, 8:41 a.m. UTC
Properly set device pointers in videobuf2 queues, so the videobuf2
debugging messages will be prefixed with the respective device name.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
---
This patch was previously sent as part of "[PATCH v2 0/4] Exynos4 media
drivers: adapt for the planned ARM IOMMU-DMA changes" patchset:
https://lore.kernel.org/linux-samsung-soc/20200918144833.14618-1-m.szyprowski@samsung.com/
The IOMMU related changes are still under review, but this change is
unrelated and it makes sense to aplly it separately.
---
 drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Sylwester Nawrocki Nov. 24, 2020, 11:32 a.m. UTC | #1
On 11/24/20 09:41, Marek Szyprowski wrote:
> Properly set device pointers in videobuf2 queues, so the videobuf2
> debugging messages will be prefixed with the respective device name.
> 
> Signed-off-by: Marek Szyprowski<m.szyprowski@samsung.com>
> ---
> This patch was previously sent as part of "[PATCH v2 0/4] Exynos4 media
> drivers: adapt for the planned ARM IOMMU-DMA changes" patchset:
> https://lore.kernel.org/linux-samsung-soc/20200918144833.14618-1-m.szyprowski@samsung.com/
> The IOMMU related changes are still under review, but this change is
> unrelated and it makes sense to aplly it separately.
> ---
>   drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> index eba2b9f040df..4e50c342b322 100644
> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
> @@ -844,6 +844,7 @@ static int s5p_mfc_open(struct file *file)
>   	q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
>   	q->drv_priv = &ctx->fh;
>   	q->lock = &dev->mfc_mutex;
> +	q->dev = &dev->plat_dev->dev;

I can't see where q->dev is used for debug logs, shouldn't we use
v4l2_queue_init_name() instead?

--
Regards,
Sylwester
Hans Verkuil Dec. 2, 2020, 8:47 a.m. UTC | #2
On 24/11/2020 12:32, Sylwester Nawrocki wrote:
> On 11/24/20 09:41, Marek Szyprowski wrote:
>> Properly set device pointers in videobuf2 queues, so the videobuf2
>> debugging messages will be prefixed with the respective device name.
>>
>> Signed-off-by: Marek Szyprowski<m.szyprowski@samsung.com>
>> ---
>> This patch was previously sent as part of "[PATCH v2 0/4] Exynos4 media
>> drivers: adapt for the planned ARM IOMMU-DMA changes" patchset:
>> https://lore.kernel.org/linux-samsung-soc/20200918144833.14618-1-m.szyprowski@samsung.com/
>> The IOMMU related changes are still under review, but this change is
>> unrelated and it makes sense to aplly it separately.
>> ---
>>   drivers/media/platform/s5p-mfc/s5p_mfc.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> index eba2b9f040df..4e50c342b322 100644
>> --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
>> @@ -844,6 +844,7 @@ static int s5p_mfc_open(struct file *file)
>>   	q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
>>   	q->drv_priv = &ctx->fh;
>>   	q->lock = &dev->mfc_mutex;
>> +	q->dev = &dev->plat_dev->dev;
> 
> I can't see where q->dev is used for debug logs, shouldn't we use
> v4l2_queue_init_name() instead?

And also you don't need to set q->dev: this driver sets alloc_devs[],
and q->dev is only used if alloc_devs is not set. q->dev should probably
be renamed to alloc_dev since that's what it is used for: the device for
the allocation context.

To help debugging using v4l2_queue_init_name would probably be a better
approach.

Regards,

	Hans
diff mbox series

Patch

diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c
index eba2b9f040df..4e50c342b322 100644
--- a/drivers/media/platform/s5p-mfc/s5p_mfc.c
+++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c
@@ -844,6 +844,7 @@  static int s5p_mfc_open(struct file *file)
 	q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
 	q->drv_priv = &ctx->fh;
 	q->lock = &dev->mfc_mutex;
+	q->dev = &dev->plat_dev->dev;
 	if (vdev == dev->vfd_dec) {
 		q->io_modes = VB2_MMAP;
 		q->ops = get_dec_queue_ops();
@@ -871,6 +872,7 @@  static int s5p_mfc_open(struct file *file)
 	q->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
 	q->drv_priv = &ctx->fh;
 	q->lock = &dev->mfc_mutex;
+	q->dev = &dev->plat_dev->dev;
 	if (vdev == dev->vfd_dec) {
 		q->io_modes = VB2_MMAP;
 		q->ops = get_dec_queue_ops();