1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**********************************************************
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright 2008-2009 VMware, Inc.  All rights reserved.
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * obtaining a copy of this software and associated documentation
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * files (the "Software"), to deal in the Software without
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * restriction, including without limitation the rights to use, copy,
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * modify, merge, publish, distribute, sublicense, and/or sell copies
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * of the Software, and to permit persons to whom the Software is
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * furnished to do so, subject to the following conditions:
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice shall be
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * included in all copies or substantial portions of the Software.
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * SOFTWARE.
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org **********************************************************/
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef SVGA_STATE_H
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_STATE_H
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_compiler.h"
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_defines.h"
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_context;
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_init_state( struct svga_context *svga );
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_destroy_state( struct svga_context *svga );
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct svga_tracked_state {
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   const char *name;
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   unsigned dirty;
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   enum pipe_error (*update)( struct svga_context *svga, unsigned dirty );
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* NEED_SWTNL
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_update_need_swvfetch;
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_update_need_pipeline;
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_update_need_swtnl;
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* HW_CLEAR
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_viewport;
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_scissor;
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_framebuffer;
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* HW_DRAW
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_vs;
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_fs;
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_rss;
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_tss;
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_tss_binding;
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_clip_planes;
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_vdecl;
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_fs_constants;
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_hw_vs_constants;
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* SWTNL_DRAW
71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_update_swtnl_draw;
73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern struct svga_tracked_state svga_update_swtnl_vdecl;
74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Bring the hardware fully up-to-date so that we can emit draw
76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * commands.
77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_STATE_NEED_SWTNL        0
79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_STATE_HW_CLEAR          1
80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_STATE_HW_DRAW           2
81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_STATE_SWTNL_DRAW        3
82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SVGA_STATE_MAX               4
83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgenum pipe_error svga_update_state( struct svga_context *svga,
86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                   unsigned level );
87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgvoid svga_update_state_retry( struct svga_context *svga,
89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                              unsigned level );
90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgenum pipe_error svga_emit_initial_state( struct svga_context *svga );
93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgenum pipe_error svga_reemit_framebuffer_bindings( struct svga_context *svga );
95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgenum pipe_error svga_reemit_tss_bindings( struct svga_context *svga );
97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif
99