Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 296539 | Differences between
and this patch

Collapse All | Expand All

(-)a/drivers/video/uvesafb.c (-4 / +9 lines)
Lines 29-34 Link Here
29
#endif
29
#endif
30
#include "edid.h"
30
#include "edid.h"
31
31
32
#define absint(x) ({				\
33
		int __x = (x);			\
34
		(__x < 0) ? -__x : __x;		\
35
	})
36
32
static struct cb_id uvesafb_cn_id = {
37
static struct cb_id uvesafb_cn_id = {
33
	.idx = CN_IDX_V86D,
38
	.idx = CN_IDX_V86D,
34
	.val = CN_VAL_V86D_UVESAFB
39
	.val = CN_VAL_V86D_UVESAFB
Lines 320-328 static int uvesafb_vbe_find_mode(struct uvesafb_par *par, Link Here
320
	int i, match = -1, h = 0, d = 0x7fffffff;
325
	int i, match = -1, h = 0, d = 0x7fffffff;
321
326
322
	for (i = 0; i < par->vbe_modes_cnt; i++) {
327
	for (i = 0; i < par->vbe_modes_cnt; i++) {
323
		h = abs(par->vbe_modes[i].x_res - xres) +
328
		h = absint(par->vbe_modes[i].x_res - xres) +
324
		    abs(par->vbe_modes[i].y_res - yres) +
329
		    absint(par->vbe_modes[i].y_res - yres) +
325
		    abs(depth - par->vbe_modes[i].depth);
330
		    absint(depth - par->vbe_modes[i].depth);
326
331
327
		/*
332
		/*
328
		 * We have an exact match in terms of resolution
333
		 * We have an exact match in terms of resolution
Lines 1375-1381 static int uvesafb_check_var(struct fb_var_screeninfo *var, Link Here
1375
	 * which is theoretically incorrect, but which we'll try to handle
1380
	 * which is theoretically incorrect, but which we'll try to handle
1376
	 * here.
1381
	 * here.
1377
	 */
1382
	 */
1378
	if (depth == 0 || abs(depth - var->bits_per_pixel) >= 8)
1383
	if (depth == 0 || absint(depth - var->bits_per_pixel) >= 8)
1379
		depth = var->bits_per_pixel;
1384
		depth = var->bits_per_pixel;
1380
1385
1381
	match = uvesafb_vbe_find_mode(par, var->xres, var->yres, depth,
1386
	match = uvesafb_vbe_find_mode(par, var->xres, var->yres, depth,

Return to bug 296539