Link Here
|
|
|
1 |
--- src/nvidia/nvidia_os.c.orig 2017-05-01 21:17:21 UTC |
2 |
+++ src/nvidia/nvidia_os.c |
3 |
@@ -8,6 +8,7 @@ |
4 |
* _NVRM_COPYRIGHT_END_ |
5 |
*/ |
6 |
|
7 |
+#include "opt_syscons.h" |
8 |
#include "nv-misc.h" |
9 |
#include "os-interface.h" |
10 |
#include "nv.h" |
11 |
@@ -16,7 +17,9 @@ |
12 |
#include <sys/consio.h> |
13 |
#include <sys/fbio.h> |
14 |
#include <sys/linker.h> |
15 |
+#ifdef DEV_SC |
16 |
#include <dev/syscons/syscons.h> |
17 |
+#endif |
18 |
|
19 |
// This bootloader metadata interface was added to metadata.h in FreeBSD 10.1 |
20 |
// with commit 3a7cd99956b1 and FreeBSD 11 with commit d2c99117cd3b. |
21 |
@@ -787,29 +790,32 @@ |
22 |
} |
23 |
} |
24 |
#endif |
25 |
+ |
26 |
+#ifdef DEV_VT |
27 |
+ /* TODO */ |
28 |
+#endif |
29 |
+ |
30 |
+#ifdef DEV_SC |
31 |
{ |
32 |
const sc_softc_t *sc = sc_get_softc(0, SC_KERNEL_CONSOLE); |
33 |
+ const struct video_info *vi; |
34 |
|
35 |
- if (sc) |
36 |
+ if (sc && sc->adp) |
37 |
{ |
38 |
- const video_adapter_t *adp = sc->adp; |
39 |
+ vi = &sc->adp->va_info; |
40 |
|
41 |
- if (adp) |
42 |
+ if (vi && (vi->vi_flags & V_INFO_LINEAR)) |
43 |
{ |
44 |
- const struct video_info *vi = &adp->va_info; |
45 |
- |
46 |
- if (vi && (vi->vi_flags & V_INFO_LINEAR)) |
47 |
- { |
48 |
- *pPhysicalAddress = vi->vi_buffer; |
49 |
- *pFbWidth = vi->vi_width; |
50 |
- *pFbHeight = vi->vi_height; |
51 |
- *pFbDepth = vi->vi_depth; |
52 |
- *pFbPitch = adp->va_line_width; |
53 |
- return; |
54 |
- } |
55 |
+ *pPhysicalAddress = vi->vi_buffer; |
56 |
+ *pFbWidth = vi->vi_width; |
57 |
+ *pFbHeight = vi->vi_height; |
58 |
+ *pFbDepth = vi->vi_depth; |
59 |
+ *pFbPitch = sc->adp->va_line_width; |
60 |
+ return; |
61 |
} |
62 |
} |
63 |
} |
64 |
+#endif |
65 |
|
66 |
*pPhysicalAddress = 0; |
67 |
*pFbWidth = *pFbHeight = *pFbDepth = *pFbPitch = 0; |