From ec79187d9a23ba30eafc7ba225049559e6bcb78d Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 5 Jun 2012 14:41:18 +0100 Subject: [PATCH] modesetting: workaround kernel bug reporting 0x0 as valid mins It reports these but then you can't create a 0 sized bo. Signed-off-by: Dave Airlie --- hw/xfree86/drivers/modesetting/drmmode_display.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index c0cc06b34..185bfe933 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -1379,6 +1379,10 @@ void drmmode_get_default_bpp(ScrnInfoPtr pScrn, drmmode_ptr drmmode, int *depth, if (!mode_res) return; + if (mode_res->min_width == 0) + mode_res->min_width = 1; + if (mode_res->min_height == 0) + mode_res->min_height = 1; /*create a bo */ bo = dumb_bo_create(drmmode->fd, mode_res->min_width, mode_res->min_height, 32); if (!bo) {