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 |
@@ -15,7 +16,9 @@ |
12 |
|
13 |
#include <sys/consio.h> |
14 |
#include <sys/fbio.h> |
15 |
+#ifdef DEV_SC |
16 |
#include <dev/syscons/syscons.h> |
17 |
+#endif |
18 |
|
19 |
MALLOC_DEFINE(M_NVIDIA, "nvidia", "NVIDIA memory allocations"); |
20 |
TASKQUEUE_DEFINE_THREAD(nvidia); |
21 |
@@ -757,27 +760,29 @@ void NV_API_CALL os_get_screen_info( |
22 |
NvU16 *pFbPitch |
23 |
) |
24 |
{ |
25 |
+ |
26 |
+#ifdef DEV_VT |
27 |
+ /* TODO */ |
28 |
+#endif |
29 |
+ |
30 |
+#ifdef DEV_SC |
31 |
const sc_softc_t *sc = sc_get_softc(0, SC_KERNEL_CONSOLE); |
32 |
+ const struct video_info *vi; |
33 |
|
34 |
- if (sc) |
35 |
+ if (sc && sc->adp) |
36 |
{ |
37 |
- const video_adapter_t *adp = sc->adp; |
38 |
- |
39 |
- if (adp) |
40 |
+ vi = &sc->adp->va_info; |
41 |
+ if (vi && (vi->vi_flags & V_INFO_LINEAR)) |
42 |
{ |
43 |
- const struct video_info *vi = &adp->va_info; |
44 |
- |
45 |
- if (vi && (vi->vi_flags & V_INFO_LINEAR)) |
46 |
- { |
47 |
- *pPhysicalAddress = vi->vi_buffer; |
48 |
- *pFbWidth = vi->vi_width; |
49 |
- *pFbHeight = vi->vi_height; |
50 |
- *pFbDepth = vi->vi_depth; |
51 |
- *pFbPitch = adp->va_line_width; |
52 |
- return; |
53 |
- } |
54 |
+ *pPhysicalAddress = vi->vi_buffer; |
55 |
+ *pFbWidth = vi->vi_width; |
56 |
+ *pFbHeight = vi->vi_height; |
57 |
+ *pFbDepth = vi->vi_depth; |
58 |
+ *pFbPitch = sc->adp->va_line_width; |
59 |
+ return; |
60 |
} |
61 |
} |
62 |
+#endif |
63 |
|
64 |
*pPhysicalAddress = 0; |
65 |
*pFbWidth = *pFbHeight = *pFbDepth = *pFbPitch = 0; |