summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau
diff options
context:
space:
mode:
authorChristian König <[email protected]>2015-06-29 10:19:36 +0200
committerChristian König <[email protected]>2015-07-09 10:44:04 +0200
commit2cfa64e159a68998b76bdbcd20f8c7810379fce0 (patch)
tree65a64801d6c54dac31be1afadd89e1333b9549b1 /src/gallium/state_trackers/vdpau
parentbbfdf5c17b695c31915e293e1ec858cbcb340894 (diff)
st/vdpau: fix mixer size checks
We need to check what the 3D pipe is able to handle for the mixer, not what the decoder is able to decode. This fixes output of resolutions like 720x1280. Signed-off-by: Christian König <[email protected]> CC: [email protected]
Diffstat (limited to 'src/gallium/state_trackers/vdpau')
-rw-r--r--src/gallium/state_trackers/vdpau/mixer.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gallium/state_trackers/vdpau/mixer.c b/src/gallium/state_trackers/vdpau/mixer.c
index 4118eb86997..c0b1ecc55fa 100644
--- a/src/gallium/state_trackers/vdpau/mixer.c
+++ b/src/gallium/state_trackers/vdpau/mixer.c
@@ -49,7 +49,8 @@ vlVdpVideoMixerCreate(VdpDevice device,
vlVdpVideoMixer *vmixer = NULL;
VdpStatus ret;
struct pipe_screen *screen;
- unsigned max_width, max_height, i;
+ uint32_t max_2d_texture_level;
+ unsigned max_size, i;
vlVdpDevice *dev = vlGetDataHTAB(device);
if (!dev)
@@ -134,18 +135,17 @@ 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, PIPE_VIDEO_PROFILE_UNKNOWN,
- PIPE_VIDEO_ENTRYPOINT_BITSTREAM, PIPE_VIDEO_CAP_MAX_WIDTH);
- max_height = screen->get_video_param(screen, PIPE_VIDEO_PROFILE_UNKNOWN,
- 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);
+
+ max_2d_texture_level = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
+ max_size = pow(2, max_2d_texture_level-1);
+ if (vmixer->video_width < 48 || vmixer->video_width > max_size) {
+ VDPAU_MSG(VDPAU_WARN, "[VDPAU] 48 < %u < %u not valid for width\n",
+ vmixer->video_width, max_size);
goto no_params;
}
- if (vmixer->video_height < 48 ||
- vmixer->video_height > max_height) {
- VDPAU_MSG(VDPAU_WARN, "[VDPAU] 48 < %u < %u not valid for height\n", vmixer->video_height, max_height);
+ if (vmixer->video_height < 48 || vmixer->video_height > max_size) {
+ VDPAU_MSG(VDPAU_WARN, "[VDPAU] 48 < %u < %u not valid for height\n",
+ vmixer->video_height, max_size);
goto no_params;
}
vmixer->luma_key_min = 0.f;