1 #include "nvfx_context.h"
4 nvfx_state_viewport_validate(struct nvfx_context
*nvfx
)
6 struct pipe_viewport_state
*vpt
= &nvfx
->viewport
;
7 struct nouveau_stateobj
*so
;
9 if (nvfx
->state
.hw
[NVFX_STATE_VIEWPORT
] &&
10 !(nvfx
->dirty
& NVFX_NEW_VIEWPORT
))
14 so_method(so
, nvfx
->screen
->eng3d
,
15 NV34TCL_VIEWPORT_TRANSLATE_X
, 8);
16 if(nvfx
->render_mode
== HW
) {
17 so_data (so
, fui(vpt
->translate
[0]));
18 so_data (so
, fui(vpt
->translate
[1]));
19 so_data (so
, fui(vpt
->translate
[2]));
20 so_data (so
, fui(vpt
->translate
[3]));
21 so_data (so
, fui(vpt
->scale
[0]));
22 so_data (so
, fui(vpt
->scale
[1]));
23 so_data (so
, fui(vpt
->scale
[2]));
24 so_data (so
, fui(vpt
->scale
[3]));
25 so_method(so
, nvfx
->screen
->eng3d
, 0x1d78, 1);
28 so_data (so
, fui(0.0f
));
29 so_data (so
, fui(0.0f
));
30 so_data (so
, fui(0.0f
));
31 so_data (so
, fui(0.0f
));
32 so_data (so
, fui(1.0f
));
33 so_data (so
, fui(1.0f
));
34 so_data (so
, fui(1.0f
));
35 so_data (so
, fui(1.0f
));
36 so_method(so
, nvfx
->screen
->eng3d
, 0x1d78, 1);
37 so_data (so
, nvfx
->is_nv4x
? 0x110 : 1);
40 so_ref(so
, &nvfx
->state
.hw
[NVFX_STATE_VIEWPORT
]);
45 struct nvfx_state_entry nvfx_state_viewport
= {
46 .validate
= nvfx_state_viewport_validate
,
48 .pipe
= NVFX_NEW_VIEWPORT
,
49 .hw
= NVFX_STATE_VIEWPORT