Commit b4d8ca8b authored by Zhenyu Wang's avatar Zhenyu Wang

xvmc: init one-time mc context once

Don't setup one-time mc context everytime, as the content is always
unchanged. And several structs got packed layout inside to ease static
state initialization.
parent 54f3f528
......@@ -28,6 +28,8 @@
#ifndef _I915_STRUCTS_H
#define _I915_STRUCTS_H
#include <stdint.h>
/* MI_INSTRUCTION */
#define CMD_MI 0x00
......@@ -532,6 +534,9 @@ struct i915_3dstate_sampler_state
unsigned sampler_masker : 16;
unsigned pad0 : 16;
} dw1;
/* we always use two samplers for mc */
struct texture_sampler sampler0;
struct texture_sampler sampler1;
};
struct arithmetic_inst
......@@ -641,17 +646,48 @@ union shader_inst
struct declaration_inst d;
};
struct i915_3dstate_pixel_shader_header {
unsigned length : 9;
unsigned pad0 : 6;
unsigned retain : 1;
unsigned opcode : 13;
unsigned type : 3;
};
struct i915_3dstate_pixel_shader_program
{
struct {
unsigned length : 9;
unsigned pad0 : 6;
unsigned retain : 1;
unsigned opcode : 13;
unsigned type : 3;
} dw0;
// union shader_inst *insts;
struct i915_3dstate_pixel_shader_header shader0;
/* mov oC, c0.0000 */
uint32_t inst0[3];
struct i915_3dstate_pixel_shader_header shader1;
/* dcl t0.xy */
/* dcl t1.xy */
/* dcl_2D s0 */
/* texld r0, t0, s0 */
/* mov oC, r0 */
uint32_t inst1[3*5];
struct i915_3dstate_pixel_shader_header shader2;
/* dcl t2.xy */
/* dcl t3.xy */
/* dcl_2D s1 */
/* texld r0, t2, s1 */
/* mov oC, r0 */
uint32_t inst2[3*5];
struct i915_3dstate_pixel_shader_header shader3;
/* dcl t0.xy */
/* dcl t1.xy */
/* dcl t2.xy */
/* dcl t3.xy */
/* dcl_2D s0 */
/* dcl_2D s1 */
/* texld r0, t0, s0 */
/* texld r0, t2, s1 */
/* add r0, r0, r1*/
/* mov oC, r0 */
uint32_t inst3[3*10];
};
#define REG_CR0 0x00000001
......@@ -707,7 +743,8 @@ struct i915_3dstate_pixel_shader_constants
struct {
unsigned reg_mask;
} dw1;
// struct shader_constant *consts;
/* we only need one constant */
struct shader_constant value;
};
#define BLOCK_SIS 0x01
......
This diff is collapsed.
......@@ -38,6 +38,7 @@
#include <string.h>
#include <assert.h>
#include <signal.h>
#include <stdint.h>
#include <xf86drm.h>
#include "i830_common.h"
......
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