[Mesa-dev] [PATCH 5/5] vl: add entrypoint to is_video_format_supported

Christian König deathsimple at vodafone.de
Fri Aug 16 02:08:04 PDT 2013


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

Signed-off-by: Christian König <christian.koenig at amd.com>
---
 src/gallium/auxiliary/vl/vl_video_buffer.c      |    3 ++-
 src/gallium/auxiliary/vl/vl_video_buffer.h      |    3 ++-
 src/gallium/drivers/ilo/ilo_format.c            |    5 +++--
 src/gallium/drivers/nouveau/nouveau_vp3_video.c |    5 +++--
 src/gallium/drivers/nouveau/nouveau_vp3_video.h |    3 ++-
 src/gallium/drivers/nv50/nv50_context.h         |    3 ++-
 src/gallium/drivers/nv50/nv84_video.c           |    5 +++--
 src/gallium/drivers/radeon/radeon_uvd.c         |    3 ++-
 src/gallium/drivers/radeon/radeon_uvd.h         |    3 ++-
 src/gallium/include/pipe/p_screen.h             |    3 ++-
 src/gallium/state_trackers/vdpau/decode.c       |    3 ++-
 src/gallium/state_trackers/vdpau/query.c        |    6 ++++--
 12 files changed, 29 insertions(+), 16 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c
index d81c181..f0ba389 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.c
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
@@ -147,7 +147,8 @@ vl_video_buffer_surface_format(enum pipe_format format)
 boolean
 vl_video_buffer_is_format_supported(struct pipe_screen *screen,
                                     enum pipe_format format,
-                                    enum pipe_video_profile profile)
+                                    enum pipe_video_profile profile,
+                                    enum pipe_video_entrypoint entrypoint)
 {
    const enum pipe_format *resource_formats;
    unsigned i;
diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.h b/src/gallium/auxiliary/vl/vl_video_buffer.h
index e92e270..b936a37 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.h
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.h
@@ -73,7 +73,8 @@ vl_video_buffer_max_size(struct pipe_screen *screen);
 boolean
 vl_video_buffer_is_format_supported(struct pipe_screen *screen,
                                     enum pipe_format format,
-                                    enum pipe_video_profile profile);
+                                    enum pipe_video_profile profile,
+                                    enum pipe_video_entrypoint entrypoint);
 
 /*
  * set the associated data for the given video buffer
diff --git a/src/gallium/drivers/ilo/ilo_format.c b/src/gallium/drivers/ilo/ilo_format.c
index 65fb820..40b5ffa 100644
--- a/src/gallium/drivers/ilo/ilo_format.c
+++ b/src/gallium/drivers/ilo/ilo_format.c
@@ -671,9 +671,10 @@ ilo_is_format_supported(struct pipe_screen *screen,
 static boolean
 ilo_is_video_format_supported(struct pipe_screen *screen,
                               enum pipe_format format,
-                              enum pipe_video_profile profile)
+                              enum pipe_video_profile profile,
+                              enum pipe_video_entrypoint entrypoint)
 {
-   return vl_video_buffer_is_format_supported(screen, format, profile);
+   return vl_video_buffer_is_format_supported(screen, format, profile, entrypoint);
 }
 
 /**
diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.c b/src/gallium/drivers/nouveau/nouveau_vp3_video.c
index 1659c5f..07ce016 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video.c
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.c
@@ -416,10 +416,11 @@ nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen,
 boolean
 nouveau_vp3_screen_video_supported(struct pipe_screen *screen,
                                    enum pipe_format format,
-                                   enum pipe_video_profile profile)
+                                   enum pipe_video_profile profile,
+                                   enum pipe_video_entrypoint entrypoint)
 {
    if (profile != PIPE_VIDEO_PROFILE_UNKNOWN)
       return format == PIPE_FORMAT_NV12;
 
-   return vl_video_buffer_is_format_supported(screen, format, profile);
+   return vl_video_buffer_is_format_supported(screen, format, profile, entrypoint);
 }
diff --git a/src/gallium/drivers/nouveau/nouveau_vp3_video.h b/src/gallium/drivers/nouveau/nouveau_vp3_video.h
index 8aedfd0..0193ed0 100644
--- a/src/gallium/drivers/nouveau/nouveau_vp3_video.h
+++ b/src/gallium/drivers/nouveau/nouveau_vp3_video.h
@@ -226,4 +226,5 @@ nouveau_vp3_screen_get_video_param(struct pipe_screen *pscreen,
 boolean
 nouveau_vp3_screen_video_supported(struct pipe_screen *screen,
                                    enum pipe_format format,
-                                   enum pipe_video_profile profile);
+                                   enum pipe_video_profile profile,
+                                   enum pipe_video_entrypoint entrypoint);
diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h
index 3600f70..ed4ef24 100644
--- a/src/gallium/drivers/nv50/nv50_context.h
+++ b/src/gallium/drivers/nv50/nv50_context.h
@@ -307,7 +307,8 @@ nv84_screen_get_video_param(struct pipe_screen *pscreen,
 boolean
 nv84_screen_video_supported(struct pipe_screen *screen,
                             enum pipe_format format,
-                            enum pipe_video_profile profile);
+                            enum pipe_video_profile profile,
+                            enum pipe_video_entrypoint entrypoint);
 
 /* nv98_video.c */
 struct pipe_video_codec *
diff --git a/src/gallium/drivers/nv50/nv84_video.c b/src/gallium/drivers/nv50/nv84_video.c
index 503d79c..4055c45 100644
--- a/src/gallium/drivers/nv50/nv84_video.c
+++ b/src/gallium/drivers/nv50/nv84_video.c
@@ -791,10 +791,11 @@ nv84_screen_get_video_param(struct pipe_screen *pscreen,
 boolean
 nv84_screen_video_supported(struct pipe_screen *screen,
                             enum pipe_format format,
-                            enum pipe_video_profile profile)
+                            enum pipe_video_profile profile,
+                            enum pipe_video_entrypoint entrypoint)
 {
    if (profile != PIPE_VIDEO_PROFILE_UNKNOWN)
       return format == PIPE_FORMAT_NV12;
 
-   return vl_video_buffer_is_format_supported(screen, format, profile);
+   return vl_video_buffer_is_format_supported(screen, format, profile, entrypoint);
 }
diff --git a/src/gallium/drivers/radeon/radeon_uvd.c b/src/gallium/drivers/radeon/radeon_uvd.c
index 86f4c55..f3652a6 100644
--- a/src/gallium/drivers/radeon/radeon_uvd.c
+++ b/src/gallium/drivers/radeon/radeon_uvd.c
@@ -1134,7 +1134,8 @@ int ruvd_get_video_param(struct pipe_screen *screen,
 
 boolean ruvd_is_format_supported(struct pipe_screen *screen,
 				 enum pipe_format format,
-				 enum pipe_video_profile profile)
+				 enum pipe_video_profile profile,
+				 enum pipe_video_entrypoint entrypoint)
 {
 	/* we can only handle this one anyway */
 	return format == PIPE_FORMAT_NV12;
diff --git a/src/gallium/drivers/radeon/radeon_uvd.h b/src/gallium/drivers/radeon/radeon_uvd.h
index 8c1ab79..dedb3c7 100644
--- a/src/gallium/drivers/radeon/radeon_uvd.h
+++ b/src/gallium/drivers/radeon/radeon_uvd.h
@@ -369,6 +369,7 @@ int ruvd_get_video_param(struct pipe_screen *screen,
 /* the hardware only supports NV12 */
 boolean ruvd_is_format_supported(struct pipe_screen *screen,
 				 enum pipe_format format,
-				 enum pipe_video_profile profile);
+				 enum pipe_video_profile profile,
+				 enum pipe_video_entrypoint entrypoint);
 
 #endif
diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h
index f490736..3ed7f26 100644
--- a/src/gallium/include/pipe/p_screen.h
+++ b/src/gallium/include/pipe/p_screen.h
@@ -136,7 +136,8 @@ struct pipe_screen {
     */
    boolean (*is_video_format_supported)( struct pipe_screen *,
                                          enum pipe_format format,
-                                         enum pipe_video_profile profile );
+                                         enum pipe_video_profile profile,
+                                         enum pipe_video_entrypoint entrypoint );
 
    /**
     * Check if we can actually create the given resource (test the dimension,
diff --git a/src/gallium/state_trackers/vdpau/decode.c b/src/gallium/state_trackers/vdpau/decode.c
index f25a0eb..684ded8 100644
--- a/src/gallium/state_trackers/vdpau/decode.c
+++ b/src/gallium/state_trackers/vdpau/decode.c
@@ -466,7 +466,8 @@ vlVdpDecoderRender(VdpDecoder decoder,
                                                PIPE_VIDEO_CAP_SUPPORTS_INTERLACED);
 
    if (vlsurf->video_buffer == NULL ||
-       !screen->is_video_format_supported(screen, vlsurf->video_buffer->buffer_format, dec->profile) ||
+       !screen->is_video_format_supported(screen, vlsurf->video_buffer->buffer_format,
+                                          dec->profile, PIPE_VIDEO_ENTRYPOINT_BITSTREAM) ||
        !buffer_support[vlsurf->video_buffer->interlaced]) {
 
       /* destroy the old one */
diff --git a/src/gallium/state_trackers/vdpau/query.c b/src/gallium/state_trackers/vdpau/query.c
index fff7d6b..8c1b27f 100644
--- a/src/gallium/state_trackers/vdpau/query.c
+++ b/src/gallium/state_trackers/vdpau/query.c
@@ -141,7 +141,8 @@ vlVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities(VdpDevice device, VdpChromaTyp
    (
       pscreen,
       FormatYCBCRToPipe(bits_ycbcr_format),
-      PIPE_VIDEO_PROFILE_UNKNOWN
+      PIPE_VIDEO_PROFILE_UNKNOWN,
+      PIPE_VIDEO_ENTRYPOINT_BITSTREAM
    );
    pipe_mutex_unlock(dev->mutex);
 
@@ -391,7 +392,8 @@ vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities(VdpDevice device, VdpRGBAFormat
    *is_supported &= pscreen->is_video_format_supported
    (
       pscreen, ycbcr_format,
-      PIPE_VIDEO_PROFILE_UNKNOWN
+      PIPE_VIDEO_PROFILE_UNKNOWN,
+      PIPE_VIDEO_ENTRYPOINT_BITSTREAM
    );
    pipe_mutex_unlock(dev->mutex);
 
-- 
1.7.9.5



More information about the mesa-dev mailing list