summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-09-12 16:53:48 +0800
committerChia-I Wu <[email protected]>2014-09-12 16:58:29 +0800
commit611f09890ee73f9275b99bff1215a91297fe5d5b (patch)
tree3e2307e92e80a6035c7de2f2c3434d4ec9c2002c /src/gallium/drivers/ilo
parent95058bdec31d3faa76be01731a26939f3039a66b (diff)
ilo: careful with empty fb state in ilo_gpe_set_fb()
We cannot pass 0 as the width or height to ilo_gpe_init_view_surface_null().
Diffstat (limited to 'src/gallium/drivers/ilo')
-rw-r--r--src/gallium/drivers/ilo/ilo_gpe_gen6.c5
-rw-r--r--src/gallium/drivers/ilo/ilo_gpe_gen7.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen6.c b/src/gallium/drivers/ilo/ilo_gpe_gen6.c
index c3ba9e37147..4dd5f13982a 100644
--- a/src/gallium/drivers/ilo/ilo_gpe_gen6.c
+++ b/src/gallium/drivers/ilo/ilo_gpe_gen6.c
@@ -1684,6 +1684,8 @@ ilo_gpe_init_view_surface_null_gen6(const struct ilo_dev_info *dev,
ILO_GPE_VALID_GEN(dev, 6, 6);
+ assert(width >= 1 && height >= 1 && depth >= 1);
+
/*
* From the Sandy Bridge PRM, volume 4 part 1, page 71:
*
@@ -2359,7 +2361,8 @@ ilo_gpe_set_fb(const struct ilo_dev_info *dev,
util_copy_framebuffer_state(&fb->state, state);
ilo_gpe_init_view_surface_null(dev,
- state->width, state->height,
+ (state->width) ? state->width : 1,
+ (state->height) ? state->height : 1,
1, 0, &fb->null_rt);
first = NULL;
diff --git a/src/gallium/drivers/ilo/ilo_gpe_gen7.c b/src/gallium/drivers/ilo/ilo_gpe_gen7.c
index 3d3953713da..6f7399b7f42 100644
--- a/src/gallium/drivers/ilo/ilo_gpe_gen7.c
+++ b/src/gallium/drivers/ilo/ilo_gpe_gen7.c
@@ -243,6 +243,8 @@ ilo_gpe_init_view_surface_null_gen7(const struct ilo_dev_info *dev,
ILO_GPE_VALID_GEN(dev, 7, 7.5);
+ assert(width >= 1 && height >= 1 && depth >= 1);
+
/*
* From the Ivy Bridge PRM, volume 4 part 1, page 62:
*