Commit 1ead5459 authored by Austin Yuan's avatar Austin Yuan
parents 7e62098a 2135de7e
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#define CMD_STATE_BASE_ADDRESS CMD(0, 1, 1) #define CMD_STATE_BASE_ADDRESS CMD(0, 1, 1)
#define CMD_STATE_SIP CMD(0, 1, 2) #define CMD_STATE_SIP CMD(0, 1, 2)
#define CMD_PIPELINE_SELECT CMD(1, 1, 4) #define CMD_PIPELINE_SELECT CMD(1, 1, 4)
#define CMD_SAMPLER_PALETTE_LOAD CMD(3, 3, 2) #define CMD_SAMPLER_PALETTE_LOAD CMD(3, 1, 2)
#define CMD_MEDIA_STATE_POINTERS CMD(2, 0, 0) #define CMD_MEDIA_STATE_POINTERS CMD(2, 0, 0)
#define CMD_MEDIA_OBJECT CMD(2, 1, 0) #define CMD_MEDIA_OBJECT CMD(2, 1, 0)
......
This diff is collapsed.
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
#define I965_MAX_ENTRYPOINTS 5 #define I965_MAX_ENTRYPOINTS 5
#define I965_MAX_CONFIG_ATTRIBUTES 10 #define I965_MAX_CONFIG_ATTRIBUTES 10
#define I965_MAX_IMAGE_FORMATS 10 #define I965_MAX_IMAGE_FORMATS 10
#define I965_MAX_SUBPIC_FORMATS 4 #define I965_MAX_SUBPIC_FORMATS 2
#define I965_MAX_DISPLAY_ATTRIBUTES 4 #define I965_MAX_DISPLAY_ATTRIBUTES 4
#define I965_STR_VENDOR "i965 Driver 0.1" #define I965_STR_VENDOR "i965 Driver 0.1"
...@@ -106,23 +106,24 @@ struct object_buffer ...@@ -106,23 +106,24 @@ struct object_buffer
int size_element; int size_element;
VABufferType type; VABufferType type;
}; };
struct object_image struct object_image
{ {
struct object_base base; struct object_base base;
int width; VAImage image;
int height;
int size;
dri_bo *bo; dri_bo *bo;
unsigned int *palette;
}; };
struct object_subpic struct object_subpic
{ {
struct object_base base; struct object_base base;
VAImageID image; VAImageID image;
int dstx; VARectangle src_rect;
int dsty; VARectangle dst_rect;
unsigned int format;
int width; int width;
int height; int height;
unsigned char palette[3][16];
dri_bo *bo; dri_bo *bo;
}; };
......
...@@ -868,7 +868,7 @@ i965_media_mpeg2_objects(VADriverContextP ctx, struct decode_state *decode_state ...@@ -868,7 +868,7 @@ i965_media_mpeg2_objects(VADriverContextP ctx, struct decode_state *decode_state
I915_GEM_DOMAIN_SAMPLER, 0, I915_GEM_DOMAIN_SAMPLER, 0,
slice_param->slice_data_offset + (slice_param->macroblock_offset >> 3)); slice_param->slice_data_offset + (slice_param->macroblock_offset >> 3));
OUT_BATCH(ctx, OUT_BATCH(ctx,
((0 << 24) | ((slice_param->slice_horizontal_position << 24) |
(slice_param->slice_vertical_position << 16) | (slice_param->slice_vertical_position << 16) |
(127 << 8) | (127 << 8) |
(slice_param->macroblock_offset & 0x7))); (slice_param->macroblock_offset & 0x7)));
......
...@@ -70,7 +70,7 @@ static const unsigned int ps_subpic_kernel_static[][4] = ...@@ -70,7 +70,7 @@ static const unsigned int ps_subpic_kernel_static[][4] =
{ {
#include "shaders/render/exa_wm_xy.g4b" #include "shaders/render/exa_wm_xy.g4b"
#include "shaders/render/exa_wm_src_affine.g4b" #include "shaders/render/exa_wm_src_affine.g4b"
#include "shaders/render/exa_wm_blend_subpicture.g4b" #include "shaders/render/exa_wm_src_sample_argb.g4b"
#include "shaders/render/exa_wm_write.g4b" #include "shaders/render/exa_wm_write.g4b"
}; };
...@@ -92,7 +92,7 @@ static const unsigned int ps_subpic_kernel_static_gen5[][4] = ...@@ -92,7 +92,7 @@ static const unsigned int ps_subpic_kernel_static_gen5[][4] =
{ {
#include "shaders/render/exa_wm_xy.g4b.gen5" #include "shaders/render/exa_wm_xy.g4b.gen5"
#include "shaders/render/exa_wm_src_affine.g4b.gen5" #include "shaders/render/exa_wm_src_affine.g4b.gen5"
#include "shaders/render/exa_wm_blend_subpicture.g4b.gen5" #include "shaders/render/exa_wm_src_sample_argb.g4b.gen5"
#include "shaders/render/exa_wm_write.g4b.gen5" #include "shaders/render/exa_wm_write.g4b.gen5"
}; };
...@@ -580,12 +580,13 @@ i965_render_src_surface_state(VADriverContextP ctx, ...@@ -580,12 +580,13 @@ i965_render_src_surface_state(VADriverContextP ctx,
render_state->wm.surface[index] = ss_bo; render_state->wm.surface[index] = ss_bo;
render_state->wm.sampler_count++; render_state->wm.sampler_count++;
} }
static void static void
i965_subpic_render_src_surface_state(VADriverContextP ctx, i965_subpic_render_src_surface_state(VADriverContextP ctx,
int index, int index,
dri_bo *region, dri_bo *region,
unsigned long offset, unsigned long offset,
int w, int h) int w, int h, int format)
{ {
struct i965_driver_data *i965 = i965_driver_data(ctx); struct i965_driver_data *i965 = i965_driver_data(ctx);
struct i965_render_state *render_state = &i965->render_state; struct i965_render_state *render_state = &i965->render_state;
...@@ -601,7 +602,7 @@ i965_subpic_render_src_surface_state(VADriverContextP ctx, ...@@ -601,7 +602,7 @@ i965_subpic_render_src_surface_state(VADriverContextP ctx,
ss = ss_bo->virtual; ss = ss_bo->virtual;
memset(ss, 0, sizeof(*ss)); memset(ss, 0, sizeof(*ss));
ss->ss0.surface_type = I965_SURFACE_2D; ss->ss0.surface_type = I965_SURFACE_2D;
ss->ss0.surface_format = I965_SURFACEFORMAT_R8_UNORM; ss->ss0.surface_format = format;
ss->ss0.writedisable_alpha = 0; ss->ss0.writedisable_alpha = 0;
ss->ss0.writedisable_red = 0; ss->ss0.writedisable_red = 0;
ss->ss0.writedisable_green = 0; ss->ss0.writedisable_green = 0;
...@@ -677,8 +678,8 @@ i965_subpic_render_src_surfaces_state(VADriverContextP ctx, ...@@ -677,8 +678,8 @@ i965_subpic_render_src_surfaces_state(VADriverContextP ctx,
region = obj_surface->bo; region = obj_surface->bo;
subpic_region = obj_image->bo; subpic_region = obj_image->bo;
/*subpicture surface*/ /*subpicture surface*/
i965_subpic_render_src_surface_state(ctx, 1, subpic_region, 0, obj_image->width, obj_image->height); i965_subpic_render_src_surface_state(ctx, 1, subpic_region, 0, obj_subpic->width, obj_subpic->height, obj_subpic->format);
i965_subpic_render_src_surface_state(ctx, 2, subpic_region, 0, obj_image->width, obj_image->height); i965_subpic_render_src_surface_state(ctx, 2, subpic_region, 0, obj_subpic->width, obj_subpic->height, obj_subpic->format);
} }
static void static void
...@@ -789,57 +790,56 @@ i965_render_binding_table(VADriverContextP ctx) ...@@ -789,57 +790,56 @@ i965_render_binding_table(VADriverContextP ctx)
static void static void
i965_subpic_render_upload_vertex(VADriverContextP ctx, i965_subpic_render_upload_vertex(VADriverContextP ctx,
VASurfaceID surface, VASurfaceID surface,
short srcx, const VARectangle *output_rect)
short srcy,
unsigned short srcw,
unsigned short srch,
short destx,
short desty,
unsigned short destw,
unsigned short desth)
{ {
struct i965_driver_data *i965 = i965_driver_data(ctx); struct i965_driver_data *i965 = i965_driver_data(ctx);
struct i965_render_state *render_state = &i965->render_state; struct i965_render_state *render_state = &i965->render_state;
struct intel_region *dest_region = render_state->draw_region; struct object_surface *obj_surface = SURFACE(surface);
struct object_surface *obj_surface; struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic);
struct object_subpic *obj_subpic;
float *vb;
float src_scale_x, src_scale_y;
int i, width, height;
obj_surface = SURFACE(surface);
obj_subpic = SUBPIC(obj_surface->subpic);
assert(obj_surface);
assert(obj_subpic);
int box_x1 = dest_region->x + obj_subpic->dstx;
int box_y1 = dest_region->y + obj_subpic->dsty;
int box_x2 = box_x1 + obj_subpic->width;
int box_y2 = box_y1 + obj_subpic->height;
width = obj_surface->width; const float psx = (float)obj_surface->width / (float)obj_subpic->width;
height = obj_surface->height; const float psy = (float)obj_surface->height / (float)obj_subpic->height;
src_scale_x = ((float)srcw / width) / (float)destw; const float ssx = (float)output_rect->width / (float)obj_surface->width;
src_scale_y = ((float)srch / height) / (float)desth; const float ssy = (float)output_rect->height / (float)obj_surface->height;
const float sx = psx * ssx;
const float sy = psy * ssy;
float *vb, tx1, tx2, ty1, ty2, x1, x2, y1, y2;
int i = 0;
VARectangle dst_rect;
dst_rect.x = output_rect->x + sx * (float)obj_subpic->dst_rect.x;
dst_rect.y = output_rect->y + sx * (float)obj_subpic->dst_rect.y;
dst_rect.width = sx * (float)obj_subpic->dst_rect.width;
dst_rect.height = sy * (float)obj_subpic->dst_rect.height;
dri_bo_map(render_state->vb.vertex_buffer, 1); dri_bo_map(render_state->vb.vertex_buffer, 1);
assert(render_state->vb.vertex_buffer->virtual); assert(render_state->vb.vertex_buffer->virtual);
vb = render_state->vb.vertex_buffer->virtual; vb = render_state->vb.vertex_buffer->virtual;
/*vertex covers the full subpicture*/
i = 0;
vb[i++] = 1;
vb[i++] = 1;
vb[i++] = (float)box_x2;
vb[i++] = (float)box_y2;
vb[i++] = 0.0;
vb[i++] = 1;
vb[i++] = (float)box_x1;
vb[i++] = (float)box_y2;
vb[i++] = 0.0; tx1 = (float)obj_subpic->src_rect.x / (float)obj_subpic->width;
vb[i++] = 0.0; ty1 = (float)obj_subpic->src_rect.y / (float)obj_subpic->height;
vb[i++] = (float)box_x1; tx2 = (float)(obj_subpic->src_rect.x + obj_subpic->src_rect.width) / (float)obj_subpic->width;
vb[i++] = (float)box_y1; ty2 = (float)(obj_subpic->src_rect.y + obj_subpic->src_rect.height) / (float)obj_subpic->height;
x1 = (float)dst_rect.x;
y1 = (float)dst_rect.y;
x2 = (float)(dst_rect.x + dst_rect.width);
y2 = (float)(dst_rect.y + dst_rect.height);
vb[i++] = tx2;
vb[i++] = ty2;
vb[i++] = x2;
vb[i++] = y2;
vb[i++] = tx1;
vb[i++] = ty2;
vb[i++] = x1;
vb[i++] = y2;
vb[i++] = tx1;
vb[i++] = ty1;
vb[i++] = x1;
vb[i++] = y1;
dri_bo_unmap(render_state->vb.vertex_buffer); dri_bo_unmap(render_state->vb.vertex_buffer);
} }
...@@ -947,9 +947,13 @@ i965_subpic_render_state_setup(VADriverContextP ctx, ...@@ -947,9 +947,13 @@ i965_subpic_render_state_setup(VADriverContextP ctx,
i965_render_cc_viewport(ctx); i965_render_cc_viewport(ctx);
i965_subpic_render_cc_unit(ctx); i965_subpic_render_cc_unit(ctx);
i965_render_binding_table(ctx); i965_render_binding_table(ctx);
i965_subpic_render_upload_vertex(ctx, surface,
srcx, srcy, srcw, srch, VARectangle output_rect;
destx, desty, destw, desth); output_rect.x = destx;
output_rect.y = desty;
output_rect.width = destw;
output_rect.height = desth;
i965_subpic_render_upload_vertex(ctx, surface, &output_rect);
} }
...@@ -1162,21 +1166,31 @@ i965_render_vertex_elements(VADriverContextP ctx) ...@@ -1162,21 +1166,31 @@ i965_render_vertex_elements(VADriverContextP ctx)
} }
} }
void static void
i965_render_upload_palette(VADriverContextP ctx) i965_render_upload_image_palette(
VADriverContextP ctx,
VAImageID image_id,
unsigned int alpha
)
{ {
BEGIN_BATCH(ctx, 17); struct i965_driver_data *i965 = i965_driver_data(ctx);
OUT_BATCH(ctx, CMD_SAMPLER_PALETTE_LOAD | 15); unsigned int i;
struct object_image *obj_image = IMAGE(image_id);
assert(obj_image);
if (obj_image->image.num_palette_entries == 0)
return;
BEGIN_BATCH(ctx, 1 + obj_image->image.num_palette_entries);
OUT_BATCH(ctx, CMD_SAMPLER_PALETTE_LOAD | (obj_image->image.num_palette_entries - 1));
/*fill palette*/ /*fill palette*/
//int32_t out[16]; //0-23:color 23-31:alpha //int32_t out[16]; //0-23:color 23-31:alpha
int32_t i,c; for (i = 0; i < obj_image->image.num_palette_entries; i++)
for(i = 0; i < 16; i ++){ OUT_BATCH(ctx, (alpha << 24) | obj_image->palette[i]);
c = i*16; //16 colors
OUT_BATCH(ctx,c<<24/*alpha*/|c<<16/*R*/|c<<8/*G*/|c/*B*/);//c<<24/*alpha*/|c<<16/*R*/|c<<8/*G*/|c/*B*/);
}
ADVANCE_BATCH(ctx); ADVANCE_BATCH(ctx);
} }
static void static void
i965_render_startup(VADriverContextP ctx) i965_render_startup(VADriverContextP ctx)
{ {
...@@ -1284,7 +1298,6 @@ i965_subpic_render_pipeline_setup(VADriverContextP ctx) ...@@ -1284,7 +1298,6 @@ i965_subpic_render_pipeline_setup(VADriverContextP ctx)
i965_render_binding_table_pointers(ctx); i965_render_binding_table_pointers(ctx);
i965_render_constant_color(ctx); i965_render_constant_color(ctx);
i965_render_pipelined_pointers(ctx); i965_render_pipelined_pointers(ctx);
//i965_render_upload_palette(ctx);
i965_render_urb_layout(ctx); i965_render_urb_layout(ctx);
i965_render_cs_urb_layout(ctx); i965_render_cs_urb_layout(ctx);
i965_render_drawing_rectangle(ctx); i965_render_drawing_rectangle(ctx);
...@@ -1412,11 +1425,17 @@ i965_render_put_subpic(VADriverContextP ctx, ...@@ -1412,11 +1425,17 @@ i965_render_put_subpic(VADriverContextP ctx,
unsigned short destw, unsigned short destw,
unsigned short desth) unsigned short desth)
{ {
struct i965_driver_data *i965 = i965_driver_data(ctx);
struct object_surface *obj_surface = SURFACE(surface);
struct object_subpic *obj_subpic = SUBPIC(obj_surface->subpic);
assert(obj_subpic);
i965_render_initialize(ctx); i965_render_initialize(ctx);
i965_subpic_render_state_setup(ctx, surface, i965_subpic_render_state_setup(ctx, surface,
srcx, srcy, srcw, srch, srcx, srcy, srcw, srch,
destx, desty, destw, desth); destx, desty, destw, desth);
i965_subpic_render_pipeline_setup(ctx); i965_subpic_render_pipeline_setup(ctx);
i965_render_upload_image_palette(ctx, obj_subpic->image, 0xff);
intel_batchbuffer_flush(ctx); intel_batchbuffer_flush(ctx);
} }
......
...@@ -43,6 +43,7 @@ struct intel_batchbuffer; ...@@ -43,6 +43,7 @@ struct intel_batchbuffer;
#define ALIGN(i, n) (((i) + (n) - 1) & ~((n) - 1)) #define ALIGN(i, n) (((i) + (n) - 1) & ~((n) - 1))
#define MIN(a, b) ((a) < (b) ? (a) : (b)) #define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define SET_BLOCKED_SIGSET() do { \ #define SET_BLOCKED_SIGSET() do { \
sigset_t bl_mask; \ sigset_t bl_mask; \
......
...@@ -7,27 +7,27 @@ INTEL_G4A = \ ...@@ -7,27 +7,27 @@ INTEL_G4A = \
exa_sf.g4a \ exa_sf.g4a \
exa_wm_xy.g4a \ exa_wm_xy.g4a \
exa_wm_src_affine.g4a \ exa_wm_src_affine.g4a \
exa_wm_src_sample_argb.g4a \
exa_wm_src_sample_planar.g4a \ exa_wm_src_sample_planar.g4a \
exa_wm_yuv_rgb.g4a \ exa_wm_yuv_rgb.g4a \
exa_wm_blend_subpicture.g4a \
exa_wm_write.g4a exa_wm_write.g4a
INTEL_G4B = \ INTEL_G4B = \
exa_sf.g4b \ exa_sf.g4b \
exa_wm_xy.g4b \ exa_wm_xy.g4b \
exa_wm_src_affine.g4b \ exa_wm_src_affine.g4b \
exa_wm_src_sample_argb.g4b \
exa_wm_src_sample_planar.g4b \ exa_wm_src_sample_planar.g4b \
exa_wm_yuv_rgb.g4b \ exa_wm_yuv_rgb.g4b \
exa_wm_blend_subpicture.g4b \
exa_wm_write.g4b exa_wm_write.g4b
INTEL_G4B_GEN5 = \ INTEL_G4B_GEN5 = \
exa_sf.g4b.gen5 \ exa_sf.g4b.gen5 \
exa_wm_xy.g4b.gen5 \ exa_wm_xy.g4b.gen5 \
exa_wm_src_affine.g4b.gen5 \ exa_wm_src_affine.g4b.gen5 \
exa_wm_src_sample_argb.g4b.gen5 \
exa_wm_src_sample_planar.g4b.gen5 \ exa_wm_src_sample_planar.g4b.gen5 \
exa_wm_yuv_rgb.g4b.gen5 \ exa_wm_yuv_rgb.g4b.gen5 \
exa_wm_blend_subpicture.g4b.gen5 \
exa_wm_write.g4b.gen5 exa_wm_write.g4b.gen5
EXTRA_DIST = $(INTEL_G4I) \ EXTRA_DIST = $(INTEL_G4I) \
......
{ 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
{ 0x01800031, 0x22001d29, 0x008d0000, 0x02520001 },
{ 0x01800031, 0x21c01d29, 0x008d0000, 0x02520201 },
{ 0x01800031, 0x22401d29, 0x008d0000, 0x02520401 },
{ 0x00600001, 0x228003bd, 0x008d01c0, 0x00000000 },
{ 0x00600001, 0x22a003bd, 0x008d01e0, 0x00000000 },
{ 0x00600040, 0x21c07fbd, 0x008d01c0, 0x3f000000 },
{ 0x00600040, 0x21e07fbd, 0x008d01e0, 0x3f000000 },
{ 0x00600040, 0x22007fbd, 0x008d0200, 0x3f000000 },
{ 0x00600040, 0x22207fbd, 0x008d0220, 0x3f000000 },
{ 0x00600040, 0x22407fbd, 0x008d0240, 0x3f000000 },
{ 0x00600040, 0x22607fbd, 0x008d0260, 0x3f000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x00000201, 0x20080061, 0x00000000, 0x0000e000 },
{ 0x01800031, 0x22001d29, 0x208d0000, 0x0a2a0001 },
{ 0x01800031, 0x21c01d29, 0x208d0000, 0x0a2a0201 },
{ 0x01800031, 0x22401d29, 0x208d0000, 0x0a2a0401 },
{ 0x00600001, 0x228003bd, 0x008d01c0, 0x00000000 },
{ 0x00600001, 0x22a003bd, 0x008d01e0, 0x00000000 },
{ 0x00600040, 0x21c07fbd, 0x008d01c0, 0x3f000000 },
{ 0x00600040, 0x21e07fbd, 0x008d01e0, 0x3f000000 },
{ 0x00600040, 0x22007fbd, 0x008d0200, 0x3f000000 },
{ 0x00600040, 0x22207fbd, 0x008d0220, 0x3f000000 },
{ 0x00600040, 0x22407fbd, 0x008d0240, 0x3f000000 },
{ 0x00600040, 0x22607fbd, 0x008d0260, 0x3f000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
{ 0x0000007e, 0x00000000, 0x00000000, 0x00000000 },
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
* Keith Packard <keithp@keithp.com> * Keith Packard <keithp@keithp.com>
*/ */
/* Sample the src surface in planar format */ /* Sample the src surface */
include(`exa_wm.g4i') include(`exa_wm.g4i')
/* prepare sampler read back gX register, which would be written back to output */ /* prepare sampler read back gX register, which would be written back to output */
...@@ -33,51 +34,14 @@ include(`exa_wm.g4i') ...@@ -33,51 +34,14 @@ include(`exa_wm.g4i')
/* use simd16 sampler, param 0 is u, param 1 is v. */ /* use simd16 sampler, param 0 is u, param 1 is v. */
/* 'payload' loading, assuming tex coord start from g4 */ /* 'payload' loading, assuming tex coord start from g4 */
/* load r */ /* load argb */
mov (1) g0.8<1>UD 0x0000e000UD { align1 mask_disable }; mov (1) g0.8<1>UD 0x00000000UD { align1 mask_disable };
/* src_msg will be copied with g0, as it contains send desc */ /* src_msg will be copied with g0, as it contains send desc */
/* emit sampler 'send' cmd */ /* emit sampler 'send' cmd */
/* sample Y */
send (16) src_msg_ind /* msg reg index */
src_sample_g<1>UW /* readback */
g0<8,8,1>UW /* copy to msg start reg*/
sampler (1,0,F) /* sampler message description, (binding_table,sampler_index,datatype)*/
mlen 5 rlen 2 {align1};
/* sample U (Cr) */
send (16) src_msg_ind /* msg reg index */ send (16) src_msg_ind /* msg reg index */
src_sample_r<1>UW /* readback */ src_sample_base<1>UW /* readback */
g0<8,8,1>UW /* copy to msg start reg*/ g0<8,8,1>UW /* copy to msg start reg*/
sampler (1,2,F) /* sampler message description, (binding_table,sampler_index,datatype) sampler (1,0,F) /* sampler message description, (binding_table,sampler_index,datatype)
/* here(src->dst) we should use src_sampler and src_surface */ /* here(src->dst) we should use src_sampler and src_surface */
mlen 5 rlen 2 { align1 }; /* required message len 5, readback len 8 */ mlen 5 rlen 8 { align1 }; /* required message len 5, readback len 8 */
/* sample V (Cb) */
send (16) src_msg_ind /* msg reg index */
src_sample_b<1>UW /* readback */
g0<8,8,1>UW /* copy to msg start reg*/
sampler (1,4,F) /* sampler message description, (binding_table,sampler_index,datatype)
/* here(src->dst) we should use src_sampler and src_surface */
mlen 5 rlen 2 { align1 }; /* required message len 5, readback len 8 */
/*extract alpha value, alpha value stores in one float with color value, because the color value is small,
we can neglect it when doing alpha blend*/
mov (8) src_sample_a<1>F g14<8,8,1>F { align1 };
mov (8) src_sample_a_23<1>F g15<8,8,1>F { align1 };
/*set subtitle color*/
add (8) g14<1>F g14<8,8,1>F 0.5F { align1 };
add (8) g15<1>F g15<8,8,1>F 0.5F { align1 };
add (8) g16<1>F g16<8,8,1>F 0.5F { align1 };
add (8) g17<1>F g17<8,8,1>F 0.5F { align1 };
add (8) g18<1>F g18<8,8,1>F 0.5F { align1 };
add (8) g19<1>F g19<8,8,1>F 0.5F { align1 };
nop;
nop;
nop;
{ 0x00000201, 0x20080061, 0x00000000, 0x00000000 },
{ 0x01800031, 0x21c01d29, 0x008d0000, 0x02580001 },
{ 0x00000201, 0x20080061, 0x00000000, 0x00000000 },
{ 0x01800031, 0x21c01d29, 0x208d0000, 0x0a8a0001 },
...@@ -313,6 +313,8 @@ const char *vaErrorStr(VAStatus error_status) ...@@ -313,6 +313,8 @@ const char *vaErrorStr(VAStatus error_status)
return "resolution not supported"; return "resolution not supported";
case VA_STATUS_ERROR_UNIMPLEMENTED: case VA_STATUS_ERROR_UNIMPLEMENTED:
return "the requested function is not implemented"; return "the requested function is not implemented";
case VA_STATUS_ERROR_SURFACE_IN_DISPLAYING:
return "surface is in displaying (may by overlay)" ;
case VA_STATUS_ERROR_UNKNOWN: case VA_STATUS_ERROR_UNKNOWN:
return "unknown libva error"; return "unknown libva error";
} }
......
...@@ -128,6 +128,7 @@ typedef int VAStatus; /* Return status type from functions */ ...@@ -128,6 +128,7 @@ typedef int VAStatus; /* Return status type from functions */
#define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012 #define VA_STATUS_ERROR_INVALID_PARAMETER 0x00000012
#define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013 #define VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED 0x00000013
#define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014 #define VA_STATUS_ERROR_UNIMPLEMENTED 0x00000014
#define VA_STATUS_ERROR_SURFACE_IN_DISPLAYING 0x00000015
#define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF #define VA_STATUS_ERROR_UNKNOWN 0xFFFFFFFF
/* /*
...@@ -569,6 +570,7 @@ typedef struct _VASliceParameterBufferMPEG2 ...@@ -569,6 +570,7 @@ typedef struct _VASliceParameterBufferMPEG2
unsigned int slice_data_offset;/* the offset to the first byte of slice data */ unsigned int slice_data_offset;/* the offset to the first byte of slice data */
unsigned int slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */ unsigned int slice_data_flag; /* see VA_SLICE_DATA_FLAG_XXX defintions */
unsigned int macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */ unsigned int macroblock_offset;/* the offset to the first bit of MB from the first byte of slice data */
unsigned int slice_horizontal_position;
unsigned int slice_vertical_position; unsigned int slice_vertical_position;
int quantiser_scale_code; int quantiser_scale_code;
int intra_slice_flag; int intra_slice_flag;
......
...@@ -107,7 +107,6 @@ isDRI1Connected(VADriverContextP ctx, char **driver_name) ...@@ -107,7 +107,6 @@ isDRI1Connected(VADriverContextP ctx, char **driver_name)
dri_state->fd = drmOpenOnce(NULL, BusID, &newlyopened); dri_state->fd = drmOpenOnce(NULL, BusID, &newlyopened);
XFree(BusID); XFree(BusID);
assert(dri_state->fd >= 0);
if (dri_state->fd < 0) if (dri_state->fd < 0)
goto err_out1; goto err_out1;
......
...@@ -42,26 +42,6 @@ ...@@ -42,26 +42,6 @@
static VADisplayContextP pDisplayContexts = NULL; static VADisplayContextP pDisplayContexts = NULL;
static void va_errorMessage(const char *msg, ...)
{
va_list args;
fprintf(stderr, "libva error: ");
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
}
static void va_infoMessage(const char *msg, ...)
{
va_list args;
fprintf(stderr, "libva: ");
va_start(args, msg);
vfprintf(stderr, msg, args);
va_end(args);
}
static int va_DisplayContextIsValid ( static int va_DisplayContextIsValid (
VADisplayContextP pDisplayContext VADisplayContextP pDisplayContext
) )
...@@ -132,49 +112,21 @@ static VAStatus va_NVCTRL_GetDriverName ( ...@@ -132,49 +112,21 @@ static VAStatus va_NVCTRL_GetDriverName (
) )
{ {
VADriverContextP ctx = pDisplayContext->pDriverContext; VADriverContextP ctx = pDisplayContext->pDriverContext;
VAStatus vaStatus = VA_STATUS_ERROR_UNKNOWN; int direct_capable, driver_major, driver_minor, driver_patch;
int direct_capable; Bool result;
int driver_major;
int driver_minor;
int driver_patch;
Bool result = True;
char *nvidia_driver_name = NULL;
if (result) result = VA_NVCTRLQueryDirectRenderingCapable(ctx->x11_dpy, ctx->x11_screen,
{ &direct_capable);
result = VA_NVCTRLQueryDirectRenderingCapable(ctx->x11_dpy, ctx->x11_screen, &direct_capable); if (!result || !direct_capable)
if (!result) return VA_STATUS_ERROR_UNKNOWN;
{
va_errorMessage("VA_NVCTRLQueryDirectRenderingCapable failed\n"); result = VA_NVCTRLGetClientDriverName(ctx->x11_dpy, ctx->x11_screen,
} &driver_major, &driver_minor,
} &driver_patch, driver_name);
if (result)
{
result = direct_capable;
if (!result)
{
va_errorMessage("VA_NVCTRLQueryDirectRenderingCapable returned false\n");
}
}
if (result)
{
result = VA_NVCTRLGetClientDriverName(ctx->x11_dpy, ctx->x11_screen, &driver_major, &driver_minor,
&driver_patch, &nvidia_driver_name);
if (!result) if (!result)
{ return VA_STATUS_ERROR_UNKNOWN;
va_errorMessage("VA_NVCTRLGetClientDriverName returned false\n");
} return VA_STATUS_SUCCESS;
}
if (result)
{
vaStatus = VA_STATUS_SUCCESS;
va_infoMessage("va_NVCTRL_GetDriverName: %d.%d.%d %s (screen %d)\n",
driver_major, driver_minor, driver_patch,
nvidia_driver_name, ctx->x11_screen);
if (driver_name)
*driver_name = nvidia_driver_name;
}
return vaStatus;
} }
static VAStatus va_DisplayContextGetDriverName ( static VAStatus va_DisplayContextGetDriverName (
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment