Discussion:
[st/va] change va max_entrypoints
(too old to reply)
Namburu, Chandu-babu
2017-06-14 13:40:14 UTC
Permalink
Raw Message
From: Chandu Babu N <***@amd.com>

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

Signed-off-by: Chandu Babu N <***@amd.com>
---
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
Christian König
2017-06-14 14:21:24 UTC
Permalink
Raw Message
Post by Namburu, Chandu-babu
As encode support is added along with decode,
now max_entrypoints are two.
vaMaxNumEntrypoints will return correct value.
---
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
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Emil Velikov
2017-06-14 15:34:32 UTC
Permalink
Raw Message
Post by Namburu, Chandu-babu
As encode support is added along with decode,
now max_entrypoints are two.
vaMaxNumEntrypoints will return correct value.
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 :-\
Christian König
2017-06-14 16:19:43 UTC
Permalink
Raw Message
Post by Emil Velikov
Post by Namburu, Chandu-babu
As encode support is added along with decode,
now max_entrypoints are two.
vaMaxNumEntrypoints will return correct value.
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.
Namburu, Chandu-babu
2017-06-15 12:21:14 UTC
Permalink
Raw Message
Hi Emil and Christian,

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

From: Chandu Babu N <***@amd.com>

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:***@vodafone.de]
Sent: Wednesday, June 14, 2017 9:50 PM
To: Emil Velikov <***@gmail.com>
Cc: Namburu, Chandu-babu <***@amd.com>; mesa-***@lists.freedesktop.org
Subject: Re: [Mesa-dev] [st/va] change va max_entrypoints
Post by Emil Velikov
As encode support is added along with decode, now max_entrypoints
are two.
vaMaxNumEntrypoints will return correct value.
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.
Namburu, Chandu-babu
2017-06-15 12:23:22 UTC
Permalink
Raw Message
Hi Emil and Christian,

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

From: Chandu Babu N <***@amd.com>

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:***@vodafone.de]
Sent: Wednesday, June 14, 2017 9:50 PM
To: Emil Velikov <***@gmail.com>
Cc: Namburu, Chandu-babu <***@amd.com>; mesa-***@lists.freedesktop.org
Subject: Re: [Mesa-dev] [st/va] change va max_entrypoints
Post by Emil Velikov
As encode support is added along with decode, now max_entrypoints
are two.
vaMaxNumEntrypoints will return correct value.
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.
Alex Deucher
2017-06-14 14:58:07 UTC
Permalink
Raw Message
Post by Namburu, Chandu-babu
As encode support is added along with decode,
now max_entrypoints are two.
vaMaxNumEntrypoints will return correct value.
This should probably got to stable as well. Do you need someone to
commit this for you?

Alex
Post by Namburu, Chandu-babu
---
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
https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Namburu, Chandu-babu
2017-06-17 11:49:13 UTC
Permalink
Raw Message
From: Chandu Babu N <mailto:***@amd.com>

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

Loading...