summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew F. Davis2020-01-20 16:43:34 -0600
committerGowtham Tammana2020-02-06 19:17:42 -0600
commit1cc2eded30f83bfce58c8ccc8cd61005addf9c0b (patch)
tree9bc01c717f4d2c6b2efba0685b4c54e49c0dbd4e
parent2a777b8fb72a89d299b82845d42b63b2a2618daa (diff)
downloadomap5-sgx-ddk-linux-1cc2eded30f83bfce58c8ccc8cd61005addf9c0b.tar.gz
omap5-sgx-ddk-linux-1cc2eded30f83bfce58c8ccc8cd61005addf9c0b.tar.xz
omap5-sgx-ddk-linux-1cc2eded30f83bfce58c8ccc8cd61005addf9c0b.zip
km: Migrate to kernel version 5.4
The major changes include: - reservation_object renamed to dma_resv - dma_resv_reserve_shared takes new 'num_fences' parameter - vm_insert_mixed removed, use vmf_insert_mixed instead - access_ok does not need direction parameter - drm_dev_unref renamed to drm_dev_put - platform data for reset control no longer needed Signed-off-by: Andrew F. Davis <afd@ti.com>
-rw-r--r--eurasia_km/services4/srvkm/env/linux/dmabuf.h4
-rw-r--r--eurasia_km/services4/srvkm/env/linux/mmap.c13
-rw-r--r--eurasia_km/services4/srvkm/env/linux/module.c17
-rw-r--r--eurasia_km/services4/srvkm/env/linux/osfunc.c15
-rw-r--r--eurasia_km/services4/srvkm/env/linux/pvr_drm.c36
-rw-r--r--eurasia_km/services4/srvkm/env/linux/pvr_linux_fence.c84
-rw-r--r--eurasia_km/services4/srvkm/env/linux/pvr_uaccess.h4
7 files changed, 60 insertions, 113 deletions
diff --git a/eurasia_km/services4/srvkm/env/linux/dmabuf.h b/eurasia_km/services4/srvkm/env/linux/dmabuf.h
index 9a09464..b0007f6 100644
--- a/eurasia_km/services4/srvkm/env/linux/dmabuf.h
+++ b/eurasia_km/services4/srvkm/env/linux/dmabuf.h
@@ -50,12 +50,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
50#include "servicesext.h" 50#include "servicesext.h"
51 51
52#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)) 52#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0))
53#include <linux/reservation.h> 53#include <linux/dma-resv.h>
54#include "pvr_bridge.h" 54#include "pvr_bridge.h"
55 55
56struct dmabuf_resvinfo 56struct dmabuf_resvinfo
57{ 57{
58 struct reservation_object *resv; 58 struct dma_resv *resv;
59}; 59};
60 60
61static inline void *DmaBufGetReservationObject(IMG_HANDLE hSync) 61static inline void *DmaBufGetReservationObject(IMG_HANDLE hSync)
diff --git a/eurasia_km/services4/srvkm/env/linux/mmap.c b/eurasia_km/services4/srvkm/env/linux/mmap.c
index 3a2a16b..0c3fe26 100644
--- a/eurasia_km/services4/srvkm/env/linux/mmap.c
+++ b/eurasia_km/services4/srvkm/env/linux/mmap.c
@@ -709,7 +709,7 @@ DoMapToUser(LinuxMemArea *psLinuxMemArea,
709 * that attempt to interpret it). 709 * that attempt to interpret it).
710 * The only alternative is to use VM_INSERT_PAGE, which requires 710 * The only alternative is to use VM_INSERT_PAGE, which requires
711 * finding the page structure corresponding to each page, or 711 * finding the page structure corresponding to each page, or
712 * if mixed maps are supported (VM_MIXEDMAP), vm_insert_mixed. 712 * if mixed maps are supported (VM_MIXEDMAP), vmf_insert_mixed.
713 */ 713 */
714 IMG_UINTPTR_T ulVMAPos; 714 IMG_UINTPTR_T ulVMAPos;
715 IMG_UINTPTR_T uiByteEnd = uiByteOffset + uiByteSize; 715 IMG_UINTPTR_T uiByteEnd = uiByteOffset + uiByteSize;
@@ -766,7 +766,7 @@ DoMapToUser(LinuxMemArea *psLinuxMemArea,
766 for(uiPA = uiByteOffset; uiPA < uiByteEnd; uiPA += PAGE_SIZE) 766 for(uiPA = uiByteOffset; uiPA < uiByteEnd; uiPA += PAGE_SIZE)
767 { 767 {
768 IMG_UINTPTR_T pfn; 768 IMG_UINTPTR_T pfn;
769 IMG_INT result; 769 IMG_INT result = 0;
770 IMG_BOOL bMapPage = IMG_TRUE; 770 IMG_BOOL bMapPage = IMG_TRUE;
771 771
772 if (psLinuxMemArea->hBMHandle) 772 if (psLinuxMemArea->hBMHandle)
@@ -785,7 +785,14 @@ DoMapToUser(LinuxMemArea *psLinuxMemArea,
785#if defined(PVR_MAKE_ALL_PFNS_SPECIAL) 785#if defined(PVR_MAKE_ALL_PFNS_SPECIAL)
786 if (bMixedMap) 786 if (bMixedMap)
787 { 787 {
788#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0)) 788#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,20,0))
789 pfn_t pfns = { pfn };
790 vm_fault_t vmf;
791
792 vmf = vmf_insert_mixed(ps_vma, ulVMAPos, pfns);
793 if (vmf & VM_FAULT_ERROR)
794 result = vm_fault_to_errno(vmf, 0);
795#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(4,5,0))
789 pfn_t pfns = { pfn }; 796 pfn_t pfns = { pfn };
790 797
791 result = vm_insert_mixed(ps_vma, ulVMAPos, pfns); 798 result = vm_insert_mixed(ps_vma, ulVMAPos, pfns);
diff --git a/eurasia_km/services4/srvkm/env/linux/module.c b/eurasia_km/services4/srvkm/env/linux/module.c
index d7a0268..c7b3c50 100644
--- a/eurasia_km/services4/srvkm/env/linux/module.c
+++ b/eurasia_km/services4/srvkm/env/linux/module.c
@@ -47,10 +47,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
47#endif 47#endif
48#endif 48#endif
49 49
50#if (AM_VERSION == 3) || (AM_VERSION == 4)
51#include <linux/platform_data/sgx-omap.h>
52#endif
53
54#if defined(SUPPORT_DRI_DRM) && !defined(SUPPORT_DRI_DRM_PLUGIN) 50#if defined(SUPPORT_DRI_DRM) && !defined(SUPPORT_DRI_DRM_PLUGIN)
55#define PVR_MOD_STATIC 51#define PVR_MOD_STATIC
56#else 52#else
@@ -372,21 +368,8 @@ static int __devinit PVRSRVDriverProbe(LDM_DEV *pDevice, const struct pci_device
372#endif 368#endif
373{ 369{
374 SYS_DATA *psSysData; 370 SYS_DATA *psSysData;
375#if (AM_VERSION == 3) || (AM_VERSION == 4)
376 int ret;
377 struct device *dev = &pDevice->dev;
378 struct gfx_sgx_platform_data *pdata = dev->platform_data;
379#endif
380 371
381 PVR_TRACE(("PVRSRVDriverProbe(pDevice=%p)", pDevice)); 372 PVR_TRACE(("PVRSRVDriverProbe(pDevice=%p)", pDevice));
382#if (AM_VERSION == 3) || (AM_VERSION == 4)
383 if (pdata && pdata->deassert_reset) {
384 ret = pdata->deassert_reset(pDevice, pdata->reset_name);
385 if (ret) {
386 dev_err(dev, "Unable to reset SGX!\n");
387 }
388 }
389#endif
390 373
391#if 0 /* INTEGRATION_POINT */ 374#if 0 /* INTEGRATION_POINT */
392 /* Some systems require device-specific system initialisation. 375 /* Some systems require device-specific system initialisation.
diff --git a/eurasia_km/services4/srvkm/env/linux/osfunc.c b/eurasia_km/services4/srvkm/env/linux/osfunc.c
index aa558d1..5d54b95 100644
--- a/eurasia_km/services4/srvkm/env/linux/osfunc.c
+++ b/eurasia_km/services4/srvkm/env/linux/osfunc.c
@@ -3420,19 +3420,8 @@ PVRSRV_ERROR OSCopyFromUser( IMG_PVOID pvProcess,
3420******************************************************************************/ 3420******************************************************************************/
3421IMG_BOOL OSAccessOK(IMG_VERIFY_TEST eVerification, IMG_VOID *pvUserPtr, IMG_SIZE_T uiBytes) 3421IMG_BOOL OSAccessOK(IMG_VERIFY_TEST eVerification, IMG_VOID *pvUserPtr, IMG_SIZE_T uiBytes)
3422{ 3422{
3423 IMG_INT linuxType; 3423 (void)eVerification; /* unused */
3424 3424 return access_ok(pvUserPtr, uiBytes);
3425 if (eVerification == PVR_VERIFY_READ)
3426 {
3427 linuxType = VERIFY_READ;
3428 }
3429 else
3430 {
3431 PVR_ASSERT(eVerification == PVR_VERIFY_WRITE);
3432 linuxType = VERIFY_WRITE;
3433 }
3434
3435 return access_ok(linuxType, pvUserPtr, uiBytes);
3436} 3425}
3437 3426
3438typedef enum _eWrapMemType_ 3427typedef enum _eWrapMemType_
diff --git a/eurasia_km/services4/srvkm/env/linux/pvr_drm.c b/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
index 7a7e628..f479f89 100644
--- a/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
+++ b/eurasia_km/services4/srvkm/env/linux/pvr_drm.c
@@ -49,10 +49,6 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
49#endif 49#endif
50#endif 50#endif
51 51
52#if (AM_VERSION == 3) || (AM_VERSION == 4)
53#include <linux/platform_data/sgx-omap.h>
54#endif
55
56#include <linux/init.h> 52#include <linux/init.h>
57#include <linux/kernel.h> 53#include <linux/kernel.h>
58#include <linux/module.h> 54#include <linux/module.h>
@@ -272,13 +268,6 @@ exit:
272DRI_DRM_STATIC void 268DRI_DRM_STATIC void
273PVRSRVDrmUnload(struct drm_device *dev) 269PVRSRVDrmUnload(struct drm_device *dev)
274{ 270{
275#if (AM_VERSION == 3) || (AM_VERSION == 4)
276 int ret;
277 struct device *pDev = dev->dev;
278 struct platform_device *pDevice = to_platform_device(pDev);
279 struct gfx_sgx_platform_data *pdata = pDev->platform_data;
280#endif
281
282 PVR_TRACE(("PVRSRVDrmUnload")); 271 PVR_TRACE(("PVRSRVDrmUnload"));
283 272
284#if defined(DISPLAY_CONTROLLER) 273#if defined(DISPLAY_CONTROLLER)
@@ -287,15 +276,6 @@ PVRSRVDrmUnload(struct drm_device *dev)
287 276
288 PVRCore_Cleanup(); 277 PVRCore_Cleanup();
289 278
290#if (AM_VERSION == 3) || (AM_VERSION == 4)
291 if (pdata && pdata->assert_reset) {
292 ret = pdata->assert_reset(pDevice, pdata->reset_name);
293 if (ret) {
294 dev_err(pDev, "Unable to reset SGX!\n");
295 }
296 }
297#endif
298
299#if defined(PDUMP) 279#if defined(PDUMP)
300 dbgdrv_cleanup(); 280 dbgdrv_cleanup();
301#endif 281#endif
@@ -705,21 +685,9 @@ PVRSRVDrmProbe(struct platform_device *pDevice)
705 int ret; 685 int ret;
706 struct device *dev = &pDevice->dev; 686 struct device *dev = &pDevice->dev;
707 struct drm_device *drm_dev; 687 struct drm_device *drm_dev;
708#if (AM_VERSION == 3) || (AM_VERSION == 4)
709 struct gfx_sgx_platform_data *pdata = dev->platform_data;
710#endif
711 688
712 PVR_TRACE(("PVRSRVDrmProbe")); 689 PVR_TRACE(("PVRSRVDrmProbe"));
713 690
714#if (AM_VERSION == 3) || (AM_VERSION == 4)
715 if (pdata && pdata->deassert_reset) {
716 ret = pdata->deassert_reset(pDevice, pdata->reset_name);
717 if (ret) {
718 dev_err(dev, "Unable to reset SGX!\n");
719 }
720 }
721#endif
722
723 LinuxSetCMARegion(of_reserved_mem_device_init(&pDevice->dev) ? 691 LinuxSetCMARegion(of_reserved_mem_device_init(&pDevice->dev) ?
724 IMG_FALSE: IMG_TRUE); 692 IMG_FALSE: IMG_TRUE);
725 693
@@ -736,7 +704,7 @@ PVRSRVDrmProbe(struct platform_device *pDevice)
736 ret = drm_dev_register(drm_dev, 0); 704 ret = drm_dev_register(drm_dev, 0);
737 if (ret != 0) { 705 if (ret != 0) {
738 dev_err(dev, "Unable to register SGX DRM device\n"); 706 dev_err(dev, "Unable to register SGX DRM device\n");
739 drm_dev_unref(drm_dev); 707 drm_dev_put(drm_dev);
740 } 708 }
741 709
742 return ret; 710 return ret;
@@ -754,7 +722,7 @@ PVRSRVDrmRemove(struct platform_device *pDevice)
754 PVR_TRACE(("PVRSRVDrmRemove")); 722 PVR_TRACE(("PVRSRVDrmRemove"));
755 723
756 drm_dev_unregister(drm_dev); 724 drm_dev_unregister(drm_dev);
757 drm_dev_unref(drm_dev); 725 drm_dev_put(drm_dev);
758 726
759 return 0; 727 return 0;
760} 728}
diff --git a/eurasia_km/services4/srvkm/env/linux/pvr_linux_fence.c b/eurasia_km/services4/srvkm/env/linux/pvr_linux_fence.c
index cf9b4b8..c3c2fdf 100644
--- a/eurasia_km/services4/srvkm/env/linux/pvr_linux_fence.c
+++ b/eurasia_km/services4/srvkm/env/linux/pvr_linux_fence.c
@@ -60,7 +60,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
60#else 60#else
61#include <linux/fence.h> 61#include <linux/fence.h>
62#endif 62#endif
63#include <linux/reservation.h> 63#include <linux/dma-resv.h>
64#include <linux/list.h> 64#include <linux/list.h>
65 65
66#include "dmabuf.h" 66#include "dmabuf.h"
@@ -410,10 +410,10 @@ static inline int update_reservation_return_value(int ret, bool blocked_on_write
410 return ret < 0 ? ret : (ret ? 0 : (blocked_on_write ? BLOCKED_ON_WRITE : BLOCKED_ON_READ)); 410 return ret < 0 ? ret : (ret ? 0 : (blocked_on_write ? BLOCKED_ON_WRITE : BLOCKED_ON_READ));
411} 411}
412 412
413static int update_reservation_object_fences_dst(struct pvr_fence_frame *pvr_fence_frame, 413static int update_dma_resv_fences_dst(struct pvr_fence_frame *pvr_fence_frame,
414 struct reservation_object *resv) 414 struct dma_resv *resv)
415{ 415{
416 struct reservation_object_list *flist; 416 struct dma_resv_list *flist;
417#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) 417#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
418 struct dma_fence *fence_to_signal; 418 struct dma_fence *fence_to_signal;
419#else 419#else
@@ -424,7 +424,7 @@ static int update_reservation_object_fences_dst(struct pvr_fence_frame *pvr_fenc
424 unsigned i; 424 unsigned i;
425 int ret; 425 int ret;
426 426
427 flist = reservation_object_get_list(resv); 427 flist = dma_resv_get_list(resv);
428 shared_fence_count = flist ? flist->shared_count : 0; 428 shared_fence_count = flist ? flist->shared_count : 0;
429 429
430 fence_to_signal = create_fence_to_signal(pvr_fence_frame); 430 fence_to_signal = create_fence_to_signal(pvr_fence_frame);
@@ -435,16 +435,16 @@ static int update_reservation_object_fences_dst(struct pvr_fence_frame *pvr_fenc
435 435
436 if (!pvr_fence_frame->have_blocking_fences) 436 if (!pvr_fence_frame->have_blocking_fences)
437 { 437 {
438 reservation_object_add_excl_fence(resv, fence_to_signal); 438 dma_resv_add_excl_fence(resv, fence_to_signal);
439 return 0; 439 return 0;
440 } 440 }
441 441
442 if (!shared_fence_count) 442 if (!shared_fence_count)
443 { 443 {
444#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) 444#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
445 struct dma_fence *fence = reservation_object_get_excl(resv); 445 struct dma_fence *fence = dma_resv_get_excl(resv);
446#else 446#else
447 struct fence *fence = reservation_object_get_excl(resv); 447 struct fence *fence = dma_resv_get_excl(resv);
448#endif 448#endif
449 449
450 if (fence && is_blocking_fence(fence, pvr_fence_frame)) 450 if (fence && is_blocking_fence(fence, pvr_fence_frame))
@@ -468,7 +468,7 @@ static int update_reservation_object_fences_dst(struct pvr_fence_frame *pvr_fenc
468 ret = 1; 468 ret = 1;
469 } 469 }
470 470
471 reservation_object_add_excl_fence(resv, fence_to_signal); 471 dma_resv_add_excl_fence(resv, fence_to_signal);
472 return update_reservation_return_value(ret, true); 472 return update_reservation_return_value(ret, true);
473 } 473 }
474 474
@@ -476,9 +476,9 @@ static int update_reservation_object_fences_dst(struct pvr_fence_frame *pvr_fenc
476 { 476 {
477 477
478#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) 478#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
479 struct dma_fence *fence = rcu_dereference_protected(flist->shared[i], reservation_object_held(resv)); 479 struct dma_fence *fence = rcu_dereference_protected(flist->shared[i], dma_resv_held(resv));
480#else 480#else
481 struct fence *fence = rcu_dereference_protected(flist->shared[i], reservation_object_held(resv)); 481 struct fence *fence = rcu_dereference_protected(flist->shared[i], dma_resv_held(resv));
482#endif 482#endif
483 483
484 if (is_blocking_fence(fence, pvr_fence_frame)) 484 if (is_blocking_fence(fence, pvr_fence_frame))
@@ -495,9 +495,9 @@ static int update_reservation_object_fences_dst(struct pvr_fence_frame *pvr_fenc
495 for (i = 0; i < blocking_fence_count; i++) 495 for (i = 0; i < blocking_fence_count; i++)
496 { 496 {
497#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) 497#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
498 struct dma_fence *fence = rcu_dereference_protected(flist->shared[i], reservation_object_held(resv)); 498 struct dma_fence *fence = rcu_dereference_protected(flist->shared[i], dma_resv_held(resv));
499#else 499#else
500 struct fence *fence = rcu_dereference_protected(flist->shared[i], reservation_object_held(resv)); 500 struct fence *fence = rcu_dereference_protected(flist->shared[i], dma_resv_held(resv));
501#endif 501#endif
502 502
503 if (is_blocking_fence(fence, pvr_fence_frame)) 503 if (is_blocking_fence(fence, pvr_fence_frame))
@@ -520,14 +520,14 @@ static int update_reservation_object_fences_dst(struct pvr_fence_frame *pvr_fenc
520 } 520 }
521 } 521 }
522 522
523 reservation_object_add_excl_fence(resv, fence_to_signal); 523 dma_resv_add_excl_fence(resv, fence_to_signal);
524 return update_reservation_return_value(ret, false); 524 return update_reservation_return_value(ret, false);
525} 525}
526 526
527static int update_reservation_object_fences_src(struct pvr_fence_frame *pvr_fence_frame, 527static int update_dma_resv_fences_src(struct pvr_fence_frame *pvr_fence_frame,
528 struct reservation_object *resv) 528 struct dma_resv *resv)
529{ 529{
530 struct reservation_object_list *flist; 530 struct dma_resv_list *flist;
531#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) 531#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
532 struct dma_fence *fence_to_signal = NULL; 532 struct dma_fence *fence_to_signal = NULL;
533 struct dma_fence *blocking_fence = NULL; 533 struct dma_fence *blocking_fence = NULL;
@@ -542,7 +542,7 @@ static int update_reservation_object_fences_src(struct pvr_fence_frame *pvr_fenc
542 542
543 if (!pvr_fence_frame->have_blocking_fences) 543 if (!pvr_fence_frame->have_blocking_fences)
544 { 544 {
545 ret = reservation_object_reserve_shared(resv); 545 ret = dma_resv_reserve_shared(resv, 1);
546 if (ret) 546 if (ret)
547 { 547 {
548 return ret; 548 return ret;
@@ -554,12 +554,12 @@ static int update_reservation_object_fences_src(struct pvr_fence_frame *pvr_fenc
554 return -ENOMEM; 554 return -ENOMEM;
555 } 555 }
556 556
557 reservation_object_add_shared_fence(resv, fence_to_signal); 557 dma_resv_add_shared_fence(resv, fence_to_signal);
558 558
559 return 0; 559 return 0;
560 } 560 }
561 561
562 flist = reservation_object_get_list(resv); 562 flist = dma_resv_get_list(resv);
563 shared_fence_count = flist ? flist->shared_count : 0; 563 shared_fence_count = flist ? flist->shared_count : 0;
564 564
565 /* 565 /*
@@ -571,9 +571,9 @@ static int update_reservation_object_fences_src(struct pvr_fence_frame *pvr_fenc
571 for (i = 0; i < shared_fence_count; i++) 571 for (i = 0; i < shared_fence_count; i++)
572 { 572 {
573#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) 573#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
574 struct dma_fence *fence = rcu_dereference_protected(flist->shared[i], reservation_object_held(resv)); 574 struct dma_fence *fence = rcu_dereference_protected(flist->shared[i], dma_resv_held(resv));
575#else 575#else
576 struct fence *fence = rcu_dereference_protected(flist->shared[i], reservation_object_held(resv)); 576 struct fence *fence = rcu_dereference_protected(flist->shared[i], dma_resv_held(resv));
577#endif 577#endif
578 578
579 if (is_pvr_fence(fence)) 579 if (is_pvr_fence(fence))
@@ -590,7 +590,7 @@ static int update_reservation_object_fences_src(struct pvr_fence_frame *pvr_fenc
590 590
591 if (reserve) 591 if (reserve)
592 { 592 {
593 ret = reservation_object_reserve_shared(resv); 593 ret = dma_resv_reserve_shared(resv, 1);
594 if (ret) 594 if (ret)
595 { 595 {
596 return ret; 596 return ret;
@@ -606,9 +606,9 @@ static int update_reservation_object_fences_src(struct pvr_fence_frame *pvr_fenc
606 if (!blocking_fence && !shared_fence_count) 606 if (!blocking_fence && !shared_fence_count)
607 { 607 {
608#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) 608#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
609 struct dma_fence *fence = reservation_object_get_excl(resv); 609 struct dma_fence *fence = dma_resv_get_excl(resv);
610#else 610#else
611 struct fence *fence = reservation_object_get_excl(resv); 611 struct fence *fence = dma_resv_get_excl(resv);
612#endif 612#endif
613 613
614 if (fence && is_blocking_fence(fence, pvr_fence_frame)) 614 if (fence && is_blocking_fence(fence, pvr_fence_frame))
@@ -639,7 +639,7 @@ static int update_reservation_object_fences_src(struct pvr_fence_frame *pvr_fenc
639 ret = 1; 639 ret = 1;
640 } 640 }
641 641
642 reservation_object_add_shared_fence(resv, fence_to_signal); 642 dma_resv_add_shared_fence(resv, fence_to_signal);
643 643
644 return update_reservation_return_value(ret, !shared_fence_count); 644 return update_reservation_return_value(ret, !shared_fence_count);
645} 645}
@@ -860,7 +860,7 @@ IMG_HANDLE PVRLinuxFenceContextCreate(PVRSRV_KERNEL_SYNC_INFO *psSyncInfo, IMG_H
860 return (IMG_HANDLE)pvr_fence_context; 860 return (IMG_HANDLE)pvr_fence_context;
861} 861}
862 862
863static int process_reservation_object(struct pvr_fence_context *pvr_fence_context, struct reservation_object *resv, bool is_dst, u32 tag, bool have_blocking_fences) 863static int process_reservation_object(struct pvr_fence_context *pvr_fence_context, struct dma_resv *resv, bool is_dst, u32 tag, bool have_blocking_fences)
864{ 864{
865 PVRSRV_KERNEL_SYNC_INFO *psSyncInfo = pvr_fence_context->psSyncInfo; 865 PVRSRV_KERNEL_SYNC_INFO *psSyncInfo = pvr_fence_context->psSyncInfo;
866 struct pvr_fence_frame *pvr_fence_frame; 866 struct pvr_fence_frame *pvr_fence_frame;
@@ -880,8 +880,8 @@ static int process_reservation_object(struct pvr_fence_context *pvr_fence_contex
880 INIT_LIST_HEAD(&pvr_fence_frame->fence_frame_list); 880 INIT_LIST_HEAD(&pvr_fence_frame->fence_frame_list);
881 881
882 ret = is_dst ? 882 ret = is_dst ?
883 update_reservation_object_fences_dst(pvr_fence_frame, resv) : 883 update_dma_resv_fences_dst(pvr_fence_frame, resv) :
884 update_reservation_object_fences_src(pvr_fence_frame, resv); 884 update_dma_resv_fences_src(pvr_fence_frame, resv);
885 if (ret < 0) 885 if (ret < 0)
886 { 886 {
887 kfree(pvr_fence_frame); 887 kfree(pvr_fence_frame);
@@ -915,7 +915,7 @@ static int process_reservation_object(struct pvr_fence_context *pvr_fence_contex
915static int process_syncinfo(PVRSRV_KERNEL_SYNC_INFO *psSyncInfo, bool is_dst, u32 tag, bool have_blocking_fences) 915static int process_syncinfo(PVRSRV_KERNEL_SYNC_INFO *psSyncInfo, bool is_dst, u32 tag, bool have_blocking_fences)
916{ 916{
917 struct pvr_fence_context *pvr_fence_context = (struct pvr_fence_context *)psSyncInfo->hFenceContext; 917 struct pvr_fence_context *pvr_fence_context = (struct pvr_fence_context *)psSyncInfo->hFenceContext;
918 struct reservation_object *resv; 918 struct dma_resv *resv;
919 int ret = 0; 919 int ret = 0;
920 920
921 if (!pvr_fence_context) 921 if (!pvr_fence_context)
@@ -982,11 +982,11 @@ static inline bool fence_is_blocking(const struct fence *fence,
982 return true; 982 return true;
983} 983}
984 984
985static bool resv_is_blocking(struct reservation_object *resv, 985static bool resv_is_blocking(struct dma_resv *resv,
986 const PVRSRV_KERNEL_SYNC_INFO *psSyncInfo, 986 const PVRSRV_KERNEL_SYNC_INFO *psSyncInfo,
987 bool is_dst) 987 bool is_dst)
988{ 988{
989 struct reservation_object_list *flist; 989 struct dma_resv_list *flist;
990#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0)) 990#if (LINUX_VERSION_CODE >= KERNEL_VERSION(4,10,0))
991 struct dma_fence *fence; 991 struct dma_fence *fence;
992#else 992#else
@@ -1070,7 +1070,7 @@ static unsigned count_reservation_objects(unsigned num_syncs,
1070 pvr_fence_context = (struct pvr_fence_context *)psSyncInfo->hFenceContext; 1070 pvr_fence_context = (struct pvr_fence_context *)psSyncInfo->hFenceContext;
1071 if (pvr_fence_context) 1071 if (pvr_fence_context)
1072 { 1072 {
1073 struct reservation_object *resv; 1073 struct dma_resv *resv;
1074 1074
1075 if ((resv = DmaBufGetReservationObject(pvr_fence_context->hNativeSync))) 1075 if ((resv = DmaBufGetReservationObject(pvr_fence_context->hNativeSync)))
1076 { 1076 {
@@ -1091,7 +1091,7 @@ static unsigned count_reservation_objects(unsigned num_syncs,
1091} 1091}
1092 1092
1093static unsigned get_reservation_objects(unsigned num_resvs, 1093static unsigned get_reservation_objects(unsigned num_resvs,
1094 struct reservation_object **resvs, 1094 struct dma_resv **resvs,
1095 unsigned num_syncs, 1095 unsigned num_syncs,
1096 IMG_HANDLE *phSyncInfo, 1096 IMG_HANDLE *phSyncInfo,
1097 const IMG_BOOL *pbEnabled) 1097 const IMG_BOOL *pbEnabled)
@@ -1113,7 +1113,7 @@ static unsigned get_reservation_objects(unsigned num_resvs,
1113 pvr_fence_context = (struct pvr_fence_context *)psSyncInfo->hFenceContext; 1113 pvr_fence_context = (struct pvr_fence_context *)psSyncInfo->hFenceContext;
1114 if (pvr_fence_context) 1114 if (pvr_fence_context)
1115 { 1115 {
1116 struct reservation_object *resv; 1116 struct dma_resv *resv;
1117 1117
1118 if ((resv = DmaBufGetReservationObject(pvr_fence_context->hNativeSync))) 1118 if ((resv = DmaBufGetReservationObject(pvr_fence_context->hNativeSync)))
1119 { 1119 {
@@ -1127,7 +1127,7 @@ static unsigned get_reservation_objects(unsigned num_resvs,
1127} 1127}
1128 1128
1129static void get_all_reservation_objects(unsigned num_resvs, 1129static void get_all_reservation_objects(unsigned num_resvs,
1130 struct reservation_object **resvs, 1130 struct dma_resv **resvs,
1131 IMG_UINT32 ui32NumSrcSyncs, 1131 IMG_UINT32 ui32NumSrcSyncs,
1132 IMG_HANDLE *phSrcSyncInfo, 1132 IMG_HANDLE *phSrcSyncInfo,
1133 const IMG_BOOL *pbSrcEnabled, 1133 const IMG_BOOL *pbSrcEnabled,
@@ -1151,7 +1151,7 @@ static void get_all_reservation_objects(unsigned num_resvs,
1151} 1151}
1152 1152
1153static void unlock_reservation_objects(unsigned num_resvs, 1153static void unlock_reservation_objects(unsigned num_resvs,
1154 struct reservation_object **resvs) 1154 struct dma_resv **resvs)
1155{ 1155{
1156 unsigned i; 1156 unsigned i;
1157 1157
@@ -1167,8 +1167,8 @@ static void unlock_reservation_objects(unsigned num_resvs,
1167static int lock_reservation_objects_no_retry(struct ww_acquire_ctx *ww_acquire_ctx, 1167static int lock_reservation_objects_no_retry(struct ww_acquire_ctx *ww_acquire_ctx,
1168 bool interruptible, 1168 bool interruptible,
1169 unsigned num_resvs, 1169 unsigned num_resvs,
1170 struct reservation_object **resvs, 1170 struct dma_resv **resvs,
1171 struct reservation_object **contended_resv) 1171 struct dma_resv **contended_resv)
1172{ 1172{
1173 unsigned i; 1173 unsigned i;
1174 1174
@@ -1220,10 +1220,10 @@ static int lock_reservation_objects_no_retry(struct ww_acquire_ctx *ww_acquire_c
1220static int lock_reservation_objects(struct ww_acquire_ctx *ww_acquire_ctx, 1220static int lock_reservation_objects(struct ww_acquire_ctx *ww_acquire_ctx,
1221 bool interruptible, 1221 bool interruptible,
1222 unsigned num_resvs, 1222 unsigned num_resvs,
1223 struct reservation_object **resvs) 1223 struct dma_resv **resvs)
1224{ 1224{
1225 int ret; 1225 int ret;
1226 struct reservation_object *contended_resv = NULL; 1226 struct dma_resv *contended_resv = NULL;
1227 1227
1228 do { 1228 do {
1229 ret = lock_reservation_objects_no_retry(ww_acquire_ctx, 1229 ret = lock_reservation_objects_no_retry(ww_acquire_ctx,
@@ -1444,7 +1444,7 @@ PVRSRV_ERROR PVRLinuxFenceProcess(IMG_UINT32 *pui32Tag,
1444{ 1444{
1445 u32 tag; 1445 u32 tag;
1446 struct ww_acquire_ctx ww_acquire_ctx; 1446 struct ww_acquire_ctx ww_acquire_ctx;
1447 struct reservation_object **resvs = NULL; 1447 struct dma_resv **resvs = NULL;
1448 int ret; 1448 int ret;
1449 1449
1450 if (!ui32NumResvObjs) 1450 if (!ui32NumResvObjs)
diff --git a/eurasia_km/services4/srvkm/env/linux/pvr_uaccess.h b/eurasia_km/services4/srvkm/env/linux/pvr_uaccess.h
index 3a63836..2191e63 100644
--- a/eurasia_km/services4/srvkm/env/linux/pvr_uaccess.h
+++ b/eurasia_km/services4/srvkm/env/linux/pvr_uaccess.h
@@ -54,7 +54,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
54static inline unsigned long pvr_copy_to_user(void __user *pvTo, const void *pvFrom, unsigned long ulBytes) 54static inline unsigned long pvr_copy_to_user(void __user *pvTo, const void *pvFrom, unsigned long ulBytes)
55{ 55{
56#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)) 56#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
57 if (access_ok(VERIFY_WRITE, pvTo, ulBytes)) 57 if (access_ok(pvTo, ulBytes))
58 { 58 {
59 return __copy_to_user(pvTo, pvFrom, ulBytes); 59 return __copy_to_user(pvTo, pvFrom, ulBytes);
60 } 60 }
@@ -71,7 +71,7 @@ static inline unsigned long pvr_copy_from_user(void *pvTo, const void __user *pv
71 * The compile time correctness checking introduced for copy_from_user in 71 * The compile time correctness checking introduced for copy_from_user in
72 * Linux 2.6.33 isn't fully comaptible with our usage of the function. 72 * Linux 2.6.33 isn't fully comaptible with our usage of the function.
73 */ 73 */
74 if (access_ok(VERIFY_READ, pvFrom, ulBytes)) 74 if (access_ok(pvFrom, ulBytes))
75 { 75 {
76 return __copy_from_user(pvTo, pvFrom, ulBytes); 76 return __copy_from_user(pvTo, pvFrom, ulBytes);
77 } 77 }