Commit 17976d48 authored by Matthijs van Duin's avatar Matthijs van Duin

fixes for kernel 4.14

parent d9973b4e
......@@ -1071,6 +1071,7 @@ PVRSRV_ERROR FreeMemCallBackCommon(PVRSRV_KERNEL_MEM_INFO *psMemInfo,
case PVRSRV_MEMTYPE_ION:
case PVRSRV_MEMTYPE_DMABUF:
freeExternal(psMemInfo);
/* fall through */
case PVRSRV_MEMTYPE_DEVICE:
case PVRSRV_MEMTYPE_DEVICECLASS:
#if defined(SUPPORT_ION)
......
......@@ -788,7 +788,7 @@ DoMapToUser(LinuxMemArea *psLinuxMemArea,
#if defined(PVR_MAKE_ALL_PFNS_SPECIAL)
if (bMixedMap)
{
result = vm_insert_mixed(ps_vma, ulVMAPos, pfn_to_pfn_t(pfn));
result = vm_insert_mixed(ps_vma, ulVMAPos, pfn);
if(result != 0)
{
PVR_DPF((PVR_DBG_ERROR,"%s: Error - vm_insert_mixed failed (%d)", __FUNCTION__, result));
......
......@@ -3692,7 +3692,7 @@ PVRSRV_ERROR OSAcquirePhysPageAddr(IMG_VOID *pvCPUVAddr,
bMMapSemHeld = IMG_TRUE;
/* Get page list */
psInfo->iNumPagesMapped = get_user_pages_remote(current, current->mm, uStartAddr, psInfo->iNumPages, FOLL_WRITE, psInfo->ppsPages, NULL);
psInfo->iNumPagesMapped = get_user_pages_remote(current, current->mm, uStartAddr, psInfo->iNumPages, FOLL_WRITE, psInfo->ppsPages, NULL, NULL);
if (psInfo->iNumPagesMapped >= 0)
{
......
......@@ -213,7 +213,7 @@ PVRSRVDrmLoad(struct drm_device *dev, unsigned long flags)
gpsPVRDRMDev = dev;
#if !defined(PVR_DRI_DRM_NOT_PCI) && !defined(SUPPORT_DRI_DRM_PLUGIN)
#if defined(PVR_DRI_DRM_PLATFORM_DEV)
gpsPVRLDMDev = dev->platformdev;
gpsPVRLDMDev = to_platform_device(dev->dev);
#else
gpsPVRLDMDev = dev->pdev;
#endif
......@@ -531,8 +531,6 @@ static struct drm_driver sPVRDrmDriver =
#endif
,
.dev_priv_size = 0,
.load = PVRSRVDrmLoad,
.unload = PVRSRVDrmUnload,
.open = PVRSRVDrmOpen,
#if defined(PVR_DRI_DRM_USE_POST_CLOSE)
.postclose = PVRSRVDrmPostClose,
......@@ -657,8 +655,9 @@ static struct platform_driver sPVRPlatDriver =
static int
PVRSRVDrmProbe(struct platform_device *pDevice)
{
struct drm_device *ddev;
int ret = 0;
#if (AM_VERSION != 5)
int ret;
struct device *dev = &pDevice->dev;
struct gfx_sgx_platform_data *pdata = dev->platform_data;
#endif
......@@ -675,9 +674,19 @@ PVRSRVDrmProbe(struct platform_device *pDevice)
#endif
#if defined(PVR_NEW_STYLE_DRM_PLATFORM_DEV)
gpsPVRLDMDev = pDevice;
ddev = drm_dev_alloc(&sPVRDrmDriver, &pDevice->dev);
if (IS_ERR(ddev))
return PTR_ERR(ddev);
return drm_platform_init(&sPVRDrmDriver, gpsPVRLDMDev);
ret = PVRSRVDrmLoad(ddev, 0);
if (!ret)
ret = drm_dev_register(ddev, 0);
if (ret)
drm_dev_unref(ddev);
else
gpsPVRLDMDev = pDevice;
return ret;
#else
return drm_get_platform_dev(pDevice, &sPVRDrmDriver);
#endif
......@@ -697,8 +706,10 @@ PVRSRVDrmRemove(struct platform_device *pDevice)
#if defined(PVR_NEW_STYLE_DRM_PLATFORM_DEV) && (LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0))
drm_platform_exit(&sPVRDrmDriver, gpsPVRLDMDev);
#else
PVRSRVDrmUnload(gpsPVRDRMDev);
drm_put_dev(gpsPVRDRMDev);
#endif
gpsPVRDRMDev = NULL;
#if (AM_VERSION != 5)
if (pdata && pdata->assert_reset) {
......
......@@ -49,11 +49,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#endif
#include <asm/uaccess.h>
#include <linux/uaccess.h>
static inline unsigned long pvr_copy_to_user(void __user *pvTo, const void *pvFrom, unsigned long ulBytes)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
#if 0
if (access_ok(VERIFY_WRITE, pvTo, ulBytes))
{
return __copy_to_user(pvTo, pvFrom, ulBytes);
......@@ -66,7 +66,7 @@ static inline unsigned long pvr_copy_to_user(void __user *pvTo, const void *pvFr
static inline unsigned long pvr_copy_from_user(void *pvTo, const void __user *pvFrom, unsigned long ulBytes)
{
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
#if 0
/*
* The compile time correctness checking introduced for copy_from_user in
* Linux 2.6.33 isn't fully comaptible with our usage of the function.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment