Discussion:
[PATCH][libva-intel-driver] i965_GetDisplayAttributes: propagate flags from src to dst
(too old to reply)
Daniel Charles
2016-11-22 00:23:27 UTC
Permalink
flags need to be propagated for user to know which flags
are supported by VADisplayAttribType.

When only VA_DISPLAY_ATTRIB_SETTABLE is reported as flag
then it has to be propagated back to user. The rest of the
values should be left untouched

Signed-off-by: Daniel Charles <***@intel.com>
---
src/i965_drv_video.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 04670f4..30dd433 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -3734,10 +3734,15 @@ i965_GetDisplayAttributes(
VADisplayAttribute *src_attrib, * const dst_attrib = &attribs[i];

src_attrib = get_display_attribute(ctx, dst_attrib->type);
+
if (src_attrib && (src_attrib->flags & VA_DISPLAY_ATTRIB_GETTABLE)) {
dst_attrib->min_value = src_attrib->min_value;
dst_attrib->max_value = src_attrib->max_value;
dst_attrib->value = src_attrib->value;
+ dst_attrib->flags = src_attrib->flags;
+ } else if (src_attrib &&
+ (src_attrib->flags & VA_DISPLAY_ATTRIB_SETTABLE)) {
+ dst_attrib->flags = src_attrib->flags;
}
else
dst_attrib->flags = VA_DISPLAY_ATTRIB_NOT_SUPPORTED;
--
2.7.4
Xiang, Haihao
2016-11-22 04:54:32 UTC
Permalink
LGTM, applied.

Thanks
Haihao
Post by Daniel Charles
flags need to be propagated for user to know which flags
are supported by VADisplayAttribType.
When only VA_DISPLAY_ATTRIB_SETTABLE is reported as flag
then it has to be propagated back to user.  The rest of the
values should be left untouched
---
 src/i965_drv_video.c | 5 +++++
 1 file changed, 5 insertions(+)
diff --git a/src/i965_drv_video.c b/src/i965_drv_video.c
index 04670f4..30dd433 100644
--- a/src/i965_drv_video.c
+++ b/src/i965_drv_video.c
@@ -3734,10 +3734,15 @@ i965_GetDisplayAttributes(
         VADisplayAttribute *src_attrib, * const dst_attrib =
&attribs[i];
 
         src_attrib = get_display_attribute(ctx, dst_attrib->type);
+
         if (src_attrib && (src_attrib->flags &
VA_DISPLAY_ATTRIB_GETTABLE)) {
             dst_attrib->min_value = src_attrib->min_value;
             dst_attrib->max_value = src_attrib->max_value;
             dst_attrib->value     = src_attrib->value;
+            dst_attrib->flags     = src_attrib->flags;
+        } else if (src_attrib &&
+                (src_attrib->flags & VA_DISPLAY_ATTRIB_SETTABLE)) {
+            dst_attrib->flags     = src_attrib->flags;
         }
         else
             dst_attrib->flags = VA_DISPLAY_ATTRIB_NOT_SUPPORTED;
Loading...