Rev 4080 | Rev 4570 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4080 | Rev 4111 | ||
---|---|---|---|
Line 24... | Line 24... | ||
24 | uint16_t subdevice_id; |
24 | uint16_t subdevice_id; |
25 | uint32_t device_class; |
25 | uint32_t device_class; |
26 | uint8_t revision; |
26 | uint8_t revision; |
27 | }; |
27 | }; |
Line 28... | Line 28... | ||
28 | 28 | ||
29 | extern struct drm_device *main_device; |
29 | struct drm_device *main_device; |
Line 30... | Line 30... | ||
30 | extern struct drm_file *drm_file_handlers[256]; |
30 | struct drm_file *drm_file_handlers[256]; |
- | 31 | ||
- | 32 | int vmw_init(void); |
|
- | 33 | int kms_init(struct drm_device *dev); |
|
31 | 34 | void kms_update(); |
|
Line 32... | Line 35... | ||
32 | int vmw_init(void); |
35 | |
33 | void cpu_detect(); |
36 | void cpu_detect(); |
Line 59... | Line 62... | ||
59 | int x86_clflush_size; |
62 | int x86_clflush_size; |
60 | unsigned int tsc_khz; |
63 | unsigned int tsc_khz; |
Line 61... | Line 64... | ||
61 | 64 | ||
Line -... | Line 65... | ||
- | 65 | int kms_modeset = 1; |
|
- | 66 | ||
- | 67 | ||
- | 68 | void vmw_driver_thread() |
|
- | 69 | { |
|
- | 70 | dbgprintf("%s\n",__FUNCTION__); |
|
- | 71 | ||
- | 72 | // run_workqueue(dev_priv->wq); |
|
- | 73 | ||
- | 74 | while(driver_wq_state) |
|
- | 75 | { |
|
- | 76 | kms_update(); |
|
- | 77 | delay(1); |
|
- | 78 | }; |
|
- | 79 | __asm__ __volatile__ ( |
|
- | 80 | "int $0x40" |
|
- | 81 | ::"a"(-1)); |
|
62 | int kms_modeset = 1; |
82 | } |
63 | 83 | ||
Line 64... | Line 84... | ||
64 | u32_t __attribute__((externally_visible)) drvEntry(int action, char *cmdline) |
84 | u32_t __attribute__((externally_visible)) drvEntry(int action, char *cmdline) |
Line 78... | Line 98... | ||
78 | if( cmdline && *cmdline ) |
98 | if( cmdline && *cmdline ) |
79 | parse_cmdline(cmdline, log); |
99 | parse_cmdline(cmdline, log); |
Line 80... | Line 100... | ||
80 | 100 | ||
81 | if(!dbg_open(log)) |
101 | if(!dbg_open(log)) |
82 | { |
102 | { |
83 | // strcpy(log, "/tmp1/1/vmw.log"); |
103 | strcpy(log, "/tmp1/1/vmw.log"); |
84 | // strcpy(log, "/RD/1/DRIVERS/VMW.log"); |
104 | // strcpy(log, "/RD/1/DRIVERS/VMW.log"); |
Line 85... | Line 105... | ||
85 | strcpy(log, "/HD0/1/vmw.log"); |
105 | // strcpy(log, "/HD0/1/vmw.log"); |
86 | 106 | ||
87 | if(!dbg_open(log)) |
107 | if(!dbg_open(log)) |
88 | { |
108 | { |
89 | printf("Can't open %s\nExit\n", log); |
109 | printf("Can't open %s\nExit\n", log); |
90 | return 0; |
110 | return 0; |
91 | }; |
111 | }; |
Line 92... | Line 112... | ||
92 | } |
112 | } |
93 | dbgprintf(" vmw v3.10\n cmdline: %s\n", cmdline); |
113 | dbgprintf(" vmw v3.12-rc6\n cmdline: %s\n", cmdline); |
Line 94... | Line 114... | ||
94 | 114 | ||
Line 101... | Line 121... | ||
101 | if(err) |
121 | if(err) |
102 | { |
122 | { |
103 | dbgprintf("Epic Fail :(\n"); |
123 | dbgprintf("Epic Fail :(\n"); |
104 | return 0; |
124 | return 0; |
105 | }; |
125 | }; |
- | 126 | kms_init(main_device); |
|
Line 106... | Line 127... | ||
106 | 127 | ||
Line 107... | Line 128... | ||
107 | err = RegService("DISPLAY", display_handler); |
128 | err = RegService("DISPLAY", display_handler); |
108 | 129 | ||
Line 109... | Line -... | ||
109 | if( err != 0) |
- | |
110 | dbgprintf("Set DISPLAY handler\n"); |
130 | if( err != 0) |
- | 131 | dbgprintf("Set DISPLAY handler\n"); |
|
111 | 132 | ||
Line 112... | Line 133... | ||
112 | // struct drm_i915_private *dev_priv = main_device->dev_private; |
133 | driver_wq_state = 1; |
113 | // driver_wq_state = 1; |
134 | |
Line 444... | Line 465... | ||
444 | */ |
465 | */ |
Line 445... | Line 466... | ||
445 | 466 | ||
446 | #include |
467 | #include |
447 | #include |
468 | #include |
448 | #include |
- | |
449 | #include |
469 | #include |
Line 450... | Line -... | ||
450 | #include |
- | |
451 | - | ||
452 | /** |
- | |
453 | * hdmi_avi_infoframe_init() - initialize an HDMI AVI infoframe |
- | |
454 | * @frame: HDMI AVI infoframe |
- | |
455 | * |
- | |
456 | * Returns 0 on success or a negative error code on failure. |
- | |
457 | */ |
- | |
458 | int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame) |
- | |
459 | { |
- | |
460 | memset(frame, 0, sizeof(*frame)); |
- | |
461 | - | ||
462 | frame->type = HDMI_INFOFRAME_TYPE_AVI; |
- | |
463 | frame->version = 2; |
- | |
464 | frame->length = 13; |
- | |
465 | - | ||
466 | return 0; |
- | |
Line 467... | Line 470... | ||
467 | } |
470 | #include |
468 | 471 | ||
469 | 472 | ||
470 | static void *check_bytes8(const u8 *start, u8 value, unsigned int bytes) |
473 | static void *check_bytes8(const u8 *start, u8 value, unsigned int bytes) |
Line 871... | Line 874... | ||
871 | void (__stdcall *restore_cursor)(int x, int y); |
874 | void (__stdcall *restore_cursor)(int x, int y); |
872 | void (*disable_mouse)(void); |
875 | void (*disable_mouse)(void); |
873 | u32 mask_seqno; |
876 | u32 mask_seqno; |
874 | u32 check_mouse; |
877 | u32 check_mouse; |
875 | u32 check_m_pixel; |
878 | u32 check_m_pixel; |
876 | u32 dirty; |
- | |
877 | void (*update)(void); |
- | |
878 | }; |
879 | }; |
Line -... | Line 880... | ||
- | 880 | ||
879 | 881 | ||
Line 880... | Line 882... | ||
880 | static display_t *os_display; |
882 | static display_t *os_display; |
881 | 883 | ||
882 | static int count_connector_modes(struct drm_connector* connector) |
884 | static int count_connector_modes(struct drm_connector* connector) |
Line 939... | Line 941... | ||
939 | { |
941 | { |
940 | os_display->ddev = dev; |
942 | os_display->ddev = dev; |
941 | os_display->connector = connector; |
943 | os_display->connector = connector; |
942 | os_display->crtc = crtc; |
944 | os_display->crtc = crtc; |
943 | os_display->supported_modes = mode_count; |
945 | os_display->supported_modes = mode_count; |
944 | os_display->update = kms_update; |
946 | // os_display->update = kms_update; |
Line 945... | Line 947... | ||
945 | 947 | ||
Line 946... | Line 948... | ||
946 | // struct intel_crtc *intel_crtc = to_intel_crtc(os_display->crtc); |
948 | // struct intel_crtc *intel_crtc = to_intel_crtc(os_display->crtc); |
947 | 949 | ||
Line 963... | Line 965... | ||
963 | 965 | ||
964 | // select_cursor_kms(os_display->cursor); |
966 | // select_cursor_kms(os_display->cursor); |
965 | }; |
967 | }; |
Line 966... | Line -... | ||
966 | safe_sti(ifl); |
- | |
967 | - | ||
968 | main_device = dev; |
968 | safe_sti(ifl); |
969 | 969 | ||
970 | #ifdef __HWA__ |
970 | #ifdef __HWA__ |
Line 971... | Line 971... | ||
971 | err = init_bitmaps(); |
971 | err = init_bitmaps(); |
Line 1067... | Line 1067... | ||
1067 | }; |
1067 | }; |
Line 1068... | Line 1068... | ||
1068 | 1068 | ||
1069 | return err; |
1069 | return err; |
Line -... | Line 1070... | ||
- | 1070 | }; |
|
- | 1071 | ||
- | 1072 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags) |
|
- | 1073 | { |
|
- | 1074 | struct file *filep; |
|
- | 1075 | int count; |
|
- | 1076 | ||
- | 1077 | filep = malloc(sizeof(*filep)); |
|
- | 1078 | ||
- | 1079 | if(unlikely(filep == NULL)) |
|
- | 1080 | return ERR_PTR(-ENOMEM); |
|
- | 1081 | ||
- | 1082 | count = size / PAGE_SIZE; |
|
- | 1083 | ||
- | 1084 | filep->pages = kzalloc(sizeof(struct page *) * count, 0); |
|
- | 1085 | if(unlikely(filep->pages == NULL)) |
|
- | 1086 | { |
|
- | 1087 | kfree(filep); |
|
- | 1088 | return ERR_PTR(-ENOMEM); |
|
- | 1089 | }; |
|
- | 1090 | ||
- | 1091 | filep->count = count; |
|
- | 1092 | filep->allocated = 0; |
|
- | 1093 | filep->vma = NULL; |
|
- | 1094 | ||
- | 1095 | // printf("%s file %p pages %p count %d\n", |
|
- | 1096 | // __FUNCTION__,filep, filep->pages, count); |
|
- | 1097 | ||
- | 1098 | return filep; |
|
- | 1099 | } |
|
- | 1100 | ||
- | 1101 | struct page *shmem_read_mapping_page_gfp(struct file *filep, |
|
- | 1102 | pgoff_t index, gfp_t gfp) |
|
- | 1103 | { |
|
- | 1104 | struct page *page; |
|
- | 1105 | ||
- | 1106 | // dbgprintf("%s, file %p index %d\n", __FUNCTION__, filep, index); |
|
- | 1107 | ||
- | 1108 | if(unlikely(index >= filep->count)) |
|
- | 1109 | return ERR_PTR(-EINVAL); |
|
- | 1110 | ||
- | 1111 | page = filep->pages[index]; |
|
- | 1112 | ||
- | 1113 | if(unlikely(page == NULL)) |
|
- | 1114 | { |
|
- | 1115 | page = (struct page *)AllocPage(); |
|
- | 1116 | ||
- | 1117 | if(unlikely(page == NULL)) |
|
- | 1118 | return ERR_PTR(-ENOMEM); |
|
- | 1119 | ||
- | 1120 | filep->pages[index] = page; |
|
- | 1121 | }; |
|
- | 1122 | ||
- | 1123 | return page; |