Skip to content

Commit

Permalink
Fix init video device. Add device name in accelerant.
Browse files Browse the repository at this point in the history
  • Loading branch information
s40in committed Apr 12, 2021
1 parent 7a153f4 commit 14bafb8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion vmware_video/accelerant/GetAccelerantHook.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ get_accelerant_hook(uint32 feature, void *data)
HOOK(ACCELERANT_CLONE_INFO_SIZE);
HOOK(GET_ACCELERANT_CLONE_INFO);
HOOK(UNINIT_ACCELERANT);
//HOOK(GET_ACCELERANT_DEVICE_INFO);
HOOK(GET_ACCELERANT_DEVICE_INFO);
HOOK(ACCELERANT_RETRACE_SEMAPHORE);

/* mode configuration */
Expand Down
24 changes: 24 additions & 0 deletions vmware_video/accelerant/GetDeviceInfo.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Author:
s40in, 2021
*/

#include <stdio.h>
#include <sys/ioctl.h>
#include <Accelerant.h>

/* Get some info about the device */
status_t GET_ACCELERANT_DEVICE_INFO(accelerant_device_info * adi)
{

/* no info on version is provided, so presumably this is for my info */
adi->version = 1;

sprintf(adi->name, "VMware SVGA");
sprintf(adi->chipset, "VM");
sprintf(adi->serial_no, "None");
//adi->memory = (si->ps.memory_size * 1024);
//adi->dac_speed = si->ps.max_dac1_clock;

return B_OK;
}
1 change: 1 addition & 0 deletions vmware_video/accelerant/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SRCS= Acceleration.c \
EngineManagment.c \
Fifo.c \
GetAccelerantHook.c \
GetDeviceInfo.c \
GetModeInfo.c \
GlobalData.c \
InitAccelerant.c \
Expand Down
3 changes: 2 additions & 1 deletion vmware_video/kernel/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ ControlHook(void *dev, uint32 msg, void *buf, size_t len)
return B_OK;

case VMWARE_FIFO_START:
WriteReg(SVGA_REG_ENABLE, 1);
//WriteReg(SVGA_REG_ENABLE, 1);
WriteReg(SVGA_REG_CONFIG_DONE, 1);
return B_OK;

Expand All @@ -310,6 +310,7 @@ ControlHook(void *dev, uint32 msg, void *buf, size_t len)
WriteReg(SVGA_REG_WIDTH, dm->virtual_width);
WriteReg(SVGA_REG_HEIGHT, dm->virtual_height);
WriteReg(SVGA_REG_BITS_PER_PIXEL, BppForSpace(dm->space));
WriteReg(SVGA_REG_ENABLE, 1); //HAKILO
si->fbOffset = ReadReg(SVGA_REG_FB_OFFSET);
si->bytesPerRow = ReadReg(SVGA_REG_BYTES_PER_LINE);
ReadReg(SVGA_REG_DEPTH);
Expand Down

0 comments on commit 14bafb8

Please sign in to comment.