summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_context.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2013-04-29 09:41:11 +0800
committerChia-I Wu <[email protected]>2013-05-01 11:20:41 +0800
commitbb1f635dcc8f6d817b49785edcf6ec6b46ca5405 (patch)
tree0513e91559dce627a0904abc99dd33808bc42bc5 /src/gallium/drivers/ilo/ilo_context.c
parent355f3f7ab50ea97c63887bfcaa274edbec5bfdf0 (diff)
ilo: add ilo_dev_info shared by the screen and contexts
The struct is used to describe the device information, such as PCI ID, GEN, GT, and etc.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_context.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_context.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/gallium/drivers/ilo/ilo_context.c b/src/gallium/drivers/ilo/ilo_context.c
index 880c9c1a7ba..0e9dbf98c7a 100644
--- a/src/gallium/drivers/ilo/ilo_context.c
+++ b/src/gallium/drivers/ilo/ilo_context.c
@@ -135,32 +135,19 @@ ilo_context_create(struct pipe_screen *screen, void *priv)
return NULL;
ilo->winsys = is->winsys;
- ilo->devid = is->devid;
- ilo->gen = is->gen;
-
- if (IS_SNB_GT1(ilo->devid) ||
- IS_IVB_GT1(ilo->devid) ||
- IS_HSW_GT1(ilo->devid) ||
- IS_BAYTRAIL(ilo->devid))
- ilo->gt = 1;
- else if (IS_SNB_GT2(ilo->devid) ||
- IS_IVB_GT2(ilo->devid) ||
- IS_HSW_GT2(ilo->devid))
- ilo->gt = 2;
- else
- ilo->gt = 0;
+ ilo->dev = &is->dev;
/* stolen from classic i965 */
/* WM maximum threads is number of EUs times number of threads per EU. */
- if (ilo->gen >= ILO_GEN(7)) {
- if (ilo->gt == 1) {
+ if (ilo->dev->gen >= ILO_GEN(7)) {
+ if (ilo->dev->gt == 1) {
ilo->max_wm_threads = 48;
ilo->max_vs_threads = 36;
ilo->max_gs_threads = 36;
ilo->urb.size = 128;
ilo->urb.max_vs_entries = 512;
ilo->urb.max_gs_entries = 192;
- } else if (ilo->gt == 2) {
+ } else if (ilo->dev->gt == 2) {
ilo->max_wm_threads = 172;
ilo->max_vs_threads = 128;
ilo->max_gs_threads = 128;
@@ -170,8 +157,8 @@ ilo_context_create(struct pipe_screen *screen, void *priv)
} else {
assert(!"Unknown gen7 device.");
}
- } else if (ilo->gen == ILO_GEN(6)) {
- if (ilo->gt == 2) {
+ } else if (ilo->dev->gen == ILO_GEN(6)) {
+ if (ilo->dev->gt == 2) {
ilo->max_wm_threads = 80;
ilo->max_vs_threads = 60;
ilo->max_gs_threads = 60;
@@ -188,10 +175,10 @@ ilo_context_create(struct pipe_screen *screen, void *priv)
}
}
- ilo->cp = ilo_cp_create(ilo->winsys, is->has_llc);
+ ilo->cp = ilo_cp_create(ilo->winsys, is->dev.has_llc);
ilo->shader_cache = ilo_shader_cache_create(ilo->winsys);
if (ilo->cp)
- ilo->hw3d = ilo_3d_create(ilo->cp, ilo->gen, ilo->gt);
+ ilo->hw3d = ilo_3d_create(ilo->cp, ilo->dev->gen, ilo->dev->gt);
if (!ilo->cp || !ilo->shader_cache || !ilo->hw3d) {
ilo_context_destroy(&ilo->base);