Now About Social Code
summaryrefslogtreecommitdiff
path: root/src/drv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/drv.c')
-rw-r--r--src/drv.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/drv.c b/src/drv.c
index 734eba5..e378e5a 100644
--- a/src/drv.c
+++ b/src/drv.c
@@ -51,6 +51,8 @@ uint32_t *pds_pcd = (uint32_t *)pds_pixel_code_data;
uint32_t *kernel_data_4_buf = (uint32_t*)kernel_data_4;
#include "perctx_3d_2.h"
+#include "pds_pixel_code_data_1.h"
+uint32_t *pds_pcd_1 = (uint32_t*)pds_pixel_code_data_1;
#define UNUSED(x) (void)x
@@ -86,6 +88,7 @@ struct driver_state {
struct mem_alloc ta_data_buffer_2;
struct mem_alloc ta_data_buffer_3;
struct mem_alloc perctx_3d_buffer_2;
+ struct mem_alloc pds_pixel_code_data_1;
IMG_HANDLE hw_render_ctx;
IMG_DEV_VIRTADDR hw_render_ctx_addr;
@@ -450,6 +453,15 @@ static void allocate_memory(struct driver_state *state) {
};
state->pds_pixel_code_data_0 = allocate_memobj(state, &alloc_pds_pixel_code_data_0);
+ PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM alloc_pds_pixel_code_data_1 = {
+ .hDevCookie = state->dev_cookie,
+ .hDevMemHeap = state->pds_pixel_code_data_heap.hDevMemHeap,
+ .ui32Attribs = PVRSRV_MEM_READ | PVRSRV_MEM_WRITE | PVRSRV_MEM_NO_SYNCOBJ,
+ .uSize = 0x80000,
+ .uAlignment = 0x40,
+ };
+ state->pds_pixel_code_data_1 = allocate_memobj(state, &alloc_pds_pixel_code_data_1);
+
PVRSRV_BRIDGE_IN_ALLOCDEVICEMEM alloc_pixel_shader = {
.hDevCookie = state->dev_cookie,
.hDevMemHeap = state->pixel_shader_heap.hDevMemHeap,
@@ -587,6 +599,8 @@ void patch_memory(struct driver_state *state) {
perctx_3d_2,
state->perctx_3d_buffer_2.dev_mem.sClientMemInfo.uAllocSize);
+ /* TODO modify pds_pixel_code_data_1 */
+
/* Modifiy kernel buffer 4 */
/* This buffer is just zeroed out data */
kernel_data_4_buf[6] = state->ta_data_buffer_2.dev_mem.sClientMemInfo.sDevVAddr.uiAddr;
@@ -595,8 +609,8 @@ void patch_memory(struct driver_state *state) {
kernel_data_4_buf[18] = 0x02000000 |
(state->perctx_3d_buffer_2.dev_mem.sClientMemInfo.sDevVAddr.uiAddr - SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE);
- /* TODO need to figure out what buffer this is */
- //kernel_data_4_buf[22] = ;
+ /* This is just pds pixel code data addr with the front 0xdcxxxxx masked off */
+ kernel_data_4_buf[22] = state->pds_pixel_code_data_1 & 0xfffff;
uint32_t modified_pds_addr =
((state->pds_pixel_code_data_0.dev_mem.sClientMemInfo.sDevVAddr.uiAddr & 0xffff) >> 8);