[Mesa-dev] [PATCH 05/15] st/va: implement vlVa(Create|Destroy|Query)Config

Christian König deathsimple at vodafone.de
Tue Jun 18 02:27:35 PDT 2013


From: Christian König <christian.koenig at amd.com>

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 src/gallium/state_trackers/va/config.c |   29 ++++++++++++++++++++++++++---
 1 file changed, 26 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/va/config.c b/src/gallium/state_trackers/va/config.c
index 14951a1..6779774 100644
--- a/src/gallium/state_trackers/va/config.c
+++ b/src/gallium/state_trackers/va/config.c
@@ -108,10 +108,26 @@ VAStatus
 vlVaCreateConfig(VADriverContextP ctx, VAProfile profile, VAEntrypoint entrypoint,
                  VAConfigAttrib *attrib_list, int num_attribs, VAConfigID *config_id)
 {
+   struct pipe_screen *pscreen;
+   enum pipe_video_profile p;
+
    if (!ctx)
       return VA_STATUS_ERROR_INVALID_CONTEXT;
 
-   return VA_STATUS_ERROR_UNIMPLEMENTED;
+   p = ProfileToPipe(profile);
+   if (p == PIPE_VIDEO_PROFILE_UNKNOWN)
+      return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+
+   pscreen = VL_VA_PSCREEN(ctx);
+   if (!pscreen->get_video_param(pscreen, p, PIPE_VIDEO_CAP_SUPPORTED))
+      return VA_STATUS_ERROR_UNSUPPORTED_PROFILE;
+
+   if (entrypoint != VAEntrypointVLD)
+      return VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT;
+
+   *config_id = p;
+
+   return VA_STATUS_SUCCESS;
 }
 
 VAStatus
@@ -120,7 +136,7 @@ vlVaDestroyConfig(VADriverContextP ctx, VAConfigID config_id)
    if (!ctx)
       return VA_STATUS_ERROR_INVALID_CONTEXT;
 
-   return VA_STATUS_ERROR_UNIMPLEMENTED;
+   return VA_STATUS_SUCCESS;
 }
 
 VAStatus
@@ -130,5 +146,12 @@ vlVaQueryConfigAttributes(VADriverContextP ctx, VAConfigID config_id, VAProfile
    if (!ctx)
       return VA_STATUS_ERROR_INVALID_CONTEXT;
 
-   return VA_STATUS_ERROR_UNIMPLEMENTED;
+   *profile = PipeToProfile(config_id);
+   *entrypoint = VAEntrypointVLD;
+
+   *num_attribs = 1;
+   attrib_list[0].type = VAConfigAttribRTFormat;
+   attrib_list[0].value = VA_RT_FORMAT_YUV420;
+
+   return VA_STATUS_SUCCESS;
 }
-- 
1.7.9.5



More information about the mesa-dev mailing list