vl: add entrypoint to get_video_param
authorChristian König <christian.koenig@amd.com>
Mon, 15 Jul 2013 14:31:25 +0000 (08:31 -0600)
committerChristian König <christian.koenig@amd.com>
Mon, 19 Aug 2013 08:21:15 +0000 (10:21 +0200)
Signed-off-by: Christian König <christian.koenig@amd.com>
24 files changed:
src/gallium/auxiliary/vl/vl_decoder.c
src/gallium/auxiliary/vl/vl_decoder.h
src/gallium/auxiliary/vl/vl_video_buffer.c
src/gallium/drivers/ilo/ilo_screen.c
src/gallium/drivers/nouveau/nouveau_video.c
src/gallium/drivers/nouveau/nouveau_vp3_video.c
src/gallium/drivers/nouveau/nouveau_vp3_video.h
src/gallium/drivers/nv50/nv50_context.h
src/gallium/drivers/nv50/nv84_video.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_uvd.c
src/gallium/drivers/radeon/radeon_uvd.c
src/gallium/drivers/radeon/radeon_uvd.h
src/gallium/drivers/radeonsi/radeonsi_pipe.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/include/pipe/p_screen.h
src/gallium/state_trackers/vdpau/decode.c
src/gallium/state_trackers/vdpau/mixer.c
src/gallium/state_trackers/vdpau/query.c
src/gallium/state_trackers/vdpau/surface.c
src/gallium/state_trackers/xvmc/subpicture.c
src/gallium/state_trackers/xvmc/surface.c

index f19834fb3d522e9108c22596fc0e59c5377638a6..b325b8c61bb5c02a3cda3f4efecc97f278aa39a3 100644 (file)
@@ -33,7 +33,8 @@
 #include "vl_mpeg12_decoder.h"
 
 bool
-vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile)
+vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile,
+                     enum pipe_video_entrypoint entrypoint)
 {
    assert(screen);
    switch (u_reduce_video_profile(profile)) {
@@ -74,6 +75,7 @@ vl_create_decoder(struct pipe_context *pipe,
    (
       pipe->screen,
       templat->profile,
+      templat->entrypoint,
       PIPE_VIDEO_CAP_NPOT_TEXTURES
    );
 
index 124315f073f2f1e64dd6b6994387dbd6a0d2fa75..0c216dfb8a8eb9207a82d273386874862d1b02dc 100644 (file)
@@ -35,7 +35,8 @@
  * check if a given profile is supported with shader based decoding
  */
 bool
-vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile);
+vl_profile_supported(struct pipe_screen *screen, enum pipe_video_profile profile,
+                     enum pipe_video_entrypoint entrypoint);
 
 /**
  * get the maximum supported level for the given profile with shader based decoding
index 16c7649388bf37a83a60bc4f8c461812fb61384b..d81c1815abfdf743ba3b522804257b14b0fc7e8a 100644 (file)
@@ -406,6 +406,7 @@ vl_video_buffer_create(struct pipe_context *pipe,
    (
       pipe->screen,
       PIPE_VIDEO_PROFILE_UNKNOWN,
+      PIPE_VIDEO_ENTRYPOINT_UNKNOWN,
       PIPE_VIDEO_CAP_NPOT_TEXTURES
    );
 
index 5f97226bb82fa38b172d3a576890da5e9fe960f6..9f3235ce4ce58d07fe473d52100273f8196eec3f 100644 (file)
@@ -152,11 +152,12 @@ ilo_get_shader_param(struct pipe_screen *screen, unsigned shader,
 static int
 ilo_get_video_param(struct pipe_screen *screen,
                     enum pipe_video_profile profile,
+                    enum pipe_video_entrypoint entrypoint,
                     enum pipe_video_cap param)
 {
    switch (param) {
    case PIPE_VIDEO_CAP_SUPPORTED:
-      return vl_profile_supported(screen, profile);
+      return vl_profile_supported(screen, profile, entrypoint);
    case PIPE_VIDEO_CAP_NPOT_TEXTURES:
       return 1;
    case PIPE_VIDEO_CAP_MAX_WIDTH:
index 67b67392bbce63e2caa580adf71ea9ca50d7b2b8..8e08cab4b2d325a913b29d821dcf6f9042e4f74f 100644 (file)
@@ -834,11 +834,12 @@ error:
 static int
 nouveau_screen_get_video_param(struct pipe_screen *pscreen,
                                enum pipe_video_profile profile,
+                              enum pipe_video_entrypoint entrypoint,
                                enum pipe_video_cap param)
 {
    switch (param) {
    case PIPE_VIDEO_CAP_SUPPORTED:
-      return vl_profile_supported(pscreen, profile);
+      return vl_profile_supported(pscreen, profile, entrypoint);
    case PIPE_VIDEO_CAP_NPOT_TEXTURES:
       return 1;
    case PIPE_VIDEO_CAP_MAX_WIDTH:
index be0e6b3fafd6b3233a6c70ed22898948900405ff..1659c5f7e72d1003a33fbad307685de14a7e3500 100644 (file)
@@ -353,6 +353,7 @@ nouveau_vp3_load_firmware(struct nouveau_vp3_decoder *dec,
 int
 nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen,
                                    enum pipe_video_profile profile,
+                                   enum pipe_video_entrypoint entrypoint,
                                    enum pipe_video_cap param)
 {
    int chipset = nouveau_screen(pscreen)->device->chipset;
index 177f0a851d0c5c1e9b14ac257b626e3ff90589ee..8aedfd08da2dfbf7bd716ae4820df88c3dc84cc9 100644 (file)
@@ -220,6 +220,7 @@ nouveau_vp3_vp_caps(struct nouveau_vp3_decoder *dec, union pipe_desc desc,
 int
 nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen,
                                    enum pipe_video_profile profile,
+                                   enum pipe_video_entrypoint entrypoint,
                                    enum pipe_video_cap param);
 
 boolean
index f89a55110cf643053975a6a7c6612c549cf830da..3600f70a29c69d70887c55b8000c0aae5cf0120c 100644 (file)
@@ -301,6 +301,7 @@ nv84_video_buffer_create(struct pipe_context *pipe,
 int
 nv84_screen_get_video_param(struct pipe_screen *pscreen,
                             enum pipe_video_profile profile,
+                            enum pipe_video_entrypoint entrypoint,
                             enum pipe_video_cap param);
 
 boolean
index 7759979b499cd6d51eb4ca67ffe631aecf0c4743..e7c715c8ef6603dc61f9ab0335e6b1b7aefa31f7 100644 (file)
@@ -744,6 +744,7 @@ error:
 int
 nv84_screen_get_video_param(struct pipe_screen *pscreen,
                             enum pipe_video_profile profile,
+                            enum pipe_video_entrypoint entrypoint,
                             enum pipe_video_cap param)
 {
    switch (param) {
index 25ff286389275beb30df6e6ea54ae240763476db..5a388970c9b15104d2426ee2cb9999252a3ab2b5 100644 (file)
@@ -341,11 +341,12 @@ static float r300_get_paramf(struct pipe_screen* pscreen,
 
 static int r300_get_video_param(struct pipe_screen *screen,
                                enum pipe_video_profile profile,
+                               enum pipe_video_entrypoint entrypoint,
                                enum pipe_video_cap param)
 {
    switch (param) {
       case PIPE_VIDEO_CAP_SUPPORTED:
-         return vl_profile_supported(screen, profile);
+         return vl_profile_supported(screen, profile, entrypoint);
       case PIPE_VIDEO_CAP_NPOT_TEXTURES:
          return 0;
       case PIPE_VIDEO_CAP_MAX_WIDTH:
index c8fb547a30a8f2f5295756a3195af61c81cbfbb9..2be5910fcb2e04b32b1ff1e6c317b3dda65f5ca9 100644 (file)
@@ -777,11 +777,12 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e
 
 static int r600_get_video_param(struct pipe_screen *screen,
                                enum pipe_video_profile profile,
+                               enum pipe_video_entrypoint entrypoint,
                                enum pipe_video_cap param)
 {
        switch (param) {
        case PIPE_VIDEO_CAP_SUPPORTED:
-               return vl_profile_supported(screen, profile);
+               return vl_profile_supported(screen, profile, entrypoint);
        case PIPE_VIDEO_CAP_NPOT_TEXTURES:
                return 1;
        case PIPE_VIDEO_CAP_MAX_WIDTH:
index 743f9abf6ab23fb34b881c93f4663a5e3e2aa3b2..21d68c9387b258233f9df1e654b670902434c6f3 100644 (file)
@@ -898,6 +898,7 @@ struct pipe_video_buffer *r600_video_buffer_create(struct pipe_context *pipe,
 
 int r600_uvd_get_video_param(struct pipe_screen *screen,
                             enum pipe_video_profile profile,
+                            enum pipe_video_entrypoint entrypoint,
                             enum pipe_video_cap param);
 
 /*
index 8fb58614ad21f9f37b8492ce6361069fa23e509a..bfdc4f1e5f568409620b7cce1cd2f282d65cd90b 100644 (file)
@@ -174,6 +174,7 @@ struct pipe_video_codec *r600_uvd_create_decoder(struct pipe_context *context,
 
 int r600_uvd_get_video_param(struct pipe_screen *screen,
                             enum pipe_video_profile profile,
+                            enum pipe_video_entrypoint entrypoint,
                             enum pipe_video_cap param)
 {
        struct r600_screen *rscreen = (struct r600_screen *)screen;
@@ -194,5 +195,5 @@ int r600_uvd_get_video_param(struct pipe_screen *screen,
                }
        }
 
-       return ruvd_get_video_param(screen, profile, param);
+       return ruvd_get_video_param(screen, profile, entrypoint, param);
 }
index ed4e4fc8f3d6e2da3029ceeb1cb511a244ffa947..86f4c5592fb946a33297b93822e19df486f397d2 100644 (file)
@@ -1075,6 +1075,7 @@ void ruvd_set_dt_surfaces(struct ruvd_msg *msg, struct radeon_surface *luma,
 
 int ruvd_get_video_param(struct pipe_screen *screen,
                         enum pipe_video_profile profile,
+                        enum pipe_video_entrypoint entrypoint,
                         enum pipe_video_cap param)
 {
        switch (param) {
index 89a10c8fe9189a7a7e8136bd5d56bb7280d77d28..8c1ab79e1f8e86aca822301ddb6ba4e76d2e7d92 100644 (file)
@@ -363,6 +363,7 @@ void ruvd_set_dt_surfaces(struct ruvd_msg *msg, struct radeon_surface *luma,
 /* returns supported codecs and other parameters */
 int ruvd_get_video_param(struct pipe_screen *screen,
                         enum pipe_video_profile profile,
+                        enum pipe_video_entrypoint entrypoint,
                         enum pipe_video_cap param);
 
 /* the hardware only supports NV12 */
index b491672e128232dcae75958c95bca668a81436a0..4d2434839523fe5754fd1fed28814975b2f604fd 100644 (file)
@@ -540,11 +540,12 @@ static int r600_get_shader_param(struct pipe_screen* pscreen, unsigned shader, e
 
 static int r600_get_video_param(struct pipe_screen *screen,
                                enum pipe_video_profile profile,
+                               enum pipe_video_entrypoint entrypoint,
                                enum pipe_video_cap param)
 {
        switch (param) {
        case PIPE_VIDEO_CAP_SUPPORTED:
-               return vl_profile_supported(screen, profile);
+               return vl_profile_supported(screen, profile, entrypoint);
        case PIPE_VIDEO_CAP_NPOT_TEXTURES:
                return 1;
        case PIPE_VIDEO_CAP_MAX_WIDTH:
index f6acdc872d2477251441ea3dd410cb93989c22ab..4762ac312fffab411a22b9d594ed4f7ea230db27 100644 (file)
@@ -249,11 +249,12 @@ softpipe_get_paramf(struct pipe_screen *screen, enum pipe_capf param)
 static int
 softpipe_get_video_param(struct pipe_screen *screen,
                          enum pipe_video_profile profile,
+                        enum pipe_video_entrypoint entrypoint,
                          enum pipe_video_cap param)
 {
    switch (param) {
    case PIPE_VIDEO_CAP_SUPPORTED:
-       return vl_profile_supported(screen, profile);
+       return vl_profile_supported(screen, profile, entrypoint);
    case PIPE_VIDEO_CAP_NPOT_TEXTURES:
       return 0;
    case PIPE_VIDEO_CAP_MAX_WIDTH:
index c487e8ec8a408be9a3524346e108a14b12817237..f490736670666e9363406497c5be2a0125c35292 100644 (file)
@@ -94,6 +94,7 @@ struct pipe_screen {
     */
    int (*get_video_param)( struct pipe_screen *,
                           enum pipe_video_profile profile,
+                          enum pipe_video_entrypoint entrypoint,
                           enum pipe_video_cap param );
 
    /**
index 09927c564e857c84f8a5255c893f82bc23fd9ad5..f25a0eb8c49cedee3439d52b1e6912f60cbb0a3e 100644 (file)
@@ -76,6 +76,7 @@ vlVdpDecoderCreate(VdpDevice device,
    (
       screen,
       templat.profile,
+      PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
       PIPE_VIDEO_CAP_SUPPORTED
    );
    if (!supported) {
@@ -459,8 +460,10 @@ vlVdpDecoderRender(VdpDecoder decoder,
 
    pipe_mutex_lock(vlsurf->device->mutex);
 
-   buffer_support[0] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE);
-   buffer_support[1] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_SUPPORTS_INTERLACED);
+   buffer_support[0] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                               PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE);
+   buffer_support[1] = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                               PIPE_VIDEO_CAP_SUPPORTS_INTERLACED);
 
    if (vlsurf->video_buffer == NULL ||
        !screen->is_video_format_supported(screen, vlsurf->video_buffer->buffer_format, dec->profile) ||
@@ -471,10 +474,12 @@ vlVdpDecoderRender(VdpDecoder decoder,
          vlsurf->video_buffer->destroy(vlsurf->video_buffer);
 
       /* set the buffer format to the prefered one */
-      vlsurf->templat.buffer_format = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_PREFERED_FORMAT);
+      vlsurf->templat.buffer_format = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                                              PIPE_VIDEO_CAP_PREFERED_FORMAT);
 
       /* also set interlacing to decoders preferences */
-      vlsurf->templat.interlaced = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_CAP_PREFERS_INTERLACED);
+      vlsurf->templat.interlaced = screen->get_video_param(screen, dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                                           PIPE_VIDEO_CAP_PREFERS_INTERLACED);
 
       /* and recreate the video buffer */
       vlsurf->video_buffer = dec->context->create_video_buffer(dec->context, &vlsurf->templat);
index 26db5c8bd8b3eb557e2ec6c13fbb8eb585bc1471..18439a78f4abe71c7fdb833b3d1715d8d6eb0566 100644 (file)
@@ -132,8 +132,8 @@ vlVdpVideoMixerCreate(VdpDevice device,
       VDPAU_MSG(VDPAU_WARN, "[VDPAU] Max layers > 4 not supported\n", vmixer->max_layers);
       goto no_params;
    }
-   max_width = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_WIDTH);
-   max_height = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_HEIGHT);
+   max_width = screen->get_video_param(screen, prof, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_MAX_WIDTH);
+   max_height = screen->get_video_param(screen, prof, PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_MAX_HEIGHT);
    if (vmixer->video_width < 48 ||
        vmixer->video_width > max_width) {
       VDPAU_MSG(VDPAU_WARN, "[VDPAU] 48 < %u < %u not valid for width\n", vmixer->video_width, max_width);
index a6b34c719b71e7b5c8a512c821c381f48aa6b731..fff7d6ba55bee1d49bdb46e3f4c5cf0b1d1469a3 100644 (file)
@@ -178,11 +178,15 @@ vlVdpDecoderQueryCapabilities(VdpDevice device, VdpDecoderProfile profile,
    }
 
    pipe_mutex_lock(dev->mutex);
-   *is_supported = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_SUPPORTED);
+   *is_supported = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                            PIPE_VIDEO_CAP_SUPPORTED);
    if (*is_supported) {
-      *max_width = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_MAX_WIDTH); 
-      *max_height = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_MAX_HEIGHT);
-      *max_level = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_CAP_MAX_LEVEL);
+      *max_width = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                            PIPE_VIDEO_CAP_MAX_WIDTH);
+      *max_height = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                             PIPE_VIDEO_CAP_MAX_HEIGHT);
+      *max_level = pscreen->get_video_param(pscreen, p_profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                            PIPE_VIDEO_CAP_MAX_LEVEL);
       *max_macroblocks = (*max_width/16)*(*max_height/16);
    } else {
       *max_width = 0;
@@ -512,11 +516,13 @@ vlVdpVideoMixerQueryParameterValueRange(VdpDevice device, VdpVideoMixerParameter
    switch (parameter) {
    case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_WIDTH:
       *(uint32_t*)min_value = 48;
-      *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_WIDTH);
+      *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                                      PIPE_VIDEO_CAP_MAX_WIDTH);
       break;
    case VDP_VIDEO_MIXER_PARAMETER_VIDEO_SURFACE_HEIGHT:
       *(uint32_t*)min_value = 48;
-      *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_CAP_MAX_HEIGHT);
+      *(uint32_t*)max_value = screen->get_video_param(screen, prof, PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
+                                                      PIPE_VIDEO_CAP_MAX_HEIGHT);
       break;
 
    case VDP_VIDEO_MIXER_PARAMETER_LAYERS:
index bd11fc3cdecb7d58e548227397328613b89bc15d..a26f9b6bb496b04c4bbd36d7b86e69533bd36e14 100644 (file)
@@ -75,6 +75,7 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
    (
       pipe->screen,
       PIPE_VIDEO_PROFILE_UNKNOWN,
+      PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
       PIPE_VIDEO_CAP_PREFERED_FORMAT
    );
    p_surf->templat.chroma_format = ChromaToPipe(chroma_type);
@@ -84,6 +85,7 @@ vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
    (
       pipe->screen,
       PIPE_VIDEO_PROFILE_UNKNOWN,
+      PIPE_VIDEO_ENTRYPOINT_BITSTREAM,
       PIPE_VIDEO_CAP_PREFERS_INTERLACED
    );
    p_surf->video_buffer = pipe->create_video_buffer(pipe, &p_surf->templat);
index 51fcf78e8f1702472fa3ecf6421b843c9da81df9..e38f6f7c7f85f415320382ff6fa260b0a21d9a84 100644 (file)
@@ -227,6 +227,7 @@ Status XvMCCreateSubpicture(Display *dpy, XvMCContext *context, XvMCSubpicture *
    tex_templ.last_level = 0;
    if (pipe->screen->get_video_param(pipe->screen,
                                      PIPE_VIDEO_PROFILE_UNKNOWN,
+                                     PIPE_VIDEO_ENTRYPOINT_UNKNOWN,
                                      PIPE_VIDEO_CAP_NPOT_TEXTURES)) {
       tex_templ.width0 = width;
       tex_templ.height0 = height;
index db32142a7e65aee1d69cd8d616db48380ecac5f3..2e67612f690ec4a620cfaf89920102fab82d34b3 100644 (file)
@@ -177,7 +177,8 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac
    tmpl.buffer_format = pipe->screen->get_video_param
    (
       pipe->screen,
-      PIPE_VIDEO_PROFILE_MPEG2_MAIN,
+      context_priv->decoder->profile,
+      context_priv->decoder->entrypoint,
       PIPE_VIDEO_CAP_PREFERED_FORMAT
    );
    tmpl.chroma_format = context_priv->decoder->chroma_format;
@@ -186,7 +187,8 @@ Status XvMCCreateSurface(Display *dpy, XvMCContext *context, XvMCSurface *surfac
    tmpl.interlaced = pipe->screen->get_video_param
    (
       pipe->screen,
-      PIPE_VIDEO_PROFILE_MPEG2_MAIN,
+      context_priv->decoder->profile,
+      context_priv->decoder->entrypoint,
       PIPE_VIDEO_CAP_PREFERS_INTERLACED
    );