linux-arm-msm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] venus: vdec: fix decoded data size
@ 2018-07-02  7:44 Vikash Garodia
  2018-07-02  8:51 ` Alexandre Courbot
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Vikash Garodia @ 2018-07-02  7:44 UTC (permalink / raw)
  To: stanimir.varbanov
  Cc: linux-media, linux-arm-msm, linux-kernel, acourbot, vgarodia

Exisiting code returns the max of the decoded
size and buffer size. It turns out that buffer
size is always greater due to hardware alignment
requirement. As a result, payload size given to
client is incorrect. This change ensures that
the bytesused is assigned to actual payload size.

Change-Id: Ie6f3429c0cb23f682544748d181fa4fa63ca2e28
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
---
 drivers/media/platform/qcom/venus/vdec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index d079aeb..ada1d2f 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -890,7 +890,7 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
 
 		vb = &vbuf->vb2_buf;
 		vb->planes[0].bytesused =
-			max_t(unsigned int, opb_sz, bytesused);
+			min_t(unsigned int, opb_sz, bytesused);
 		vb->planes[0].data_offset = data_offset;
 		vb->timestamp = timestamp_us * NSEC_PER_USEC;
 		vbuf->sequence = inst->sequence_cap++;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 21+ messages in thread
* [PATCH] venus: vdec: fix decoded data size
@ 2018-10-03 11:30 Vikash Garodia
  2018-10-03 12:36 ` Stanimir Varbanov
  2018-10-05 15:26 ` Stanimir Varbanov
  0 siblings, 2 replies; 21+ messages in thread
From: Vikash Garodia @ 2018-10-03 11:30 UTC (permalink / raw)
  To: stanimir.varbanov, hverkuil, mchehab
  Cc: linux-media, linux-kernel, linux-arm-msm, acourbot, vgarodia

Exisiting code returns the max of the decoded size and buffer size.
It turns out that buffer size is always greater due to hardware
alignment requirement. As a result, payload size given to client
is incorrect. This change ensures that the bytesused is assigned
to actual payload size, when available.

Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
---
 drivers/media/platform/qcom/venus/vdec.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/platform/qcom/venus/vdec.c b/drivers/media/platform/qcom/venus/vdec.c
index 991e158..189ec97 100644
--- a/drivers/media/platform/qcom/venus/vdec.c
+++ b/drivers/media/platform/qcom/venus/vdec.c
@@ -888,8 +888,7 @@ static void vdec_buf_done(struct venus_inst *inst, unsigned int buf_type,
 		unsigned int opb_sz = venus_helper_get_opb_size(inst);
 
 		vb = &vbuf->vb2_buf;
-		vb->planes[0].bytesused =
-			max_t(unsigned int, opb_sz, bytesused);
+		vb2_set_plane_payload(vb, 0, bytesused ? : opb_sz);
 		vb->planes[0].data_offset = data_offset;
 		vb->timestamp = timestamp_us * NSEC_PER_USEC;
 		vbuf->sequence = inst->sequence_cap++;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2018-10-08 11:19 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-02  7:44 [PATCH] venus: vdec: fix decoded data size Vikash Garodia
2018-07-02  8:51 ` Alexandre Courbot
2018-07-06 15:12   ` Stanimir Varbanov
2018-07-06 17:09     ` Alexandre Courbot
2018-07-07 12:26 ` Stanimir Varbanov
2018-07-18 11:31 ` Stanimir Varbanov
2018-07-18 13:26   ` Nicolas Dufresne
2018-07-18 14:37     ` Stanimir Varbanov
2018-09-17 10:00       ` Hans Verkuil
2018-09-17 14:30         ` Stanimir Varbanov
2018-09-17 14:32           ` Hans Verkuil
2018-09-19 10:32             ` Alexandre Courbot
2018-09-19 15:02               ` Stanimir Varbanov
2018-09-19 15:53                 ` Nicolas Dufresne
2018-09-20  3:02                   ` Tomasz Figa
2018-09-25  9:41                   ` Stanimir Varbanov
2018-10-02  7:38                 ` Stanimir Varbanov
  -- strict thread matches above, loose matches on Subject: below --
2018-10-03 11:30 Vikash Garodia
2018-10-03 12:36 ` Stanimir Varbanov
2018-10-05 15:26 ` Stanimir Varbanov
2018-10-08 11:19   ` Vikash Garodia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).