1 #include "nvfx_context.h"
4 nvfx_state_scissor_validate(struct nvfx_context
*nvfx
)
6 struct pipe_rasterizer_state
*rast
= &nvfx
->rasterizer
->pipe
;
7 struct pipe_scissor_state
*s
= &nvfx
->scissor
;
8 struct nouveau_stateobj
*so
;
10 if (nvfx
->state
.hw
[NVFX_STATE_SCISSOR
] &&
11 (rast
->scissor
== 0 && nvfx
->state
.scissor_enabled
== 0))
13 nvfx
->state
.scissor_enabled
= rast
->scissor
;
16 so_method(so
, nvfx
->screen
->eng3d
, NV34TCL_SCISSOR_HORIZ
, 2);
17 if (nvfx
->state
.scissor_enabled
) {
18 so_data (so
, ((s
->maxx
- s
->minx
) << 16) | s
->minx
);
19 so_data (so
, ((s
->maxy
- s
->miny
) << 16) | s
->miny
);
21 so_data (so
, 4096 << 16);
22 so_data (so
, 4096 << 16);
25 so_ref(so
, &nvfx
->state
.hw
[NVFX_STATE_SCISSOR
]);
30 struct nvfx_state_entry nvfx_state_scissor
= {
31 .validate
= nvfx_state_scissor_validate
,
33 .pipe
= NVFX_NEW_SCISSOR
| NVFX_NEW_RAST
,
34 .hw
= NVFX_STATE_SCISSOR