Commit 955e36d0 authored by Daniel Vetter's avatar Daniel Vetter
Browse files

Merge branch 'topic/skl-stage1' into drm-intel-next-queued


SKL stage 1 patches still need polish so will likely miss the 3.18
merge window. We've decided to postpone to 3.19 so let's pull this in
to make patch merging and conflict handling easier.
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
parents ce31d9f4 c83155a6
...@@ -48,7 +48,7 @@ static const struct file_operations mga_driver_fops = { ...@@ -48,7 +48,7 @@ static const struct file_operations mga_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = mga_compat_ioctl, .compat_ioctl = mga_compat_ioctl,
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
#include <drm/ttm/ttm_memory.h> #include <drm/ttm/ttm_memory.h>
#include <drm/ttm/ttm_module.h> #include <drm/ttm/ttm_module.h>
#include <drm/drm_gem.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/i2c-algo-bit.h> #include <linux/i2c-algo-bit.h>
......
...@@ -428,7 +428,7 @@ int mgag200_mmap(struct file *filp, struct vm_area_struct *vma) ...@@ -428,7 +428,7 @@ int mgag200_mmap(struct file *filp, struct vm_area_struct *vma)
struct mga_device *mdev; struct mga_device *mdev;
if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
return drm_mmap(filp, vma); return -EINVAL;
file_priv = filp->private_data; file_priv = filp->private_data;
mdev = file_priv->minor->dev->dev_private; mdev = file_priv->minor->dev->dev_private;
......
...@@ -51,6 +51,7 @@ static inline struct device *msm_iommu_get_ctx(const char *ctx_name) ...@@ -51,6 +51,7 @@ static inline struct device *msm_iommu_get_ctx(const char *ctx_name)
#include <drm/drm_crtc_helper.h> #include <drm/drm_crtc_helper.h>
#include <drm/drm_fb_helper.h> #include <drm/drm_fb_helper.h>
#include <drm/msm_drm.h> #include <drm/msm_drm.h>
#include <drm/drm_gem.h>
struct msm_kms; struct msm_kms;
struct msm_gpu; struct msm_gpu;
......
#ifndef __NOUVEAU_BO_H__ #ifndef __NOUVEAU_BO_H__
#define __NOUVEAU_BO_H__ #define __NOUVEAU_BO_H__
#include <drm/drm_gem.h>
struct nouveau_channel; struct nouveau_channel;
struct nouveau_fence; struct nouveau_fence;
struct nouveau_vma; struct nouveau_vma;
......
...@@ -281,7 +281,7 @@ nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma) ...@@ -281,7 +281,7 @@ nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma)
struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev); struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev);
if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET))
return drm_mmap(filp, vma); return -EINVAL;
return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); return ttm_bo_mmap(filp, vma, &drm->ttm.bdev);
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <drm/drmP.h> #include <drm/drmP.h>
#include <drm/drm_crtc_helper.h> #include <drm/drm_crtc_helper.h>
#include <drm/omap_drm.h> #include <drm/omap_drm.h>
#include <drm/drm_gem.h>
#include <linux/platform_data/omap_drm.h> #include <linux/platform_data/omap_drm.h>
......
...@@ -43,6 +43,8 @@ ...@@ -43,6 +43,8 @@
#include <ttm/ttm_placement.h> #include <ttm/ttm_placement.h>
#include <ttm/ttm_module.h> #include <ttm/ttm_module.h>
#include <drm/drm_gem.h>
/* just for ttm_validate_buffer */ /* just for ttm_validate_buffer */
#include <ttm/ttm_execbuf_util.h> #include <ttm/ttm_execbuf_util.h>
......
...@@ -127,7 +127,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma) ...@@ -127,7 +127,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma)
if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) { if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n", pr_info("%s: vma->vm_pgoff (%ld) < DRM_FILE_PAGE_OFFSET\n",
__func__, vma->vm_pgoff); __func__, vma->vm_pgoff);
return drm_mmap(filp, vma); return -EINVAL;
} }
file_priv = filp->private_data; file_priv = filp->private_data;
......
...@@ -46,7 +46,7 @@ static const struct file_operations r128_driver_fops = { ...@@ -46,7 +46,7 @@ static const struct file_operations r128_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = r128_compat_ioctl, .compat_ioctl = r128_compat_ioctl,
......
...@@ -74,6 +74,8 @@ ...@@ -74,6 +74,8 @@
#include <ttm/ttm_module.h> #include <ttm/ttm_module.h>
#include <ttm/ttm_execbuf_util.h> #include <ttm/ttm_execbuf_util.h>
#include <drm/drm_gem.h>
#include "radeon_family.h" #include "radeon_family.h"
#include "radeon_mode.h" #include "radeon_mode.h"
#include "radeon_reg.h" #include "radeon_reg.h"
......
...@@ -38,6 +38,8 @@ ...@@ -38,6 +38,8 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/vga_switcheroo.h> #include <linux/vga_switcheroo.h>
#include <drm/drm_gem.h>
#include "drm_crtc_helper.h" #include "drm_crtc_helper.h"
/* /*
* KMS wrapper. * KMS wrapper.
...@@ -308,7 +310,7 @@ static const struct file_operations radeon_driver_old_fops = { ...@@ -308,7 +310,7 @@ static const struct file_operations radeon_driver_old_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
.read = drm_read, .read = drm_read,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
......
...@@ -675,10 +675,17 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev, ...@@ -675,10 +675,17 @@ static struct ttm_tt *radeon_ttm_tt_create(struct ttm_bo_device *bdev,
return &gtt->ttm.ttm; return &gtt->ttm.ttm;
} }
static struct radeon_ttm_tt *radeon_ttm_tt_to_gtt(struct ttm_tt *ttm)
{
if (!ttm || ttm->func != &radeon_backend_func)
return NULL;
return (struct radeon_ttm_tt *)ttm;
}
static int radeon_ttm_tt_populate(struct ttm_tt *ttm) static int radeon_ttm_tt_populate(struct ttm_tt *ttm)
{ {
struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm);
struct radeon_device *rdev; struct radeon_device *rdev;
struct radeon_ttm_tt *gtt = (void *)ttm;
unsigned i; unsigned i;
int r; int r;
bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
...@@ -686,7 +693,7 @@ static int radeon_ttm_tt_populate(struct ttm_tt *ttm) ...@@ -686,7 +693,7 @@ static int radeon_ttm_tt_populate(struct ttm_tt *ttm)
if (ttm->state != tt_unpopulated) if (ttm->state != tt_unpopulated)
return 0; return 0;
if (gtt->userptr) { if (gtt && gtt->userptr) {
ttm->sg = kcalloc(1, sizeof(struct sg_table), GFP_KERNEL); ttm->sg = kcalloc(1, sizeof(struct sg_table), GFP_KERNEL);
if (!ttm->sg) if (!ttm->sg)
return -ENOMEM; return -ENOMEM;
...@@ -741,11 +748,11 @@ static int radeon_ttm_tt_populate(struct ttm_tt *ttm) ...@@ -741,11 +748,11 @@ static int radeon_ttm_tt_populate(struct ttm_tt *ttm)
static void radeon_ttm_tt_unpopulate(struct ttm_tt *ttm) static void radeon_ttm_tt_unpopulate(struct ttm_tt *ttm)
{ {
struct radeon_device *rdev; struct radeon_device *rdev;
struct radeon_ttm_tt *gtt = (void *)ttm; struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm);
unsigned i; unsigned i;
bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG); bool slave = !!(ttm->page_flags & TTM_PAGE_FLAG_SG);
if (gtt->userptr) { if (gtt && gtt->userptr) {
kfree(ttm->sg); kfree(ttm->sg);
ttm->page_flags &= ~TTM_PAGE_FLAG_SG; ttm->page_flags &= ~TTM_PAGE_FLAG_SG;
return; return;
...@@ -782,7 +789,7 @@ static void radeon_ttm_tt_unpopulate(struct ttm_tt *ttm) ...@@ -782,7 +789,7 @@ static void radeon_ttm_tt_unpopulate(struct ttm_tt *ttm)
int radeon_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr, int radeon_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr,
uint32_t flags) uint32_t flags)
{ {
struct radeon_ttm_tt *gtt = (void *)ttm; struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm);
if (gtt == NULL) if (gtt == NULL)
return -EINVAL; return -EINVAL;
...@@ -795,7 +802,7 @@ int radeon_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr, ...@@ -795,7 +802,7 @@ int radeon_ttm_tt_set_userptr(struct ttm_tt *ttm, uint64_t addr,
bool radeon_ttm_tt_has_userptr(struct ttm_tt *ttm) bool radeon_ttm_tt_has_userptr(struct ttm_tt *ttm)
{ {
struct radeon_ttm_tt *gtt = (void *)ttm; struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm);
if (gtt == NULL) if (gtt == NULL)
return false; return false;
...@@ -805,7 +812,7 @@ bool radeon_ttm_tt_has_userptr(struct ttm_tt *ttm) ...@@ -805,7 +812,7 @@ bool radeon_ttm_tt_has_userptr(struct ttm_tt *ttm)
bool radeon_ttm_tt_is_readonly(struct ttm_tt *ttm) bool radeon_ttm_tt_is_readonly(struct ttm_tt *ttm)
{ {
struct radeon_ttm_tt *gtt = (void *)ttm; struct radeon_ttm_tt *gtt = radeon_ttm_tt_to_gtt(ttm);
if (gtt == NULL) if (gtt == NULL)
return false; return false;
...@@ -956,7 +963,7 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma) ...@@ -956,7 +963,7 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
int r; int r;
if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) { if (unlikely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) {
return drm_mmap(filp, vma); return -EINVAL;
} }
file_priv = filp->private_data; file_priv = filp->private_data;
......
...@@ -40,7 +40,7 @@ static const struct file_operations savage_driver_fops = { ...@@ -40,7 +40,7 @@ static const struct file_operations savage_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = drm_compat_ioctl, .compat_ioctl = drm_compat_ioctl,
......
...@@ -70,7 +70,7 @@ static const struct file_operations sis_driver_fops = { ...@@ -70,7 +70,7 @@ static const struct file_operations sis_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = drm_compat_ioctl, .compat_ioctl = drm_compat_ioctl,
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "tdfx_drv.h" #include "tdfx_drv.h"
#include <drm/drm_pciids.h> #include <drm/drm_pciids.h>
#include <drm/drm_legacy.h>
static struct pci_device_id pciidlist[] = { static struct pci_device_id pciidlist[] = {
tdfx_PCI_IDS tdfx_PCI_IDS
...@@ -46,7 +47,7 @@ static const struct file_operations tdfx_driver_fops = { ...@@ -46,7 +47,7 @@ static const struct file_operations tdfx_driver_fops = {
.open = drm_open, .open = drm_open,
.release = drm_release, .release = drm_release,
.unlocked_ioctl = drm_ioctl, .unlocked_ioctl = drm_ioctl,
.mmap = drm_mmap, .mmap = drm_legacy_mmap,
.poll = drm_poll, .poll = drm_poll,
#ifdef CONFIG_COMPAT #ifdef CONFIG_COMPAT
.compat_ioctl = drm_compat_ioctl, .compat_ioctl = drm_compat_ioctl,
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <drm/drm.h> #include <drm/drm.h>
#include <drm/drmP.h> #include <drm/drmP.h>
#include <drm/drm_gem.h>
#define TEGRA_BO_BOTTOM_UP (1 << 0) #define TEGRA_BO_BOTTOM_UP (1 << 0)
......
...@@ -480,28 +480,24 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo, ...@@ -480,28 +480,24 @@ static int ttm_buffer_object_transfer(struct ttm_buffer_object *bo,
pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp) pgprot_t ttm_io_prot(uint32_t caching_flags, pgprot_t tmp)
{ {
/* Cached mappings need no adjustment */
if (caching_flags & TTM_PL_FLAG_CACHED)
return tmp;
#if defined(__i386__) || defined(__x86_64__) #if defined(__i386__) || defined(__x86_64__)
if (caching_flags & TTM_PL_FLAG_WC) if (caching_flags & TTM_PL_FLAG_WC)
tmp = pgprot_writecombine(tmp); tmp = pgprot_writecombine(tmp);
else if (boot_cpu_data.x86 > 3) else if (boot_cpu_data.x86 > 3)
tmp = pgprot_noncached(tmp); tmp = pgprot_noncached(tmp);
#elif defined(__powerpc__)
if (!(caching_flags & TTM_PL_FLAG_CACHED)) {
pgprot_val(tmp) |= _PAGE_NO_CACHE;
if (caching_flags & TTM_PL_FLAG_UNCACHED)
pgprot_val(tmp) |= _PAGE_GUARDED;
}
#endif #endif
#if defined(__ia64__) || defined(__arm__) #if defined(__ia64__) || defined(__arm__) || defined(__powerpc__)
if (caching_flags & TTM_PL_FLAG_WC) if (caching_flags & TTM_PL_FLAG_WC)
tmp = pgprot_writecombine(tmp); tmp = pgprot_writecombine(tmp);
else else
tmp = pgprot_noncached(tmp); tmp = pgprot_noncached(tmp);
#endif #endif
#if defined(__sparc__) || defined(__mips__) #if defined(__sparc__) || defined(__mips__)
if (!(caching_flags & TTM_PL_FLAG_CACHED)) tmp = pgprot_noncached(tmp);
tmp = pgprot_noncached(tmp);
#endif #endif
return tmp; return tmp;
} }
...@@ -560,9 +556,7 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo, ...@@ -560,9 +556,7 @@ static int ttm_bo_kmap_ttm(struct ttm_buffer_object *bo,
* We need to use vmap to get the desired page protection * We need to use vmap to get the desired page protection
* or to make the buffer object look contiguous. * or to make the buffer object look contiguous.
*/ */
prot = (mem->placement & TTM_PL_FLAG_CACHED) ? prot = ttm_io_prot(mem->placement, PAGE_KERNEL);
PAGE_KERNEL :
ttm_io_prot(mem->placement, PAGE_KERNEL);
map->bo_kmap_type = ttm_bo_map_vmap; map->bo_kmap_type = ttm_bo_map_vmap;
map->virtual = vmap(ttm->pages + start_page, num_pages, map->virtual = vmap(ttm->pages + start_page, num_pages,
0, prot); 0, prot);
......
...@@ -197,9 +197,8 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf) ...@@ -197,9 +197,8 @@ static int ttm_bo_vm_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
cvma.vm_page_prot); cvma.vm_page_prot);
} else { } else {
ttm = bo->ttm; ttm = bo->ttm;
if (!(bo->mem.placement & TTM_PL_FLAG_CACHED)) cvma.vm_page_prot = ttm_io_prot(bo->mem.placement,
cvma.vm_page_prot = ttm_io_prot(bo->mem.placement, cvma.vm_page_prot);
cvma.vm_page_prot);
/* Allocate all page at once, most common usage */ /* Allocate all page at once, most common usage */
if (ttm->bdev->driver->ttm_tt_populate(ttm)) { if (ttm->bdev->driver->ttm_tt_populate(ttm)) {
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#define UDL_DRV_H #define UDL_DRV_H
#include <linux/usb.h> #include <linux/usb.h>
#include <drm/drm_gem.h>
#define DRIVER_NAME "udl" #define DRIVER_NAME "udl"
#define DRIVER_DESC "DisplayLink" #define DRIVER_DESC "DisplayLink"
......
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