projects
/
mesa.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
freedreno/ir3: consider instruction neighbors in cp
[mesa.git]
/
src
/
gallium
/
drivers
/
nouveau
/
nouveau_video.c
diff --git
a/src/gallium/drivers/nouveau/nouveau_video.c
b/src/gallium/drivers/nouveau/nouveau_video.c
index 9cf5e349bd7016d2d945cf3b780b4a086e6701a4..d6330fa63a8b2cd644da4c56fd98ed2357d5d15e 100644
(file)
--- a/
src/gallium/drivers/nouveau/nouveau_video.c
+++ b/
src/gallium/drivers/nouveau/nouveau_video.c
@@
-27,7
+27,7
@@
#include "nouveau_context.h"
#include "nouveau_video.h"
#include "nouveau_context.h"
#include "nouveau_video.h"
-#include "nouveau
/nouveau
_buffer.h"
+#include "nouveau_buffer.h"
#include "util/u_video.h"
#include "util/u_format.h"
#include "util/u_sampler.h"
#include "util/u_video.h"
#include "util/u_format.h"
#include "util/u_sampler.h"
@@
-381,8
+381,6
@@
nouveau_decoder_surface_index(struct nouveau_decoder *dec,
unsigned i;
unsigned i;
- if (!buf)
- return 8;
for (i = 0; i < dec->num_surfaces; ++i) {
if (dec->surfaces[i] == buf)
return i;
for (i = 0; i < dec->num_surfaces; ++i) {
if (dec->surfaces[i] == buf)
return i;
@@
-403,14
+401,14
@@
nouveau_decoder_surface_index(struct nouveau_decoder *dec,
}
static void
}
static void
-nouveau_decoder_begin_frame(struct pipe_video_
decoder
*decoder,
+nouveau_decoder_begin_frame(struct pipe_video_
codec
*decoder,
struct pipe_video_buffer *target,
struct pipe_picture_desc *picture)
{
}
static void
struct pipe_video_buffer *target,
struct pipe_picture_desc *picture)
{
}
static void
-nouveau_decoder_decode_macroblock(struct pipe_video_
decoder
*decoder,
+nouveau_decoder_decode_macroblock(struct pipe_video_
codec
*decoder,
struct pipe_video_buffer *target,
struct pipe_picture_desc *picture,
const struct pipe_macroblock *pipe_mb,
struct pipe_video_buffer *target,
struct pipe_picture_desc *picture,
const struct pipe_macroblock *pipe_mb,
@@
-457,14
+455,14
@@
nouveau_decoder_decode_macroblock(struct pipe_video_decoder *decoder,
}
static void
}
static void
-nouveau_decoder_end_frame(struct pipe_video_
decoder
*decoder,
+nouveau_decoder_end_frame(struct pipe_video_
codec
*decoder,
struct pipe_video_buffer *target,
struct pipe_picture_desc *picture)
{
}
static void
struct pipe_video_buffer *target,
struct pipe_picture_desc *picture)
{
}
static void
-nouveau_decoder_flush(struct pipe_video_
decoder
*decoder)
+nouveau_decoder_flush(struct pipe_video_
codec
*decoder)
{
struct nouveau_decoder *dec = (struct nouveau_decoder *)decoder;
if (dec->ofs)
{
struct nouveau_decoder *dec = (struct nouveau_decoder *)decoder;
if (dec->ofs)
@@
-472,7
+470,7
@@
nouveau_decoder_flush(struct pipe_video_decoder *decoder)
}
static void
}
static void
-nouveau_decoder_destroy(struct pipe_video_
decoder
*decoder)
+nouveau_decoder_destroy(struct pipe_video_
codec
*decoder)
{
struct nouveau_decoder *dec = (struct nouveau_decoder*)decoder;
{
struct nouveau_decoder *dec = (struct nouveau_decoder*)decoder;
@@
-497,9
+495,9
@@
nouveau_decoder_destroy(struct pipe_video_decoder *decoder)
FREE(dec);
}
FREE(dec);
}
-static struct pipe_video_
decoder
*
+static struct pipe_video_
codec
*
nouveau_create_decoder(struct pipe_context *context,
nouveau_create_decoder(struct pipe_context *context,
- const struct pipe_video_
decoder
*templ,
+ const struct pipe_video_
codec
*templ,
struct nouveau_screen *screen)
{
struct nv04_fifo nv04_data = { .vram = 0xbeef0201, .gart = 0xbeef0202 };
struct nouveau_screen *screen)
{
struct nv04_fifo nv04_data = { .vram = 0xbeef0201, .gart = 0xbeef0202 };
@@
-519,7
+517,7
@@
nouveau_create_decoder(struct pipe_context *context,
goto vl;
if (screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0)
goto vl;
goto vl;
if (screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0)
goto vl;
- if (screen->device->chipset < 0x
31 || screen->device->chipset == 0x35
)
+ if (screen->device->chipset < 0x
40
)
goto vl;
dec = CALLOC_STRUCT(nouveau_decoder);
goto vl;
dec = CALLOC_STRUCT(nouveau_decoder);
@@
-553,7
+551,7
@@
nouveau_create_decoder(struct pipe_context *context,
&mpeg);
if (ret < 0) {
debug_printf("Creation failed: %s (%i)\n", strerror(-ret), ret);
&mpeg);
if (ret < 0) {
debug_printf("Creation failed: %s (%i)\n", strerror(-ret), ret);
-
return NULL
;
+
goto fail
;
}
dec->mpeg = mpeg;
}
dec->mpeg = mpeg;
@@
-611,7
+609,6
@@
nouveau_create_decoder(struct pipe_context *context,
BEGIN_NV04(push, NV31_MPEG(FORMAT), 2);
PUSH_DATA (push, 0);
switch (templ->entrypoint) {
BEGIN_NV04(push, NV31_MPEG(FORMAT), 2);
PUSH_DATA (push, 0);
switch (templ->entrypoint) {
- case PIPE_VIDEO_ENTRYPOINT_BITSTREAM: PUSH_DATA (push, 0x100); break;
case PIPE_VIDEO_ENTRYPOINT_IDCT: PUSH_DATA (push, 1); break;
case PIPE_VIDEO_ENTRYPOINT_MC: PUSH_DATA (push, 0); break;
default: assert(0);
case PIPE_VIDEO_ENTRYPOINT_IDCT: PUSH_DATA (push, 1); break;
case PIPE_VIDEO_ENTRYPOINT_MC: PUSH_DATA (push, 0); break;
default: assert(0);
@@
-782,7
+779,7
@@
nouveau_video_buffer_create(struct pipe_context *pipe,
*/
if (templat->buffer_format != PIPE_FORMAT_NV12 || getenv("XVMC_VL") ||
(screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0) ||
*/
if (templat->buffer_format != PIPE_FORMAT_NV12 || getenv("XVMC_VL") ||
(screen->device->chipset >= 0x98 && screen->device->chipset != 0xa0) ||
- screen->device->chipset < 0x
31 || screen->device->chipset == 0x35
)
+ screen->device->chipset < 0x
40
)
return vl_video_buffer_create(pipe, templat);
assert(templat->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
return vl_video_buffer_create(pipe, templat);
assert(templat->chroma_format == PIPE_VIDEO_CHROMA_FORMAT_420);
@@
-812,7
+809,7
@@
nouveau_video_buffer_create(struct pipe_context *pipe,
templ.depth0 = 1;
templ.array_size = 1;
templ.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
templ.depth0 = 1;
templ.array_size = 1;
templ.bind = PIPE_BIND_SAMPLER_VIEW | PIPE_BIND_RENDER_TARGET;
- templ.usage = PIPE_USAGE_
STATIC
;
+ templ.usage = PIPE_USAGE_
DEFAULT
;
templ.flags = NOUVEAU_RESOURCE_FLAG_LINEAR;
buffer->resources[0] = pipe->screen->resource_create(pipe->screen, &templ);
templ.flags = NOUVEAU_RESOURCE_FLAG_LINEAR;
buffer->resources[0] = pipe->screen->resource_create(pipe->screen, &templ);
@@
-834,11
+831,13
@@
error:
static int
nouveau_screen_get_video_param(struct pipe_screen *pscreen,
enum pipe_video_profile profile,
static int
nouveau_screen_get_video_param(struct pipe_screen *pscreen,
enum pipe_video_profile profile,
+ enum pipe_video_entrypoint entrypoint,
enum pipe_video_cap param)
{
switch (param) {
case PIPE_VIDEO_CAP_SUPPORTED:
enum pipe_video_cap param)
{
switch (param) {
case PIPE_VIDEO_CAP_SUPPORTED:
- return vl_profile_supported(pscreen, profile);
+ return entrypoint >= PIPE_VIDEO_ENTRYPOINT_IDCT &&
+ u_reduce_video_profile(profile) == PIPE_VIDEO_FORMAT_MPEG12;
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
return 1;
case PIPE_VIDEO_CAP_MAX_WIDTH:
case PIPE_VIDEO_CAP_NPOT_TEXTURES:
return 1;
case PIPE_VIDEO_CAP_MAX_WIDTH:
@@
-867,9
+866,9
@@
nouveau_screen_init_vdec(struct nouveau_screen *screen)
screen->base.is_video_format_supported = vl_video_buffer_is_format_supported;
}
screen->base.is_video_format_supported = vl_video_buffer_is_format_supported;
}
-static struct pipe_video_
decoder
*
+static struct pipe_video_
codec
*
nouveau_context_create_decoder(struct pipe_context *context,
nouveau_context_create_decoder(struct pipe_context *context,
- const struct pipe_video_
decoder
*templ)
+ const struct pipe_video_
codec
*templ)
{
struct nouveau_screen *screen = nouveau_context(context)->screen;
return nouveau_create_decoder(context, templ, screen);
{
struct nouveau_screen *screen = nouveau_context(context)->screen;
return nouveau_create_decoder(context, templ, screen);
@@
-886,6
+885,6
@@
nouveau_context_video_buffer_create(struct pipe_context *pipe,
void
nouveau_context_init_vdec(struct nouveau_context *nv)
{
void
nouveau_context_init_vdec(struct nouveau_context *nv)
{
- nv->pipe.create_video_
decoder
= nouveau_context_create_decoder;
+ nv->pipe.create_video_
codec
= nouveau_context_create_decoder;
nv->pipe.create_video_buffer = nouveau_context_video_buffer_create;
}
nv->pipe.create_video_buffer = nouveau_context_video_buffer_create;
}