]> git.openpandora.org Git - sgx.git/commitdiff
gpu: pvr: enable render complete events
authorTopi Pohjolainen <topi.pohjolainen@nokia.com>
Tue, 27 Apr 2010 11:14:20 +0000 (13:14 +0200)
committerGrazvydas Ignotas <notasas@gmail.com>
Sun, 20 May 2012 18:09:41 +0000 (21:09 +0300)
In DRM style events are associated with the driver private
part of the driver file descriptor. In order for the poll
and read methods to access the event list one needs to pass
the file private through the IOCTL stack.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@nokia.com>
Signed-off-by: Imre Deak <imre.deak@nokia.com>
pvr/Makefile
pvr/bridged_pvr_bridge.c
pvr/bridged_pvr_bridge.h
pvr/bridged_sgx_bridge.c
pvr/bridged_sgx_bridge.h
pvr/module.c
pvr/pvr_bridge_k.c
pvr/pvrsrv.c
pvr/sgx_bridge.h

index 81db9be5dca772a08a2a373e2b4c1ebc8138c008..48e37d0b6949549587008ae3743e86eb7e7f6d8f 100644 (file)
@@ -10,7 +10,8 @@ pvrsrvkm-objs         := osfunc.o mmap.o module.o pdump.o proc.o         \
                           sgxinit.o sgxreset.o sgxutils.o sgxkick.o       \
                           sgxtransfer.o mmu.o pb.o perproc.o sysconfig.o  \
                           sysutils.o osperproc.o bridged_support.o        \
-                          bridged_sgx_bridge.o sgxpower.o pdump_common.o
+                          bridged_sgx_bridge.o sgxpower.o pdump_common.o  \
+                          pvr_events.o
 
 pvrsrvkm-objs-$(CONFIG_PVR_DEBUG) += pvr_debug.o
 pvrsrvkm-objs-$(CONFIG_PVR_TIMING) += pvr_debug.o
index 2f20554abc72148c1fed381fbd30b52ce7605d0f..573aba049a1b2b77919302883f0464d5252611cf 100644 (file)
@@ -2919,7 +2919,7 @@ static int bridged_check_cmd(u32 cmd_id)
        return 0;
 }
 
-static int bridged_ioctl(u32 cmd, void *in, void *out,
+static int bridged_ioctl(struct file *filp, u32 cmd, void *in, void *out,
                         struct PVRSRV_PER_PROCESS_DATA *per_proc)
 {
        int err = -EFAULT;
@@ -3208,7 +3208,7 @@ static int bridged_ioctl(u32 cmd, void *in, void *out,
                break;
 
        case PVRSRV_BRIDGE_SGX_2DQUERYBLTSCOMPLETE:
-               err = SGX2DQueryBlitsCompleteBW(cmd, in, out, per_proc);
+               err = SGX2DQueryBlitsCompleteBW(filp, cmd, in, out, per_proc);
                break;
 
        case PVRSRV_BRIDGE_SGX_GETMMUPDADDR:
@@ -3290,7 +3290,7 @@ static int bridged_ioctl(u32 cmd, void *in, void *out,
        return err;
 }
 
-int BridgedDispatchKM(struct PVRSRV_PER_PROCESS_DATA *pd,
+int BridgedDispatchKM(struct file *filp, struct PVRSRV_PER_PROCESS_DATA *pd,
                      struct PVRSRV_BRIDGE_PACKAGE *pkg)
 {
 
@@ -3325,7 +3325,7 @@ int BridgedDispatchKM(struct PVRSRV_PER_PROCESS_DATA *pd,
                goto return_fault;
        }
 
-       err = bridged_ioctl(bid, in, out, pd);
+       err = bridged_ioctl(filp, bid, in, out, pd);
 
        if (err < 0)
                goto return_fault;
index 1e35ff419c3cb31714a701a46803f27916029ddd..188fdedf092d3109ba455560a25c220af79ac888 100644 (file)
@@ -151,7 +151,8 @@ extern struct PVRSRV_BRIDGE_GLOBAL_STATS g_BridgeGlobalStats;
 
 enum PVRSRV_ERROR CommonBridgeInit(void);
 
-int BridgedDispatchKM(struct PVRSRV_PER_PROCESS_DATA *psPerProc,
-                     struct PVRSRV_BRIDGE_PACKAGE *psBridgePackageKM);
+int BridgedDispatchKM(struct file *filp,
+                       struct PVRSRV_PER_PROCESS_DATA *psPerProc,
+                       struct PVRSRV_BRIDGE_PACKAGE *psBridgePackageKM);
 
 #endif
index 634fd26b6c964e6d68cbd8f1dfd27413c43657b4..d32d2aad420ac3e71fc4247868f33b2d0029dceb 100644 (file)
@@ -42,6 +42,7 @@
 #include "bridged_sgx_bridge.h"
 #include "sgxutils.h"
 #include "pdump_km.h"
+#include "pvr_events.h"
 
 int SGXGetClientInfoBW(u32 ui32BridgeID,
              struct PVRSRV_BRIDGE_IN_GETCLIENTINFO *psGetClientInfoIN,
@@ -996,7 +997,7 @@ int SGXFlushHWRenderTargetBW(u32 ui32BridgeID,
        return 0;
 }
 
-int SGX2DQueryBlitsCompleteBW(u32 ui32BridgeID,
+int SGX2DQueryBlitsCompleteBW(struct file *filp, u32 ui32BridgeID,
      struct PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE *ps2DQueryBltsCompleteIN,
      struct PVRSRV_BRIDGE_RETURN *psRetOUT,
      struct PVRSRV_PER_PROCESS_DATA *psPerProc)
@@ -1026,6 +1027,16 @@ int SGX2DQueryBlitsCompleteBW(u32 ui32BridgeID,
            (struct PVRSRV_SGXDEV_INFO *)((struct PVRSRV_DEVICE_NODE *)
                                          hDevCookieInt)->pvDevice;
 
+       if (ps2DQueryBltsCompleteIN->type == _PVR_SYNC_WAIT_EVENT) {
+               struct PVRSRV_FILE_PRIVATE_DATA *priv = filp->private_data;
+
+               if (pvr_sync_event_req(priv,
+                               (struct PVRSRV_KERNEL_SYNC_INFO *)pvSyncInfo))
+                       psRetOUT->eError = PVRSRV_ERROR_OUT_OF_MEMORY;
+
+               return 0;
+       }
+
        psRetOUT->eError =
            SGX2DQueryBlitsCompleteKM(psDevInfo,
                                      (struct PVRSRV_KERNEL_SYNC_INFO *)
index 3867dc4aa283abc80f72379893929a28359197f5..aa1e7dcfb54832de97fd0f5894b6eada1955ea1c 100644 (file)
@@ -112,7 +112,7 @@ int SGXFlushHWRenderTargetBW(u32 ui32BridgeID,
        struct PVRSRV_BRIDGE_RETURN *psRetOUT,
        struct PVRSRV_PER_PROCESS_DATA *psPerProc);
 
-int SGX2DQueryBlitsCompleteBW(u32 ui32BridgeID,
+int SGX2DQueryBlitsCompleteBW(struct file *filp, u32 ui32BridgeID,
        struct PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE *ps2DQueryBltsCompleteIN,
        struct PVRSRV_BRIDGE_RETURN *psRetOUT,
        struct PVRSRV_PER_PROCESS_DATA *psPerProc);
index c79b0d919e8dee9ec85c45857584ae1c635930d8..8357fcd0189d5ab311d62fae7ec0b6cd168a1c63 100644 (file)
@@ -52,6 +52,7 @@
 #include "proc.h"
 #include "pvrmodule.h"
 #include "private_data.h"
+#include "pvr_events.h"
 
 #define DRVNAME                "pvrsrvkm"
 
@@ -106,6 +107,8 @@ static int pvr_release(struct inode unref__ * inode, struct file *filp)
 
        priv = filp->private_data;
 
+       pvr_release_events(priv);
+
        PVRSRVProcessDisconnect(priv->ui32OpenPID);
 
        OSFreeMem(PVRSRV_OS_NON_PAGEABLE_HEAP,
@@ -123,6 +126,8 @@ static const struct file_operations pvr_fops = {
        .open           = pvr_open,
        .release        = pvr_release,
        .mmap           = PVRMMap,
+       .poll           = pvr_poll,
+       .read           = pvr_read,
 };
 
 static void pvr_shutdown(struct platform_device *pdev)
@@ -243,6 +248,8 @@ static int __init pvr_init(void)
        if (error < 0)
                goto err4;
 
+       pvr_init_events();
+
        return 0;
 
 err4:
index 70996475f9c7dc5987a0c7e19efca0c2dbcb5b05..eade118df70623c07115e959eca19655556ce1d8 100644 (file)
@@ -123,7 +123,7 @@ unlock_and_return:
 }
 #endif
 
-long PVRSRV_BridgeDispatchKM(struct file *file, unsigned int cmd,
+long PVRSRV_BridgeDispatchKM(struct file *filp, unsigned int cmd,
                             unsigned long arg)
 {
        u32 ui32BridgeID = PVRSRV_GET_BRIDGE_ID(cmd);
@@ -183,7 +183,7 @@ long PVRSRV_BridgeDispatchKM(struct file *file, unsigned int cmd,
        sBridgePackageKM.ui32BridgeID = PVRSRV_GET_BRIDGE_ID(
                                                sBridgePackageKM.ui32BridgeID);
 
-       err = BridgedDispatchKM(psPerProc, &sBridgePackageKM);
+       err = BridgedDispatchKM(filp, psPerProc, &sBridgePackageKM);
        if (err != PVRSRV_OK)
                goto unlock_and_return;
 
index 178f3bcb6e9cf92a3b159a07a988c02e54f110a3..53d09a9729d5036df8c7bb5f41a5ba6e357de955 100644 (file)
@@ -33,6 +33,7 @@
 #include "perproc.h"
 #include "pdump_km.h"
 #include "ra.h"
+#include "pvr_events.h"
 
 #include "pvrversion.h"
 enum PVRSRV_ERROR AllocateDeviceID(struct SYS_DATA *psSysData, u32 *pui32DevID)
@@ -804,6 +805,8 @@ void PVRSRVMISR(void *pvSysData)
                        OSEventObjectSignal(hOSEventKM);
        }
 
+       pvr_handle_sync_events();
+
        pvr_unlock();
 }
 
index 86811beecaf3c104e262f1fc7f9c2bfb1afe3f10..512843d98d77e738a93ee05a3b0f7f12a19073fd 100644 (file)
@@ -219,6 +219,7 @@ struct PVRSRV_BRIDGE_IN_SGXDEVINITPART2 {
 enum pvr_sync_wait_seq_type {
        _PVR_SYNC_WAIT_BLOCK,
        _PVR_SYNC_WAIT_NONBLOCK,
+       _PVR_SYNC_WAIT_EVENT,
 };
 
 struct PVRSRV_BRIDGE_IN_2DQUERYBLTSCOMPLETE {