/* Create pipe_video_buffer by using resource_create with planar formats. */
struct pipe_video_buffer *
vl_video_buffer_create_as_resource(struct pipe_context *pipe,
- const struct pipe_video_buffer *tmpl)
+ const struct pipe_video_buffer *tmpl,
+ const uint64_t *modifiers,
+ int modifiers_count)
{
struct pipe_resource templ, *resources[VL_NUM_COMPONENTS] = {0};
unsigned array_size = tmpl->interlaced ? 2 : 1;
else
templ.format = tmpl->buffer_format;
- resources[0] = pipe->screen->resource_create(pipe->screen, &templ);
+ if (modifiers)
+ resources[0] = pipe->screen->resource_create_with_modifiers(pipe->screen,
+ &templ, modifiers,
+ modifiers_count);
+ else
+ resources[0] = pipe->screen->resource_create(pipe->screen, &templ);
if (!resources[0])
return NULL;
/* Create pipe_video_buffer by using resource_create with planar formats. */
struct pipe_video_buffer *
vl_video_buffer_create_as_resource(struct pipe_context *pipe,
- const struct pipe_video_buffer *tmpl);
+ const struct pipe_video_buffer *tmpl,
+ const uint64_t *modifiers,
+ int modifiers_count);
#endif /* vl_video_buffer_h */
*
**************************************************************************/
+#include "drm-uapi/drm_fourcc.h"
#include "radeon/radeon_uvd.h"
#include "radeon/radeon_uvd_enc.h"
#include "radeon/radeon_vce.h"
const struct pipe_video_buffer *tmpl)
{
struct pipe_video_buffer vidbuf = *tmpl;
+ uint64_t *modifiers = NULL;
+ int modifiers_count = 0;
+ uint64_t mod = DRM_FORMAT_MOD_LINEAR;
+
/* TODO: get tiling working */
vidbuf.bind |= PIPE_BIND_LINEAR;
- return vl_video_buffer_create_as_resource(pipe, &vidbuf);
+ if (pipe->screen->resource_create_with_modifiers) {
+ modifiers = &mod;
+ modifiers_count = 1;
+ }
+
+ return vl_video_buffer_create_as_resource(pipe, &vidbuf, modifiers,
+ modifiers_count);
}
/* set the decoding target buffer offsets */