summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThong Thai <[email protected]>2019-12-18 11:26:34 -0500
committerMarge Bot <[email protected]>2020-01-03 16:30:22 +0000
commitf3569f215d0f46006ce34485d526c5ad56c463bb (patch)
tree8cf567d13a59fed5c1ebc83d2faf6257a7943179 /src
parentee8344bdcffe7035daa775344c0797d19cc60648 (diff)
gallium: Add PIPE_FORMAT_P010 support
Signed-off-by: Thong Thai <[email protected]> Reviewed-by: Leo Liu <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3153>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/vl/vl_video_buffer.c1
-rw-r--r--src/gallium/include/pipe/p_format.h1
-rw-r--r--src/gallium/state_trackers/va/va_private.h3
-rw-r--r--src/mesa/state_tracker/st_atom_sampler.c1
-rw-r--r--src/mesa/state_tracker/st_atom_texture.c1
-rw-r--r--src/mesa/state_tracker/st_program.h1
-rw-r--r--src/mesa/state_tracker/st_sampler_view.c1
7 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/vl/vl_video_buffer.c b/src/gallium/auxiliary/vl/vl_video_buffer.c
index 25322242b52..bcb19fdad2a 100644
--- a/src/gallium/auxiliary/vl/vl_video_buffer.c
+++ b/src/gallium/auxiliary/vl/vl_video_buffer.c
@@ -80,6 +80,7 @@ vl_video_buffer_plane_order(enum pipe_format format)
case PIPE_FORMAT_B8G8R8A8_UNORM:
case PIPE_FORMAT_YUYV:
case PIPE_FORMAT_UYVY:
+ case PIPE_FORMAT_P010:
case PIPE_FORMAT_P016:
return const_resource_plane_order_YUV;
diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h
index c1e8bc0f0d7..46bb8c97a00 100644
--- a/src/gallium/include/pipe/p_format.h
+++ b/src/gallium/include/pipe/p_format.h
@@ -450,6 +450,7 @@ enum pipe_format {
PIPE_FORMAT_FXT1_RGB,
PIPE_FORMAT_FXT1_RGBA,
+ PIPE_FORMAT_P010,
PIPE_FORMAT_P016,
PIPE_FORMAT_R10G10B10X2_UNORM,
diff --git a/src/gallium/state_trackers/va/va_private.h b/src/gallium/state_trackers/va/va_private.h
index b2b997d4799..bed1189b9d1 100644
--- a/src/gallium/state_trackers/va/va_private.h
+++ b/src/gallium/state_trackers/va/va_private.h
@@ -96,6 +96,7 @@ VaFourccToPipeFormat(unsigned format)
case VA_FOURCC('N','V','1','2'):
return PIPE_FORMAT_NV12;
case VA_FOURCC('P','0','1','0'):
+ return PIPE_FORMAT_P010;
case VA_FOURCC('P','0','1','6'):
return PIPE_FORMAT_P016;
case VA_FOURCC('I','4','2','0'):
@@ -126,6 +127,8 @@ PipeFormatToVaFourcc(enum pipe_format p_format)
switch (p_format) {
case PIPE_FORMAT_NV12:
return VA_FOURCC('N','V','1','2');
+ case PIPE_FORMAT_P010:
+ return VA_FOURCC('P','0','1','0');
case PIPE_FORMAT_P016:
return VA_FOURCC('P','0','1','6');
case PIPE_FORMAT_IYUV:
diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c
index 86113c93c49..c0f43befa4d 100644
--- a/src/mesa/state_tracker/st_atom_sampler.c
+++ b/src/mesa/state_tracker/st_atom_sampler.c
@@ -309,6 +309,7 @@ update_shader_samplers(struct st_context *st,
switch (st_get_view_format(stObj)) {
case PIPE_FORMAT_NV12:
+ case PIPE_FORMAT_P010:
case PIPE_FORMAT_P016:
case PIPE_FORMAT_YUYV:
case PIPE_FORMAT_UYVY:
diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c
index 070e5609157..ef54bc5a77f 100644
--- a/src/mesa/state_tracker/st_atom_texture.c
+++ b/src/mesa/state_tracker/st_atom_texture.c
@@ -191,6 +191,7 @@ update_textures(struct st_context *st,
sampler_views[extra] =
st->pipe->create_sampler_view(st->pipe, stObj->pt->next, &tmpl);
break;
+ case PIPE_FORMAT_P010:
case PIPE_FORMAT_P016:
/* we need one additional R16G16 view: */
tmpl.format = PIPE_FORMAT_RG1616_UNORM;
diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h
index e5c6ac0a96a..69ad595143f 100644
--- a/src/mesa/state_tracker/st_program.h
+++ b/src/mesa/state_tracker/st_program.h
@@ -74,6 +74,7 @@ st_get_external_sampler_key(struct st_context *st, struct gl_program *prog)
switch (st_get_view_format(stObj)) {
case PIPE_FORMAT_NV12:
+ case PIPE_FORMAT_P010:
case PIPE_FORMAT_P016:
key.lower_nv12 |= (1 << unit);
break;
diff --git a/src/mesa/state_tracker/st_sampler_view.c b/src/mesa/state_tracker/st_sampler_view.c
index ed84b093266..8c0277fe42a 100644
--- a/src/mesa/state_tracker/st_sampler_view.c
+++ b/src/mesa/state_tracker/st_sampler_view.c
@@ -495,6 +495,7 @@ get_sampler_view_format(struct st_context *st,
case PIPE_FORMAT_IYUV:
format = PIPE_FORMAT_R8_UNORM;
break;
+ case PIPE_FORMAT_P010:
case PIPE_FORMAT_P016:
format = PIPE_FORMAT_R16_UNORM;
break;