26,10 → 26,13 |
uint8_t revision; |
}; |
|
extern struct drm_device *main_device; |
extern struct drm_file *drm_file_handlers[256]; |
struct drm_device *main_device; |
struct drm_file *drm_file_handlers[256]; |
|
int vmw_init(void); |
int kms_init(struct drm_device *dev); |
void kms_update(); |
|
void cpu_detect(); |
|
void parse_cmdline(char *cmdline, char *log); |
61,6 → 64,23 |
|
int kms_modeset = 1; |
|
|
void vmw_driver_thread() |
{ |
dbgprintf("%s\n",__FUNCTION__); |
|
// run_workqueue(dev_priv->wq); |
|
while(driver_wq_state) |
{ |
kms_update(); |
delay(1); |
}; |
__asm__ __volatile__ ( |
"int $0x40" |
::"a"(-1)); |
} |
|
u32_t __attribute__((externally_visible)) drvEntry(int action, char *cmdline) |
{ |
|
80,9 → 100,9 |
|
if(!dbg_open(log)) |
{ |
// strcpy(log, "/tmp1/1/vmw.log"); |
strcpy(log, "/tmp1/1/vmw.log"); |
// strcpy(log, "/RD/1/DRIVERS/VMW.log"); |
strcpy(log, "/HD0/1/vmw.log"); |
// strcpy(log, "/HD0/1/vmw.log"); |
|
if(!dbg_open(log)) |
{ |
90,7 → 110,7 |
return 0; |
}; |
} |
dbgprintf(" vmw v3.10\n cmdline: %s\n", cmdline); |
dbgprintf(" vmw v3.12-rc6\n cmdline: %s\n", cmdline); |
|
cpu_detect(); |
dbgprintf("\ncache line size %d\n", x86_clflush_size); |
103,6 → 123,7 |
dbgprintf("Epic Fail :(\n"); |
return 0; |
}; |
kms_init(main_device); |
|
err = RegService("DISPLAY", display_handler); |
|
109,10 → 130,10 |
if( err != 0) |
dbgprintf("Set DISPLAY handler\n"); |
|
// struct drm_i915_private *dev_priv = main_device->dev_private; |
// driver_wq_state = 1; |
// run_workqueue(dev_priv->wq); |
driver_wq_state = 1; |
|
CreateKernelThread(vmw_driver_thread); |
|
return err; |
}; |
|
446,27 → 467,9 |
#include <ddk.h> |
#include <linux/mm.h> |
#include <drm/drmP.h> |
#include <linux/hdmi.h> |
#include <linux/ctype.h> |
|
/** |
* hdmi_avi_infoframe_init() - initialize an HDMI AVI infoframe |
* @frame: HDMI AVI infoframe |
* |
* Returns 0 on success or a negative error code on failure. |
*/ |
int hdmi_avi_infoframe_init(struct hdmi_avi_infoframe *frame) |
{ |
memset(frame, 0, sizeof(*frame)); |
|
frame->type = HDMI_INFOFRAME_TYPE_AVI; |
frame->version = 2; |
frame->length = 13; |
|
return 0; |
} |
|
|
static void *check_bytes8(const u8 *start, u8 value, unsigned int bytes) |
{ |
while (bytes) { |
873,10 → 876,9 |
u32 mask_seqno; |
u32 check_mouse; |
u32 check_m_pixel; |
u32 dirty; |
void (*update)(void); |
}; |
|
|
static display_t *os_display; |
|
static int count_connector_modes(struct drm_connector* connector) |
941,7 → 943,7 |
os_display->connector = connector; |
os_display->crtc = crtc; |
os_display->supported_modes = mode_count; |
os_display->update = kms_update; |
// os_display->update = kms_update; |
|
// struct intel_crtc *intel_crtc = to_intel_crtc(os_display->crtc); |
|
965,8 → 967,6 |
}; |
safe_sti(ifl); |
|
main_device = dev; |
|
#ifdef __HWA__ |
err = init_bitmaps(); |
#endif |
1069,3 → 1069,57 |
return err; |
}; |
|
struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags) |
{ |
struct file *filep; |
int count; |
|
filep = malloc(sizeof(*filep)); |
|
if(unlikely(filep == NULL)) |
return ERR_PTR(-ENOMEM); |
|
count = size / PAGE_SIZE; |
|
filep->pages = kzalloc(sizeof(struct page *) * count, 0); |
if(unlikely(filep->pages == NULL)) |
{ |
kfree(filep); |
return ERR_PTR(-ENOMEM); |
}; |
|
filep->count = count; |
filep->allocated = 0; |
filep->vma = NULL; |
|
// printf("%s file %p pages %p count %d\n", |
// __FUNCTION__,filep, filep->pages, count); |
|
return filep; |
} |
|
struct page *shmem_read_mapping_page_gfp(struct file *filep, |
pgoff_t index, gfp_t gfp) |
{ |
struct page *page; |
|
// dbgprintf("%s, file %p index %d\n", __FUNCTION__, filep, index); |
|
if(unlikely(index >= filep->count)) |
return ERR_PTR(-EINVAL); |
|
page = filep->pages[index]; |
|
if(unlikely(page == NULL)) |
{ |
page = (struct page *)AllocPage(); |
|
if(unlikely(page == NULL)) |
return ERR_PTR(-ENOMEM); |
|
filep->pages[index] = page; |
}; |
|
return page; |
}; |
|