blob: 774abf3a28b636b13fd3d191cb9486ac13955b27 [file] [log] [blame]
Chia-I Wuc6fb9af2014-08-04 11:28:43 +08001/*
2 * XGL
3 *
4 * Copyright (C) 2014 LunarG, Inc.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
Chia-I Wu44e42362014-09-02 08:32:09 +080023 *
24 * Authors:
25 * Chia-I Wu <olv@lunarg.com>
Chia-I Wuc6fb9af2014-08-04 11:28:43 +080026 */
27
28#ifndef INTEL_H
29#define INTEL_H
30
Chia-I Wu214dac62014-08-05 11:07:40 +080031#include <stdlib.h>
Chia-I Wuc6fb9af2014-08-04 11:28:43 +080032#include <stdbool.h>
Chia-I Wuaabb3602014-08-19 14:18:23 +080033#include <stdint.h>
Chia-I Wu214dac62014-08-05 11:07:40 +080034#include <string.h>
Chia-I Wuc6fb9af2014-08-04 11:28:43 +080035#include <assert.h>
36
37#include <xgl.h>
38#include <xglDbg.h>
Chia-I Wub8dceae2014-09-23 10:37:23 +080039#include <xglWsiX11Ext.h>
Chia-I Wuc6fb9af2014-08-04 11:28:43 +080040
41#include "icd.h"
Chia-I Wu900364b2015-01-03 13:55:22 +080042#include "icd-alloc.h"
Chia-I Wu4115c892014-08-28 11:56:29 +080043#include "icd-bil.h"
Chia-I Wu1bf06df2014-08-16 12:33:13 +080044#include "icd-format.h"
Chia-I Wu8e270b52015-01-03 14:47:32 +080045#include "icd-log.h"
Chia-I Wu69abeac2014-08-16 12:43:53 +080046#include "icd-utils.h"
Jon Ashburnfa836e02015-01-28 18:26:16 -070047#include "obj.h"
Chia-I Wuc6fb9af2014-08-04 11:28:43 +080048
Chia-I Wu214dac62014-08-05 11:07:40 +080049#define INTEL_API_VERSION XGL_MAKE_VERSION(0, 22, 0)
50#define INTEL_DRIVER_VERSION 0
51
52#define INTEL_GEN(gen) ((int) ((gen) * 100))
53
Chia-I Wu24693712014-11-08 11:54:47 +080054#define INTEL_MAX_VERTEX_BINDING_COUNT 33
55#define INTEL_MAX_VERTEX_ELEMENT_COUNT (INTEL_MAX_VERTEX_BINDING_COUNT + 1)
Tony Barbourfa6cac72015-01-16 14:27:35 -070056#define INTEL_MAX_RENDER_TARGETS 8
57
Jon Ashburnfa836e02015-01-28 18:26:16 -070058struct intel_instance {
59 struct intel_obj obj;
60};
Chia-I Wu24693712014-11-08 11:54:47 +080061
Chia-I Wu1c527012014-08-23 14:57:35 +080062enum intel_debug_flags {
63 INTEL_DEBUG_BATCH = 1 << 0,
Chia-I Wu93ada312014-08-23 15:02:25 +080064
65 INTEL_DEBUG_NOHW = 1 << 20,
Chia-I Wu3fb47ce2014-10-28 11:19:36 +080066 INTEL_DEBUG_NOCACHE = 1 << 21,
Chia-I Wuc45db532015-02-19 11:20:38 -070067 INTEL_DEBUG_NOHIZ = 1 << 22,
68 INTEL_DEBUG_HANG = 1 << 23,
Chia-I Wu1c527012014-08-23 14:57:35 +080069};
70
71extern int intel_debug;
72
Jon Ashburnfa836e02015-01-28 18:26:16 -070073static inline struct intel_instance *intel_instance_from_base(struct intel_base *base)
74{
75 return (struct intel_instance *) base;
76}
77
78static inline struct intel_instance *intel_instance_from_obj(struct intel_obj *obj)
79{
80 return intel_instance_from_base(&obj->base);
81}
82
Chia-I Wuc6fb9af2014-08-04 11:28:43 +080083#endif /* INTEL_H */