summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKazutaka YOKOTA <yokota@FreeBSD.org>1999-12-07 11:23:58 +0000
committerKazutaka YOKOTA <yokota@FreeBSD.org>1999-12-07 11:23:58 +0000
commit0be01624315368ccf8659fa0d99edf54379e60f6 (patch)
tree404e26d4b22e22070dbc5f2eeef50ad2fb101eea /sys
parent4332f82d595f37b9ca2b4bb0c4fbaf27543e16a6 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/fb/fb.c8
-rw-r--r--sys/dev/fb/vga.c9
-rw-r--r--sys/i386/isa/vesa.c11
3 files changed, 10 insertions, 18 deletions
diff --git a/sys/dev/fb/fb.c b/sys/dev/fb/fb.c
index 59ac170a88b9..b95003eb2651 100644
--- a/sys/dev/fb/fb.c
+++ b/sys/dev/fb/fb.c
@@ -754,14 +754,6 @@ fb_commonioctl(video_adapter_t *adp, u_long cmd, caddr_t arg)
case FBIO_FINDMODE: /* find a matching video mode */
error = (*vidsw[adp->va_index]->query_mode)(adp,
(video_info_t *)arg);
- if (error < 0) {
- error = EINVAL;
- } else {
- error = (*vidsw[adp->va_index]->get_info)(adp,
- error, (video_info_t *)arg);
- if (error)
- error = ENODEV; /* shouldn't happen */
- }
break;
case FBIO_GETMODE: /* get video mode */
diff --git a/sys/dev/fb/vga.c b/sys/dev/fb/vga.c
index 6c96dae439a7..f733e4745fba 100644
--- a/sys/dev/fb/vga.c
+++ b/sys/dev/fb/vga.c
@@ -1441,11 +1441,10 @@ vga_get_info(video_adapter_t *adp, int mode, video_info_t *info)
static int
vga_query_mode(video_adapter_t *adp, video_info_t *info)
{
- video_info_t buf;
int i;
if (!vga_init_done)
- return -1;
+ return ENXIO;
for (i = 0; bios_vmode[i].vi_mode != EOT; ++i) {
if (bios_vmode[i].vi_mode == NA)
@@ -1475,11 +1474,11 @@ vga_query_mode(video_adapter_t *adp, video_info_t *info)
continue;
/* verify if this mode is supported on this adapter */
- if (vga_get_info(adp, bios_vmode[i].vi_mode, &buf))
+ if (vga_get_info(adp, bios_vmode[i].vi_mode, info))
continue;
- return bios_vmode[i].vi_mode;
+ return 0;
}
- return -1;
+ return ENODEV;
}
/*
diff --git a/sys/i386/isa/vesa.c b/sys/i386/isa/vesa.c
index a2092510e10f..ee2e463aa815 100644
--- a/sys/i386/isa/vesa.c
+++ b/sys/i386/isa/vesa.c
@@ -937,10 +937,10 @@ vesa_query_mode(video_adapter_t *adp, video_info_t *info)
{
int i;
- if ((i = (*prevvidsw->query_mode)(adp, info)) != -1)
- return i;
+ if ((*prevvidsw->query_mode)(adp, info) == 0)
+ return 0;
if (adp != vesa_adp)
- return -1;
+ return ENODEV;
for (i = 0; vesa_vmode[i].vi_mode != EOT; ++i) {
if ((info->vi_width != 0)
@@ -965,9 +965,10 @@ vesa_query_mode(video_adapter_t *adp, video_info_t *info)
if ((info->vi_flags != 0)
&& (info->vi_flags != vesa_vmode[i].vi_flags))
continue;
- return vesa_vmode[i].vi_mode;
+ *info = vesa_vmode[i];
+ return 0;
}
- return -1;
+ return ENODEV;
}
static int