[Mesa-dev] [PATCH 04/11] vl: add interlacing capabilities

Christian König deathsimple at vodafone.de
Wed Feb 1 15:19:57 PST 2012


Let the driver control interlaced or progressive
format of video buffers.

Signed-off-by: Christian König <deathsimple at vodafone.de>
---
 src/gallium/drivers/nouveau/nouveau_video.c |    6 ++++++
 src/gallium/drivers/nvfx/nvfx_screen.c      |    6 ++++++
 src/gallium/drivers/r300/r300_screen.c      |    6 ++++++
 src/gallium/drivers/r600/r600_pipe.c        |    6 ++++++
 src/gallium/drivers/softpipe/sp_screen.c    |    6 ++++++
 src/gallium/include/pipe/p_video_enums.h    |    5 ++++-
 6 files changed, 34 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/nouveau/nouveau_video.c b/src/gallium/drivers/nouveau/nouveau_video.c
index 47d332a..cfbf857 100644
--- a/src/gallium/drivers/nouveau/nouveau_video.c
+++ b/src/gallium/drivers/nouveau/nouveau_video.c
@@ -837,6 +837,12 @@ nouveau_screen_get_video_param(struct pipe_screen *pscreen,
       return vl_video_buffer_max_size(pscreen);
    case PIPE_VIDEO_CAP_PREFERED_FORMAT:
       return PIPE_FORMAT_NV12;
+   case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
+      return false;
+   case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
+      return false;
+   case PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE:
+      return true;
    default:
       debug_printf("unknown video param: %d\n", param);
       return 0;
diff --git a/src/gallium/drivers/nvfx/nvfx_screen.c b/src/gallium/drivers/nvfx/nvfx_screen.c
index 623903a..ba1a242 100644
--- a/src/gallium/drivers/nvfx/nvfx_screen.c
+++ b/src/gallium/drivers/nvfx/nvfx_screen.c
@@ -236,6 +236,12 @@ nvfx_screen_get_video_param(struct pipe_screen *screen,
 		return vl_video_buffer_max_size(screen);
 	case PIPE_VIDEO_CAP_PREFERED_FORMAT:
 		return PIPE_FORMAT_NV12;
+	case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
+		return false;
+	case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
+		return false;
+	case PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE:
+		return true;
 	default:
 		return 0;
 	}
diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c
index 9a9418b..eb233a0 100644
--- a/src/gallium/drivers/r300/r300_screen.c
+++ b/src/gallium/drivers/r300/r300_screen.c
@@ -314,6 +314,12 @@ static int r300_get_video_param(struct pipe_screen *screen,
          return vl_video_buffer_max_size(screen);
       case PIPE_VIDEO_CAP_PREFERED_FORMAT:
          return PIPE_FORMAT_NV12;
+      case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
+         return false;
+      case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
+         return false;
+      case PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE:
+         return true;
       default:
          return 0;
    }
diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c
index 351ecfe..140ae11 100644
--- a/src/gallium/drivers/r600/r600_pipe.c
+++ b/src/gallium/drivers/r600/r600_pipe.c
@@ -535,6 +535,12 @@ static int r600_get_video_param(struct pipe_screen *screen,
 		return vl_video_buffer_max_size(screen);
 	case PIPE_VIDEO_CAP_PREFERED_FORMAT:
 		return PIPE_FORMAT_NV12;
+	case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
+		return false;
+	case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
+		return false;
+	case PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE:
+		return true;
 	default:
 		return 0;
 	}
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index 6cafeaf..6d61d00 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -209,6 +209,12 @@ softpipe_get_video_param(struct pipe_screen *screen,
       return vl_video_buffer_max_size(screen);
    case PIPE_VIDEO_CAP_PREFERED_FORMAT:
       return PIPE_FORMAT_NV12;
+   case PIPE_VIDEO_CAP_PREFERS_INTERLACED:
+      return false;
+   case PIPE_VIDEO_CAP_SUPPORTS_INTERLACED:
+      return false;
+   case PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE:
+      return true;
    default:
       return 0;
    }
diff --git a/src/gallium/include/pipe/p_video_enums.h b/src/gallium/include/pipe/p_video_enums.h
index 3b61601..deacf8d 100644
--- a/src/gallium/include/pipe/p_video_enums.h
+++ b/src/gallium/include/pipe/p_video_enums.h
@@ -51,7 +51,10 @@ enum pipe_video_cap
    PIPE_VIDEO_CAP_NPOT_TEXTURES = 1,
    PIPE_VIDEO_CAP_MAX_WIDTH = 2,
    PIPE_VIDEO_CAP_MAX_HEIGHT = 3,
-   PIPE_VIDEO_CAP_PREFERED_FORMAT = 4
+   PIPE_VIDEO_CAP_PREFERED_FORMAT = 4,
+   PIPE_VIDEO_CAP_PREFERS_INTERLACED = 5,
+   PIPE_VIDEO_CAP_SUPPORTS_PROGRESSIVE = 6,
+   PIPE_VIDEO_CAP_SUPPORTS_INTERLACED = 7
 };
 
 enum pipe_video_codec
-- 
1.7.5.4



More information about the mesa-dev mailing list