1
#include "nv40_context.h"
4
nv40_state_scissor_validate(struct nv40_context *nv40)
6
struct pipe_rasterizer_state *rast = &nv40->rasterizer->pipe;
7
struct pipe_scissor_state *s = &nv40->scissor;
8
struct nouveau_stateobj *so;
10
if (nv40->state.hw[NV40_STATE_SCISSOR] &&
11
(rast->scissor == 0 && nv40->state.scissor_enabled == 0))
13
nv40->state.scissor_enabled = rast->scissor;
16
so_method(so, nv40->screen->curie, NV40TCL_SCISSOR_HORIZ, 2);
17
if (nv40->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, &nv40->state.hw[NV40_STATE_SCISSOR]);
30
struct nv40_state_entry nv40_state_scissor = {
31
.validate = nv40_state_scissor_validate,
33
.pipe = NV40_NEW_SCISSOR | NV40_NEW_RAST,
34
.hw = NV40_STATE_SCISSOR