[Mesa-dev] [st/omx/dec/h264] Handing negative POC

2016-11-23 Thread Namburu, Chandu-babu
Hi ,

I have been working on an issue where the for a particular stream playback is 
stuttering and there are lot of frame drops.

That particular stream has negative POC value and as POC value is treated/read 
as unsigned, the frame is getting flushed out of DBP at the end of GOP instead 
of at starting.

Fixed this issue by considering POC as signed value instead of unsigned. 
Attached the patch, please review.
Regards,
Chandu


0001-st-omx-dec-h264-consider-POC-as-signed-instead-of-un.patch
Description: 0001-st-omx-dec-h264-consider-POC-as-signed-instead-of-un.patch
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [st/omx/dec/h264] Handing negative POC

2016-11-29 Thread Namburu, Chandu-babu
Hi Emil,

Thank you for the comments. Please find my response inlined in the below mail.

Regards,
Chandu
-Original Message-
From: Emil Velikov [mailto:emil.l.veli...@gmail.com] 
Sent: Tuesday, November 29, 2016 3:09 AM
To: Christian König 
Cc: Namburu, Chandu-babu ; mesa-dev@lists.freedesktop.org
Subject: Re: [Mesa-dev] [st/omx/dec/h264] Handing negative POC

Hi all,

On 24 November 2016 at 10:22, Christian König  wrote:
> Hi,
>
> patch is Reviewed-by: Christian König .
>
Shouldn't we also change the h264.pic_order_cnt_[lm]sb also to signed ?
[NCB] Yes, These variables also need to singed. I will change them and will 
share the changes shortly.

How about field_order_cnt and field_order_cnt_list ?
We seems to be having an odd mix of signed and unsigned for the latter two.
[NCB] Though in pipe structure it is declared as unsinged int type, it is read 
as signed int in radeon driver(src/gallium/drivers/radeon/radeon_uvd.h). 
field_order_cnt_list should be changed to singed int in pipe structures also. 
Will do the changes accordingly. 

Thanks
Emil
P.S. Chandu-babu, please send future patches inline [1].
[1] http://mesa3d.org/devinfo.html#submitting
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [st/omx/dec/h264] Handing negative POC

2016-11-30 Thread Namburu, Chandu-babu
Hi Ilia,

Thank you for the comments. Please find my response inline.

Regards,
Chandu
-Original Message-
From: ibmir...@gmail.com [mailto:ibmir...@gmail.com] On Behalf Of Ilia Mirkin
Sent: Tuesday, November 29, 2016 3:15 AM
To: Emil Velikov 
Cc: Christian König ; mesa-dev@lists.freedesktop.org; 
Namburu, Chandu-babu 
Subject: Re: [Mesa-dev] [st/omx/dec/h264] Handing negative POC

On Mon, Nov 28, 2016 at 4:38 PM, Emil Velikov  wrote:
> Hi all,
>
> On 24 November 2016 at 10:22, Christian König  wrote:
>> Hi,
>>
>> patch is Reviewed-by: Christian König .
>>
> Shouldn't we also change the h264.pic_order_cnt_[lm]sb also to signed ?
>
> How about field_order_cnt and field_order_cnt_list ?
> We seems to be having an odd mix of signed and unsigned for the latter two.

I had a similar question re using vl_rbsp_u, which returns unsigned.
However I think the situation here is that these are unsigned values, but math 
performed on them can generate negative numbers. I haven't looked 
super-carefully though.
[NCB] value returned from the bit -stream NAL is signed value. Negative POC is 
valid H264 concept to represent the frames that need to displayed prior to IDR 
frame. 
I will share the implementation of the vl_rbsp_s routine value shortly for 
review along with the changes of Emil's review comments.

>
> Thanks
> Emil
> P.S. Chandu-babu, please send future patches inline [1].
> [1] http://mesa3d.org/devinfo.html#submitting
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [st/va] change va max_entrypoints

2017-06-14 Thread Namburu, Chandu-babu
From: Chandu Babu N 

As encode support is added along with decode,
now max_entrypoints are two.
vaMaxNumEntrypoints will return correct value.

Signed-off-by: Chandu Babu N 
---
src/gallium/state_trackers/va/context.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/va/context.c 
b/src/gallium/state_trackers/va/context.c
index ae9154a332..35be3d0745 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -167,7 +167,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
*ctx->vtable = vtable;
*ctx->vtable_vpp = vtable_vpp;
ctx->max_profiles = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH - 
PIPE_VIDEO_PROFILE_UNKNOWN;
-   ctx->max_entrypoints = 1;
+   ctx->max_entrypoints = 2;
ctx->max_attributes = 1;
ctx->max_image_formats = VL_VA_MAX_IMAGE_FORMATS;
ctx->max_subpic_formats = 1;

--

2.7.4
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [st/va] change va max_entrypoints

2017-06-15 Thread Namburu, Chandu-babu
Hi Emil and Christian,

Modified patch as per the comments and added CC: mesa-stable

From: Chandu Babu N 

As encode support is added along with decode,
increase max_entrypoints to two.
vaMaxNumEntrypoints will return correct value.

v2: assert when max_entrypoints needs to be bigger

---
 src/gallium/state_trackers/va/config.c  | 2 ++
 src/gallium/state_trackers/va/context.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/va/config.c 
b/src/gallium/state_trackers/va/config.c
index c5d69bd..7d3bd64 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -102,6 +102,8 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile 
profile,
if (num_entrypoints == 0)
   return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;

+   assert(*num_entrypoints <= ctx->max_entrypoints);
+
return VA_STATUS_SUCCESS;
 }

diff --git a/src/gallium/state_trackers/va/context.c 
b/src/gallium/state_trackers/va/context.c
index 6e7a58d..186f5066 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -167,7 +167,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
*ctx->vtable = vtable;
*ctx->vtable_vpp = vtable_vpp;
ctx->max_profiles = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH - 
PIPE_VIDEO_PROFILE_UNKNOWN;
-   ctx->max_entrypoints = 1;
+   ctx->max_entrypoints = 2;
ctx->max_attributes = 1;
ctx->max_image_formats = VL_VA_MAX_IMAGE_FORMATS;
ctx->max_subpic_formats = 1;
--
2.7.4

Regards,
Chandu
-Original Message-
From: Christian König [mailto:deathsim...@vodafone.de] 
Sent: Wednesday, June 14, 2017 9:50 PM
To: Emil Velikov 
Cc: Namburu, Chandu-babu ; mesa-dev@lists.freedesktop.org
Subject: Re: [Mesa-dev] [st/va] change va max_entrypoints

Am 14.06.2017 um 17:34 schrieb Emil Velikov:
> On 14 June 2017 at 15:21, Christian König  wrote:
>> Am 14.06.2017 um 15:40 schrieb Namburu, Chandu-babu:
>>> From: Chandu Babu N 
>>>
>>> As encode support is added along with decode, now max_entrypoints 
>>> are two.
>>> vaMaxNumEntrypoints will return correct value.
>>>
>>> Signed-off-by: Chandu Babu N 
>> Reviewed-by: Christian König 
>>
> Gents, can you please add a "Fixes: $sha ..." or "Cc: mesa-stable.." tag.
>
> Having a quick look - seems like the vaQueryConfigEntrypoints() 
> callback does not honour the num_entrypoints argument, hence prior to 
> this commit we'll be causing memory corruption. We might want to add 
> an assert/check or two to prevent this in the future?
>
> -Emil
> P.S. Christian, can I bribe you to use plain text emails - formatting 
> goes crazy when trying to reply :-\

Hui? That should already be a plain text mail:

Content-Type: text/plain; charset=windows-1252; format=flowed


And yes CC stable and an assert to check for that sounds like a good idea to me 
as well.

Namburu can you take care of this as well?

Thanks,

Christian.

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [st/va] change va max_entrypoints

2017-06-15 Thread Namburu, Chandu-babu
Hi Emil and Christian,

Modified patch as per the comments and added CC: mesa-stable

From: Chandu Babu N 

As encode support is added along with decode, increase max_entrypoints to two.
vaMaxNumEntrypoints will return correct value.

v2: assert when max_entrypoints needs to be bigger

---
 src/gallium/state_trackers/va/config.c  | 2 ++  
src/gallium/state_trackers/va/context.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/va/config.c 
b/src/gallium/state_trackers/va/config.c
index c5d69bd..7d3bd64 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -102,6 +102,8 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile 
profile,
if (num_entrypoints == 0)
   return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;

+   assert(*num_entrypoints <= ctx->max_entrypoints);
+
return VA_STATUS_SUCCESS;
 }

diff --git a/src/gallium/state_trackers/va/context.c 
b/src/gallium/state_trackers/va/context.c
index 6e7a58d..186f5066 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -167,7 +167,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
*ctx->vtable = vtable;
*ctx->vtable_vpp = vtable_vpp;
ctx->max_profiles = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH - 
PIPE_VIDEO_PROFILE_UNKNOWN;
-   ctx->max_entrypoints = 1;
+   ctx->max_entrypoints = 2;
ctx->max_attributes = 1;
ctx->max_image_formats = VL_VA_MAX_IMAGE_FORMATS;
ctx->max_subpic_formats = 1;
--
2.7.4

Regards,
Chandu
-Original Message-
From: Christian König [mailto:deathsim...@vodafone.de]
Sent: Wednesday, June 14, 2017 9:50 PM
To: Emil Velikov 
Cc: Namburu, Chandu-babu ; mesa-dev@lists.freedesktop.org
Subject: Re: [Mesa-dev] [st/va] change va max_entrypoints

Am 14.06.2017 um 17:34 schrieb Emil Velikov:
> On 14 June 2017 at 15:21, Christian König  wrote:
>> Am 14.06.2017 um 15:40 schrieb Namburu, Chandu-babu:
>>> From: Chandu Babu N 
>>>
>>> As encode support is added along with decode, now max_entrypoints 
>>> are two.
>>> vaMaxNumEntrypoints will return correct value.
>>>
>>> Signed-off-by: Chandu Babu N 
>> Reviewed-by: Christian König 
>>
> Gents, can you please add a "Fixes: $sha ..." or "Cc: mesa-stable.." tag.
>
> Having a quick look - seems like the vaQueryConfigEntrypoints() 
> callback does not honour the num_entrypoints argument, hence prior to 
> this commit we'll be causing memory corruption. We might want to add 
> an assert/check or two to prevent this in the future?
>
> -Emil
> P.S. Christian, can I bribe you to use plain text emails - formatting 
> goes crazy when trying to reply :-\

Hui? That should already be a plain text mail:

Content-Type: text/plain; charset=windows-1252; format=flowed


And yes CC stable and an assert to check for that sounds like a good idea to me 
as well.

Namburu can you take care of this as well?

Thanks,

Christian.

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [st/va] change va max_entrypoints

2017-06-17 Thread Namburu, Chandu-babu

From: Chandu Babu N 

As encode support is added along with decode, increase max_entrypoints to two.
vaMaxNumEntrypoints was returning incorrect value and causing 
memory corruption before this commit

v2: assert when max_entrypoints needs to be bigger

---
 src/gallium/state_trackers/va/config.c  | 2 ++  
src/gallium/state_trackers/va/context.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/gallium/state_trackers/va/config.c 
b/src/gallium/state_trackers/va/config.c
index c5d69bd..7d3bd64 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -102,6 +102,8 @@ vlVaQueryConfigEntrypoints(VADriverContextP ctx, VAProfile 
profile,
if (num_entrypoints == 0)
   return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;

+   assert(*num_entrypoints <= ctx->max_entrypoints);
+
return VA_STATUS_SUCCESS;
 }

diff --git a/src/gallium/state_trackers/va/context.c 
b/src/gallium/state_trackers/va/context.c
index 6e7a58d..186f5066 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -167,7 +167,7 @@ VA_DRIVER_INIT_FUNC(VADriverContextP ctx)
*ctx->vtable = vtable;
*ctx->vtable_vpp = vtable_vpp;
ctx->max_profiles = PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH - 
PIPE_VIDEO_PROFILE_UNKNOWN;
-   ctx->max_entrypoints = 1;
+   ctx->max_entrypoints = 2;
ctx->max_attributes = 1;
ctx->max_image_formats = VL_VA_MAX_IMAGE_FORMATS;
ctx->max_subpic_formats = 1;
--
2.7.4

Regards,
Chandu

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [st/va] Fix leak in VAAPI subpictures

2017-06-22 Thread Namburu, Chandu-babu
From: Chandu Babu N 
Subject: [PATCH] [st/va] Fix leak in VAAPI subpictures

sampler view allocated in vaAssociateSubpicture is not cleared
in vaiDeassociateSubpicture.

Reviewed-by: Christian König 
---
src/gallium/state_trackers/va/subpicture.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/gallium/state_trackers/va/subpicture.c 
b/src/gallium/state_trackers/va/subpicture.c
index 15d52b9..981a99c 100644
--- a/src/gallium/state_trackers/va/subpicture.c
+++ b/src/gallium/state_trackers/va/subpicture.c
@@ -283,6 +283,7 @@ vlVaDeassociateSubpicture(VADriverContextP ctx, 
VASubpictureID subpicture,
   while (surf->subpics.size && util_dynarray_top(&surf->subpics, 
vlVaSubpicture *) == NULL)
  (void)util_dynarray_pop(&surf->subpics, vlVaSubpicture *);
}
+   pipe_sampler_view_reference(&sub->sampler,NULL);
mtx_unlock(&drv->mutex);
return VA_STATUS_SUCCESS;
--
2.7.4
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [st/va] Fix leak in VAAPI subpictures

2017-06-27 Thread Namburu, Chandu-babu
Sure Emil, Will take care of it next time. Thank you for the suggestion.

Regards,
Chandu
-Original Message-
From: Emil Velikov [mailto:emil.l.veli...@gmail.com] 
Sent: Thursday, June 22, 2017 9:48 PM
To: Namburu, Chandu-babu 
Cc: mesa-dev@lists.freedesktop.org
Subject: Re: [Mesa-dev] [st/va] Fix leak in VAAPI subpictures

On 22 June 2017 at 10:25, Namburu, Chandu-babu  wrote:
> From: Chandu Babu N 
> Subject: [PATCH] [st/va] Fix leak in VAAPI subpictures
>
> sampler view allocated in vaAssociateSubpicture is not cleared in 
> vaiDeassociateSubpicture.
>
> Reviewed-by: Christian König 

Please familiarise yourself with the patch submission process [1].

The current git format-patch(?), open patch, copy/paste is also slower than a 
plain git send-email ...
For even more see the "Git tips" section.

Thanks
Emil
[1] https://www.mesa3d.org/submittingpatches.html
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev