Merge tag 'drm-misc-next-2017-05-26' of git://anongit.freedesktop.org/git/drm-misc into drm-next
UAPI Changes: - Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ defines to the UAPI (Robert) Cross-subsystem Changes: - Standardize sync_file.txt documentation format (Mauro) Core Changes: - Turf drm_[cm]alloc functions for kvmalloc alternatives (Michal) - Add optional mode_valid() hook to crtc/encoder/bridge (Jose) - Improve documentation around mode validation/alteration (Daniel) - Reduce sync_file construction time by deferring name creation (Chris) Driver Changes: - pl111: Wire up the clock divider and add debugfs (Eric) - various: Fix include notation and remove -Iinclude/drm (Masahiro) - stm: Add Benjamin Gaignard and Vincent Abriou as STM maintainers (Vincent) - various: Miscellaneous trivial fixes to pl111/stm/vgem/vc4 Cc: Michal Hocko <mhocko@suse.com> Cc: Eric Anholt <eric@anholt.net> Cc: Masahiro Yamada <yamada.masahiro@socionext.com> Cc: Robert Foss <robert.foss@collabora.com> Cc: Vincent Abriou <vincent.abriou@st.com> Cc: Jose Abreu <Jose.Abreu@synopsys.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com> * tag 'drm-misc-next-2017-05-26' of git://anongit.freedesktop.org/git/drm-misc: (55 commits) dma-buf/sync-file: Defer creation of sync_file->name sync_file.txt: standardize document format gpu: drm: gma500: remove two more dead variable drm/doc: Clarify mode_fixup vs. atomic_check a bit more drm/doc: Document adjusted/request modes a bit better drm: Add crtc/encoder/bridge->mode_valid() callbacks MAINTAINERS: update drm/stm maintainers list drm/stm: ltdc: fix duplicated arguments drm/pl111: Fix return value check in pl111_amba_probe() drm/amd: include <linux/delay.h> instead of "linux/delay.h" drm: Add DRM_MODE_ROTATE_ and DRM_MODE_REFLECT_ to UAPI drm/vgem: Fix return value check in vgem_init() drm/blend: Fix comment typ-o drm/stm: remove unneeded -Iinclude/drm compiler flag drm/vc4: fix include notation and remove -Iinclude/drm flag drm/pl111: Add a debugfs node to dump our registers. drm/pl111: make structure mode_config_funcs static drm/pl111: make structure pl111_display_funcs static drm/pl111: Register the clock divider and use it. drm: drop drm_[cm]alloc* helpers ...
This commit is contained in:
commit
1afc45445d
|
@ -1,8 +1,8 @@
|
||||||
Sync File API Guide
|
===================
|
||||||
~~~~~~~~~~~~~~~~~~~
|
Sync File API Guide
|
||||||
|
===================
|
||||||
|
|
||||||
Gustavo Padovan
|
:Author: Gustavo Padovan <gustavo at padovan dot org>
|
||||||
<gustavo at padovan dot org>
|
|
||||||
|
|
||||||
This document serves as a guide for device drivers writers on what the
|
This document serves as a guide for device drivers writers on what the
|
||||||
sync_file API is, and how drivers can support it. Sync file is the carrier of
|
sync_file API is, and how drivers can support it. Sync file is the carrier of
|
||||||
|
@ -46,16 +46,17 @@ Creating Sync Files
|
||||||
|
|
||||||
When a driver needs to send an out-fence userspace it creates a sync_file.
|
When a driver needs to send an out-fence userspace it creates a sync_file.
|
||||||
|
|
||||||
Interface:
|
Interface::
|
||||||
|
|
||||||
struct sync_file *sync_file_create(struct dma_fence *fence);
|
struct sync_file *sync_file_create(struct dma_fence *fence);
|
||||||
|
|
||||||
The caller pass the out-fence and gets back the sync_file. That is just the
|
The caller pass the out-fence and gets back the sync_file. That is just the
|
||||||
first step, next it needs to install an fd on sync_file->file. So it gets an
|
first step, next it needs to install an fd on sync_file->file. So it gets an
|
||||||
fd:
|
fd::
|
||||||
|
|
||||||
fd = get_unused_fd_flags(O_CLOEXEC);
|
fd = get_unused_fd_flags(O_CLOEXEC);
|
||||||
|
|
||||||
and installs it on sync_file->file:
|
and installs it on sync_file->file::
|
||||||
|
|
||||||
fd_install(fd, sync_file->file);
|
fd_install(fd, sync_file->file);
|
||||||
|
|
||||||
|
@ -71,7 +72,8 @@ When userspace needs to send an in-fence to the driver it passes file descriptor
|
||||||
of the Sync File to the kernel. The kernel can then retrieve the fences
|
of the Sync File to the kernel. The kernel can then retrieve the fences
|
||||||
from it.
|
from it.
|
||||||
|
|
||||||
Interface:
|
Interface::
|
||||||
|
|
||||||
struct dma_fence *sync_file_get_fence(int fd);
|
struct dma_fence *sync_file_get_fence(int fd);
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,5 +81,6 @@ The returned reference is owned by the caller and must be disposed of
|
||||||
afterwards using dma_fence_put(). In case of error, a NULL is returned instead.
|
afterwards using dma_fence_put(). In case of error, a NULL is returned instead.
|
||||||
|
|
||||||
References:
|
References:
|
||||||
[1] struct sync_file in include/linux/sync_file.h
|
|
||||||
[2] All interfaces mentioned above defined in include/linux/sync_file.h
|
1. struct sync_file in include/linux/sync_file.h
|
||||||
|
2. All interfaces mentioned above defined in include/linux/sync_file.h
|
||||||
|
|
|
@ -4502,6 +4502,8 @@ F: Documentation/devicetree/bindings/display/st,stih4xx.txt
|
||||||
DRM DRIVERS FOR STM
|
DRM DRIVERS FOR STM
|
||||||
M: Yannick Fertre <yannick.fertre@st.com>
|
M: Yannick Fertre <yannick.fertre@st.com>
|
||||||
M: Philippe Cornu <philippe.cornu@st.com>
|
M: Philippe Cornu <philippe.cornu@st.com>
|
||||||
|
M: Benjamin Gaignard <benjamin.gaignard@linaro.org>
|
||||||
|
M: Vincent Abriou <vincent.abriou@st.com>
|
||||||
L: dri-devel@lists.freedesktop.org
|
L: dri-devel@lists.freedesktop.org
|
||||||
T: git git://anongit.freedesktop.org/drm/drm-misc
|
T: git git://anongit.freedesktop.org/drm/drm-misc
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
|
|
@ -132,9 +132,11 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
|
||||||
static void sync_print_sync_file(struct seq_file *s,
|
static void sync_print_sync_file(struct seq_file *s,
|
||||||
struct sync_file *sync_file)
|
struct sync_file *sync_file)
|
||||||
{
|
{
|
||||||
|
char buf[128];
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
seq_printf(s, "[%p] %s: %s\n", sync_file, sync_file->name,
|
seq_printf(s, "[%p] %s: %s\n", sync_file,
|
||||||
|
sync_file_get_name(sync_file, buf, sizeof(buf)),
|
||||||
sync_status_str(dma_fence_get_status(sync_file->fence)));
|
sync_status_str(dma_fence_get_status(sync_file->fence)));
|
||||||
|
|
||||||
if (dma_fence_is_array(sync_file->fence)) {
|
if (dma_fence_is_array(sync_file->fence)) {
|
||||||
|
|
|
@ -80,11 +80,6 @@ struct sync_file *sync_file_create(struct dma_fence *fence)
|
||||||
|
|
||||||
sync_file->fence = dma_fence_get(fence);
|
sync_file->fence = dma_fence_get(fence);
|
||||||
|
|
||||||
snprintf(sync_file->name, sizeof(sync_file->name), "%s-%s%llu-%d",
|
|
||||||
fence->ops->get_driver_name(fence),
|
|
||||||
fence->ops->get_timeline_name(fence), fence->context,
|
|
||||||
fence->seqno);
|
|
||||||
|
|
||||||
return sync_file;
|
return sync_file;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(sync_file_create);
|
EXPORT_SYMBOL(sync_file_create);
|
||||||
|
@ -129,6 +124,36 @@ struct dma_fence *sync_file_get_fence(int fd)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(sync_file_get_fence);
|
EXPORT_SYMBOL(sync_file_get_fence);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sync_file_get_name - get the name of the sync_file
|
||||||
|
* @sync_file: sync_file to get the fence from
|
||||||
|
* @buf: destination buffer to copy sync_file name into
|
||||||
|
* @len: available size of destination buffer.
|
||||||
|
*
|
||||||
|
* Each sync_file may have a name assigned either by the user (when merging
|
||||||
|
* sync_files together) or created from the fence it contains. In the latter
|
||||||
|
* case construction of the name is deferred until use, and so requires
|
||||||
|
* sync_file_get_name().
|
||||||
|
*
|
||||||
|
* Returns: a string representing the name.
|
||||||
|
*/
|
||||||
|
char *sync_file_get_name(struct sync_file *sync_file, char *buf, int len)
|
||||||
|
{
|
||||||
|
if (sync_file->user_name[0]) {
|
||||||
|
strlcpy(buf, sync_file->user_name, len);
|
||||||
|
} else {
|
||||||
|
struct dma_fence *fence = sync_file->fence;
|
||||||
|
|
||||||
|
snprintf(buf, len, "%s-%s%llu-%d",
|
||||||
|
fence->ops->get_driver_name(fence),
|
||||||
|
fence->ops->get_timeline_name(fence),
|
||||||
|
fence->context,
|
||||||
|
fence->seqno);
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
static int sync_file_set_fence(struct sync_file *sync_file,
|
static int sync_file_set_fence(struct sync_file *sync_file,
|
||||||
struct dma_fence **fences, int num_fences)
|
struct dma_fence **fences, int num_fences)
|
||||||
{
|
{
|
||||||
|
@ -266,7 +291,7 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a,
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
strlcpy(sync_file->name, name, sizeof(sync_file->name));
|
strlcpy(sync_file->user_name, name, sizeof(sync_file->user_name));
|
||||||
return sync_file;
|
return sync_file;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
|
@ -413,7 +438,7 @@ static long sync_file_ioctl_fence_info(struct sync_file *sync_file,
|
||||||
}
|
}
|
||||||
|
|
||||||
no_fences:
|
no_fences:
|
||||||
strlcpy(info.name, sync_file->name, sizeof(info.name));
|
sync_file_get_name(sync_file, info.name, sizeof(info.name));
|
||||||
info.status = dma_fence_is_signaled(sync_file->fence);
|
info.status = dma_fence_is_signaled(sync_file->fence);
|
||||||
info.num_fences = num_fences;
|
info.num_fences = num_fences;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
FULL_AMD_PATH=$(src)/..
|
FULL_AMD_PATH=$(src)/..
|
||||||
|
|
||||||
ccflags-y := -Iinclude/drm -I$(FULL_AMD_PATH)/include/asic_reg \
|
ccflags-y := -I$(FULL_AMD_PATH)/include/asic_reg \
|
||||||
-I$(FULL_AMD_PATH)/include \
|
-I$(FULL_AMD_PATH)/include \
|
||||||
-I$(FULL_AMD_PATH)/amdgpu \
|
-I$(FULL_AMD_PATH)/amdgpu \
|
||||||
-I$(FULL_AMD_PATH)/scheduler \
|
-I$(FULL_AMD_PATH)/scheduler \
|
||||||
|
|
|
@ -36,11 +36,11 @@
|
||||||
#include <linux/hashtable.h>
|
#include <linux/hashtable.h>
|
||||||
#include <linux/dma-fence.h>
|
#include <linux/dma-fence.h>
|
||||||
|
|
||||||
#include <ttm/ttm_bo_api.h>
|
#include <drm/ttm/ttm_bo_api.h>
|
||||||
#include <ttm/ttm_bo_driver.h>
|
#include <drm/ttm/ttm_bo_driver.h>
|
||||||
#include <ttm/ttm_placement.h>
|
#include <drm/ttm/ttm_placement.h>
|
||||||
#include <ttm/ttm_module.h>
|
#include <drm/ttm/ttm_module.h>
|
||||||
#include <ttm/ttm_execbuf_util.h>
|
#include <drm/ttm/ttm_execbuf_util.h>
|
||||||
|
|
||||||
#include <drm/drmP.h>
|
#include <drm/drmP.h>
|
||||||
#include <drm/drm_gem.h>
|
#include <drm/drm_gem.h>
|
||||||
|
|
|
@ -96,7 +96,7 @@ static int amdgpu_bo_list_set(struct amdgpu_device *adev,
|
||||||
int r;
|
int r;
|
||||||
unsigned long total_size = 0;
|
unsigned long total_size = 0;
|
||||||
|
|
||||||
array = drm_malloc_ab(num_entries, sizeof(struct amdgpu_bo_list_entry));
|
array = kvmalloc_array(num_entries, sizeof(struct amdgpu_bo_list_entry), GFP_KERNEL);
|
||||||
if (!array)
|
if (!array)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
memset(array, 0, num_entries * sizeof(struct amdgpu_bo_list_entry));
|
memset(array, 0, num_entries * sizeof(struct amdgpu_bo_list_entry));
|
||||||
|
@ -148,7 +148,7 @@ static int amdgpu_bo_list_set(struct amdgpu_device *adev,
|
||||||
for (i = 0; i < list->num_entries; ++i)
|
for (i = 0; i < list->num_entries; ++i)
|
||||||
amdgpu_bo_unref(&list->array[i].robj);
|
amdgpu_bo_unref(&list->array[i].robj);
|
||||||
|
|
||||||
drm_free_large(list->array);
|
kvfree(list->array);
|
||||||
|
|
||||||
list->gds_obj = gds_obj;
|
list->gds_obj = gds_obj;
|
||||||
list->gws_obj = gws_obj;
|
list->gws_obj = gws_obj;
|
||||||
|
@ -163,7 +163,7 @@ static int amdgpu_bo_list_set(struct amdgpu_device *adev,
|
||||||
error_free:
|
error_free:
|
||||||
while (i--)
|
while (i--)
|
||||||
amdgpu_bo_unref(&array[i].robj);
|
amdgpu_bo_unref(&array[i].robj);
|
||||||
drm_free_large(array);
|
kvfree(array);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -224,7 +224,7 @@ void amdgpu_bo_list_free(struct amdgpu_bo_list *list)
|
||||||
amdgpu_bo_unref(&list->array[i].robj);
|
amdgpu_bo_unref(&list->array[i].robj);
|
||||||
|
|
||||||
mutex_destroy(&list->lock);
|
mutex_destroy(&list->lock);
|
||||||
drm_free_large(list->array);
|
kvfree(list->array);
|
||||||
kfree(list);
|
kfree(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,8 +244,8 @@ int amdgpu_bo_list_ioctl(struct drm_device *dev, void *data,
|
||||||
|
|
||||||
int r;
|
int r;
|
||||||
|
|
||||||
info = drm_malloc_ab(args->in.bo_number,
|
info = kvmalloc_array(args->in.bo_number,
|
||||||
sizeof(struct drm_amdgpu_bo_list_entry));
|
sizeof(struct drm_amdgpu_bo_list_entry), GFP_KERNEL);
|
||||||
if (!info)
|
if (!info)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -311,11 +311,11 @@ int amdgpu_bo_list_ioctl(struct drm_device *dev, void *data,
|
||||||
|
|
||||||
memset(args, 0, sizeof(*args));
|
memset(args, 0, sizeof(*args));
|
||||||
args->out.list_handle = handle;
|
args->out.list_handle = handle;
|
||||||
drm_free_large(info);
|
kvfree(info);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_free:
|
error_free:
|
||||||
drm_free_large(info);
|
kvfree(info);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,7 @@ int amdgpu_cs_parser_init(struct amdgpu_cs_parser *p, void *data)
|
||||||
size = p->chunks[i].length_dw;
|
size = p->chunks[i].length_dw;
|
||||||
cdata = (void __user *)(uintptr_t)user_chunk.chunk_data;
|
cdata = (void __user *)(uintptr_t)user_chunk.chunk_data;
|
||||||
|
|
||||||
p->chunks[i].kdata = drm_malloc_ab(size, sizeof(uint32_t));
|
p->chunks[i].kdata = kvmalloc_array(size, sizeof(uint32_t), GFP_KERNEL);
|
||||||
if (p->chunks[i].kdata == NULL) {
|
if (p->chunks[i].kdata == NULL) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
i--;
|
i--;
|
||||||
|
@ -247,7 +247,7 @@ free_all_kdata:
|
||||||
i = p->nchunks - 1;
|
i = p->nchunks - 1;
|
||||||
free_partial_kdata:
|
free_partial_kdata:
|
||||||
for (; i >= 0; i--)
|
for (; i >= 0; i--)
|
||||||
drm_free_large(p->chunks[i].kdata);
|
kvfree(p->chunks[i].kdata);
|
||||||
kfree(p->chunks);
|
kfree(p->chunks);
|
||||||
p->chunks = NULL;
|
p->chunks = NULL;
|
||||||
p->nchunks = 0;
|
p->nchunks = 0;
|
||||||
|
@ -505,7 +505,7 @@ static int amdgpu_cs_list_validate(struct amdgpu_cs_parser *p,
|
||||||
return r;
|
return r;
|
||||||
|
|
||||||
if (binding_userptr) {
|
if (binding_userptr) {
|
||||||
drm_free_large(lobj->user_pages);
|
kvfree(lobj->user_pages);
|
||||||
lobj->user_pages = NULL;
|
lobj->user_pages = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -571,7 +571,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
|
||||||
release_pages(e->user_pages,
|
release_pages(e->user_pages,
|
||||||
e->robj->tbo.ttm->num_pages,
|
e->robj->tbo.ttm->num_pages,
|
||||||
false);
|
false);
|
||||||
drm_free_large(e->user_pages);
|
kvfree(e->user_pages);
|
||||||
e->user_pages = NULL;
|
e->user_pages = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -601,8 +601,9 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
|
||||||
list_for_each_entry(e, &need_pages, tv.head) {
|
list_for_each_entry(e, &need_pages, tv.head) {
|
||||||
struct ttm_tt *ttm = e->robj->tbo.ttm;
|
struct ttm_tt *ttm = e->robj->tbo.ttm;
|
||||||
|
|
||||||
e->user_pages = drm_calloc_large(ttm->num_pages,
|
e->user_pages = kvmalloc_array(ttm->num_pages,
|
||||||
sizeof(struct page*));
|
sizeof(struct page*),
|
||||||
|
GFP_KERNEL | __GFP_ZERO);
|
||||||
if (!e->user_pages) {
|
if (!e->user_pages) {
|
||||||
r = -ENOMEM;
|
r = -ENOMEM;
|
||||||
DRM_ERROR("calloc failure in %s\n", __func__);
|
DRM_ERROR("calloc failure in %s\n", __func__);
|
||||||
|
@ -612,7 +613,7 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,
|
||||||
r = amdgpu_ttm_tt_get_user_pages(ttm, e->user_pages);
|
r = amdgpu_ttm_tt_get_user_pages(ttm, e->user_pages);
|
||||||
if (r) {
|
if (r) {
|
||||||
DRM_ERROR("amdgpu_ttm_tt_get_user_pages failed.\n");
|
DRM_ERROR("amdgpu_ttm_tt_get_user_pages failed.\n");
|
||||||
drm_free_large(e->user_pages);
|
kvfree(e->user_pages);
|
||||||
e->user_pages = NULL;
|
e->user_pages = NULL;
|
||||||
goto error_free_pages;
|
goto error_free_pages;
|
||||||
}
|
}
|
||||||
|
@ -708,7 +709,7 @@ error_free_pages:
|
||||||
release_pages(e->user_pages,
|
release_pages(e->user_pages,
|
||||||
e->robj->tbo.ttm->num_pages,
|
e->robj->tbo.ttm->num_pages,
|
||||||
false);
|
false);
|
||||||
drm_free_large(e->user_pages);
|
kvfree(e->user_pages);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -761,7 +762,7 @@ static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error, bo
|
||||||
amdgpu_bo_list_put(parser->bo_list);
|
amdgpu_bo_list_put(parser->bo_list);
|
||||||
|
|
||||||
for (i = 0; i < parser->nchunks; i++)
|
for (i = 0; i < parser->nchunks; i++)
|
||||||
drm_free_large(parser->chunks[i].kdata);
|
kvfree(parser->chunks[i].kdata);
|
||||||
kfree(parser->chunks);
|
kfree(parser->chunks);
|
||||||
if (parser->job)
|
if (parser->job)
|
||||||
amdgpu_job_free(parser->job);
|
amdgpu_job_free(parser->job);
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
* Authors: Alex Deucher
|
* Authors: Alex Deucher
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_atombios.h"
|
#include "amdgpu_atombios.h"
|
||||||
#include "amdgpu_i2c.h"
|
#include "amdgpu_i2c.h"
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
#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_crtc_helper.h"
|
#include <drm/drm_crtc_helper.h>
|
||||||
|
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_irq.h"
|
#include "amdgpu_irq.h"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_psp.h"
|
#include "amdgpu_psp.h"
|
||||||
#include "amdgpu_ucode.h"
|
#include "amdgpu_ucode.h"
|
||||||
|
|
|
@ -29,11 +29,11 @@
|
||||||
* Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
|
* Thomas Hellstrom <thomas-at-tungstengraphics-dot-com>
|
||||||
* Dave Airlie
|
* Dave Airlie
|
||||||
*/
|
*/
|
||||||
#include <ttm/ttm_bo_api.h>
|
#include <drm/ttm/ttm_bo_api.h>
|
||||||
#include <ttm/ttm_bo_driver.h>
|
#include <drm/ttm/ttm_bo_driver.h>
|
||||||
#include <ttm/ttm_placement.h>
|
#include <drm/ttm/ttm_placement.h>
|
||||||
#include <ttm/ttm_module.h>
|
#include <drm/ttm/ttm_module.h>
|
||||||
#include <ttm/ttm_page_alloc.h>
|
#include <drm/ttm/ttm_page_alloc.h>
|
||||||
#include <drm/drmP.h>
|
#include <drm/drmP.h>
|
||||||
#include <drm/amdgpu_drm.h>
|
#include <drm/amdgpu_drm.h>
|
||||||
#include <linux/seq_file.h>
|
#include <linux/seq_file.h>
|
||||||
|
|
|
@ -279,8 +279,9 @@ static int amdgpu_vm_alloc_levels(struct amdgpu_device *adev,
|
||||||
if (!parent->entries) {
|
if (!parent->entries) {
|
||||||
unsigned num_entries = amdgpu_vm_num_entries(adev, level);
|
unsigned num_entries = amdgpu_vm_num_entries(adev, level);
|
||||||
|
|
||||||
parent->entries = drm_calloc_large(num_entries,
|
parent->entries = kvmalloc_array(num_entries,
|
||||||
sizeof(struct amdgpu_vm_pt));
|
sizeof(struct amdgpu_vm_pt),
|
||||||
|
GFP_KERNEL | __GFP_ZERO);
|
||||||
if (!parent->entries)
|
if (!parent->entries)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
memset(parent->entries, 0 , sizeof(struct amdgpu_vm_pt));
|
memset(parent->entries, 0 , sizeof(struct amdgpu_vm_pt));
|
||||||
|
@ -2198,7 +2199,7 @@ static void amdgpu_vm_free_levels(struct amdgpu_vm_pt *level)
|
||||||
for (i = 0; i <= level->last_entry_used; i++)
|
for (i = 0; i <= level->last_entry_used; i++)
|
||||||
amdgpu_vm_free_levels(&level->entries[i]);
|
amdgpu_vm_free_levels(&level->entries[i]);
|
||||||
|
|
||||||
drm_free_large(level->entries);
|
kvfree(level->entries);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_pm.h"
|
#include "amdgpu_pm.h"
|
||||||
#include "amdgpu_ucode.h"
|
#include "amdgpu_ucode.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "cikd.h"
|
#include "cikd.h"
|
||||||
#include "ppsmc.h"
|
#include "ppsmc.h"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_atombios.h"
|
#include "amdgpu_atombios.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
#include "cikd.h"
|
#include "cikd.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
#include "vid.h"
|
#include "vid.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_pm.h"
|
#include "amdgpu_pm.h"
|
||||||
#include "amdgpu_i2c.h"
|
#include "amdgpu_i2c.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_pm.h"
|
#include "amdgpu_pm.h"
|
||||||
#include "amdgpu_i2c.h"
|
#include "amdgpu_i2c.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_pm.h"
|
#include "amdgpu_pm.h"
|
||||||
#include "amdgpu_i2c.h"
|
#include "amdgpu_i2c.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_pm.h"
|
#include "amdgpu_pm.h"
|
||||||
#include "amdgpu_i2c.h"
|
#include "amdgpu_i2c.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_pm.h"
|
#include "amdgpu_pm.h"
|
||||||
#include "amdgpu_i2c.h"
|
#include "amdgpu_i2c.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
#include "amdgpu_gfx.h"
|
#include "amdgpu_gfx.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_gfx.h"
|
#include "amdgpu_gfx.h"
|
||||||
#include "vi.h"
|
#include "vi.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_gfx.h"
|
#include "amdgpu_gfx.h"
|
||||||
#include "soc15.h"
|
#include "soc15.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "gmc_v6_0.h"
|
#include "gmc_v6_0.h"
|
||||||
#include "amdgpu_ucode.h"
|
#include "amdgpu_ucode.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "cikd.h"
|
#include "cikd.h"
|
||||||
#include "cik.h"
|
#include "cik.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "gmc_v8_0.h"
|
#include "gmc_v8_0.h"
|
||||||
#include "amdgpu_ucode.h"
|
#include "amdgpu_ucode.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
#include "vid.h"
|
#include "vid.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_pm.h"
|
#include "amdgpu_pm.h"
|
||||||
#include "cikd.h"
|
#include "cikd.h"
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
* Authors: Alex Deucher
|
* Authors: Alex Deucher
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "cikd.h"
|
#include "cikd.h"
|
||||||
#include "kv_dpm.h"
|
#include "kv_dpm.h"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_psp.h"
|
#include "amdgpu_psp.h"
|
||||||
#include "amdgpu_ucode.h"
|
#include "amdgpu_ucode.h"
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_atombios.h"
|
#include "amdgpu_atombios.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_pm.h"
|
#include "amdgpu_pm.h"
|
||||||
#include "amdgpu_dpm.h"
|
#include "amdgpu_dpm.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
#include "sid.h"
|
#include "sid.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "sid.h"
|
#include "sid.h"
|
||||||
#include "ppsmc.h"
|
#include "ppsmc.h"
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
#include <linux/firmware.h>
|
#include <linux/firmware.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_atomfirmware.h"
|
#include "amdgpu_atomfirmware.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
#include "vid.h"
|
#include "vid.h"
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
#include "soc15.h"
|
#include "soc15.h"
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include "drmP.h"
|
#include <drm/drmP.h>
|
||||||
#include "amdgpu.h"
|
#include "amdgpu.h"
|
||||||
#include "amdgpu_atombios.h"
|
#include "amdgpu_atombios.h"
|
||||||
#include "amdgpu_ih.h"
|
#include "amdgpu_ih.h"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
# Makefile for Heterogenous System Architecture support for AMD GPU devices
|
# Makefile for Heterogenous System Architecture support for AMD GPU devices
|
||||||
#
|
#
|
||||||
|
|
||||||
ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/amd/include/ \
|
ccflags-y := -Idrivers/gpu/drm/amd/include/ \
|
||||||
-Idrivers/gpu/drm/amd/include/asic_reg
|
-Idrivers/gpu/drm/amd/include/asic_reg
|
||||||
|
|
||||||
amdkfd-y := kfd_module.o kfd_device.o kfd_chardev.o kfd_topology.o \
|
amdkfd-y := kfd_module.o kfd_device.o kfd_chardev.o kfd_topology.o \
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
subdir-ccflags-y += -Iinclude/drm \
|
subdir-ccflags-y += \
|
||||||
-I$(FULL_AMD_PATH)/powerplay/inc/ \
|
-I$(FULL_AMD_PATH)/powerplay/inc/ \
|
||||||
-I$(FULL_AMD_PATH)/include/asic_reg \
|
-I$(FULL_AMD_PATH)/include/asic_reg \
|
||||||
-I$(FULL_AMD_PATH)/include \
|
-I$(FULL_AMD_PATH)/include \
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "pp_debug.h"
|
#include "pp_debug.h"
|
||||||
#include "linux/delay.h"
|
#include <linux/delay.h>
|
||||||
#include <linux/types.h>
|
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/types.h>
|
||||||
#include <drm/amdgpu_drm.h>
|
#include <drm/amdgpu_drm.h>
|
||||||
#include "cgs_common.h"
|
#include "cgs_common.h"
|
||||||
#include "power_state.h"
|
#include "power_state.h"
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/delay.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include "linux/delay.h"
|
|
||||||
#include "hwmgr.h"
|
#include "hwmgr.h"
|
||||||
#include "amd_acpi.h"
|
#include "amd_acpi.h"
|
||||||
#include "pp_acpi.h"
|
#include "pp_acpi.h"
|
||||||
|
|
|
@ -21,11 +21,11 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include "pp_debug.h"
|
#include "pp_debug.h"
|
||||||
|
#include <linux/delay.h>
|
||||||
|
#include <linux/fb.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/fb.h>
|
|
||||||
#include <asm/div64.h>
|
#include <asm/div64.h>
|
||||||
#include "linux/delay.h"
|
|
||||||
#include "pp_acpi.h"
|
#include "pp_acpi.h"
|
||||||
#include "ppatomctrl.h"
|
#include "ppatomctrl.h"
|
||||||
#include "atombios.h"
|
#include "atombios.h"
|
||||||
|
|
|
@ -20,10 +20,11 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <linux/delay.h>
|
||||||
|
#include <linux/fb.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/fb.h>
|
|
||||||
#include "linux/delay.h"
|
|
||||||
|
|
||||||
#include "hwmgr.h"
|
#include "hwmgr.h"
|
||||||
#include "amd_powerplay.h"
|
#include "amd_powerplay.h"
|
||||||
|
|
|
@ -20,11 +20,13 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/types.h>
|
|
||||||
|
#include <linux/delay.h>
|
||||||
|
#include <linux/gfp.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/gfp.h>
|
#include <linux/types.h>
|
||||||
#include "linux/delay.h"
|
|
||||||
#include "cgs_common.h"
|
#include "cgs_common.h"
|
||||||
#include "smu/smu_8_0_d.h"
|
#include "smu/smu_8_0_d.h"
|
||||||
#include "smu/smu_8_0_sh_mask.h"
|
#include "smu/smu_8_0_sh_mask.h"
|
||||||
|
|
|
@ -20,15 +20,16 @@
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
* OTHER DEALINGS IN THE SOFTWARE.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#include <linux/types.h>
|
|
||||||
|
#include <linux/delay.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
#include <linux/types.h>
|
||||||
#include <drm/amdgpu_drm.h>
|
#include <drm/amdgpu_drm.h>
|
||||||
#include "pp_instance.h"
|
#include "pp_instance.h"
|
||||||
#include "smumgr.h"
|
#include "smumgr.h"
|
||||||
#include "cgs_common.h"
|
#include "cgs_common.h"
|
||||||
#include "linux/delay.h"
|
|
||||||
|
|
||||||
MODULE_FIRMWARE("amdgpu/topaz_smc.bin");
|
MODULE_FIRMWARE("amdgpu/topaz_smc.bin");
|
||||||
MODULE_FIRMWARE("amdgpu/topaz_k_smc.bin");
|
MODULE_FIRMWARE("amdgpu/topaz_k_smc.bin");
|
||||||
|
|
|
@ -65,6 +65,6 @@ void malidp_de_planes_destroy(struct drm_device *drm);
|
||||||
int malidp_crtc_init(struct drm_device *drm);
|
int malidp_crtc_init(struct drm_device *drm);
|
||||||
|
|
||||||
/* often used combination of rotational bits */
|
/* often used combination of rotational bits */
|
||||||
#define MALIDP_ROTATED_MASK (DRM_ROTATE_90 | DRM_ROTATE_270)
|
#define MALIDP_ROTATED_MASK (DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_270)
|
||||||
|
|
||||||
#endif /* __MALIDP_DRV_H__ */
|
#endif /* __MALIDP_DRV_H__ */
|
||||||
|
|
|
@ -80,7 +80,7 @@ static void malidp_plane_reset(struct drm_plane *plane)
|
||||||
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
state = kzalloc(sizeof(*state), GFP_KERNEL);
|
||||||
if (state) {
|
if (state) {
|
||||||
state->base.plane = plane;
|
state->base.plane = plane;
|
||||||
state->base.rotation = DRM_ROTATE_0;
|
state->base.rotation = DRM_MODE_ROTATE_0;
|
||||||
plane->state = &state->base;
|
plane->state = &state->base;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -221,7 +221,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
/* packed RGB888 / BGR888 can't be rotated or flipped */
|
/* packed RGB888 / BGR888 can't be rotated or flipped */
|
||||||
if (state->rotation != DRM_ROTATE_0 &&
|
if (state->rotation != DRM_MODE_ROTATE_0 &&
|
||||||
(fb->format->format == DRM_FORMAT_RGB888 ||
|
(fb->format->format == DRM_FORMAT_RGB888 ||
|
||||||
fb->format->format == DRM_FORMAT_BGR888))
|
fb->format->format == DRM_FORMAT_BGR888))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -315,12 +315,12 @@ static void malidp_de_plane_update(struct drm_plane *plane,
|
||||||
val &= ~LAYER_ROT_MASK;
|
val &= ~LAYER_ROT_MASK;
|
||||||
|
|
||||||
/* setup the rotation and axis flip bits */
|
/* setup the rotation and axis flip bits */
|
||||||
if (plane->state->rotation & DRM_ROTATE_MASK)
|
if (plane->state->rotation & DRM_MODE_ROTATE_MASK)
|
||||||
val |= ilog2(plane->state->rotation & DRM_ROTATE_MASK) <<
|
val |= ilog2(plane->state->rotation & DRM_MODE_ROTATE_MASK) <<
|
||||||
LAYER_ROT_OFFSET;
|
LAYER_ROT_OFFSET;
|
||||||
if (plane->state->rotation & DRM_REFLECT_X)
|
if (plane->state->rotation & DRM_MODE_REFLECT_X)
|
||||||
val |= LAYER_H_FLIP;
|
val |= LAYER_H_FLIP;
|
||||||
if (plane->state->rotation & DRM_REFLECT_Y)
|
if (plane->state->rotation & DRM_MODE_REFLECT_Y)
|
||||||
val |= LAYER_V_FLIP;
|
val |= LAYER_V_FLIP;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -370,8 +370,8 @@ int malidp_de_planes_init(struct drm_device *drm)
|
||||||
struct malidp_plane *plane = NULL;
|
struct malidp_plane *plane = NULL;
|
||||||
enum drm_plane_type plane_type;
|
enum drm_plane_type plane_type;
|
||||||
unsigned long crtcs = 1 << drm->mode_config.num_crtc;
|
unsigned long crtcs = 1 << drm->mode_config.num_crtc;
|
||||||
unsigned long flags = DRM_ROTATE_0 | DRM_ROTATE_90 | DRM_ROTATE_180 |
|
unsigned long flags = DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_180 |
|
||||||
DRM_ROTATE_270 | DRM_REFLECT_X | DRM_REFLECT_Y;
|
DRM_MODE_ROTATE_270 | DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y;
|
||||||
u32 *formats;
|
u32 *formats;
|
||||||
int ret, i, j, n;
|
int ret, i, j, n;
|
||||||
|
|
||||||
|
@ -420,7 +420,7 @@ int malidp_de_planes_init(struct drm_device *drm)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_plane_create_rotation_property(&plane->base, DRM_ROTATE_0, flags);
|
drm_plane_create_rotation_property(&plane->base, DRM_MODE_ROTATE_0, flags);
|
||||||
malidp_hw_write(malidp->dev, MALIDP_ALPHA_LUT,
|
malidp_hw_write(malidp->dev, MALIDP_ALPHA_LUT,
|
||||||
plane->layer->base + MALIDP_LAYER_COMPOSE);
|
plane->layer->base + MALIDP_LAYER_COMPOSE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -125,7 +125,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc,
|
||||||
src_x, src_y, src_w, src_h);
|
src_x, src_y, src_w, src_h);
|
||||||
|
|
||||||
ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip,
|
ret = drm_plane_helper_check_update(plane, crtc, fb, &src, &dest, &clip,
|
||||||
DRM_ROTATE_0,
|
DRM_MODE_ROTATE_0,
|
||||||
0, INT_MAX, true, false, &visible);
|
0, INT_MAX, true, false, &visible);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
# Makefile for the drm device driver. This driver provides support for the
|
# Makefile for the drm device driver. This driver provides support for the
|
||||||
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
|
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
|
||||||
|
|
||||||
ccflags-y := -Iinclude/drm
|
|
||||||
|
|
||||||
ast-y := ast_drv.o ast_main.o ast_mode.o ast_fb.o ast_ttm.o ast_post.o ast_dp501.o
|
ast-y := ast_drv.o ast_main.o ast_mode.o ast_fb.o ast_ttm.o ast_post.o ast_dp501.o
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_AST) := ast.o
|
obj-$(CONFIG_DRM_AST) := ast.o
|
||||||
|
|
|
@ -26,8 +26,9 @@
|
||||||
* Authors: Dave Airlie <airlied@redhat.com>
|
* Authors: Dave Airlie <airlied@redhat.com>
|
||||||
*/
|
*/
|
||||||
#include <drm/drmP.h>
|
#include <drm/drmP.h>
|
||||||
|
#include <drm/ttm/ttm_page_alloc.h>
|
||||||
|
|
||||||
#include "ast_drv.h"
|
#include "ast_drv.h"
|
||||||
#include <ttm/ttm_page_alloc.h>
|
|
||||||
|
|
||||||
static inline struct ast_private *
|
static inline struct ast_private *
|
||||||
ast_bdev(struct ttm_bo_device *bd)
|
ast_bdev(struct ttm_bo_device *bd)
|
||||||
|
|
|
@ -678,8 +678,8 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
|
||||||
if (!state->bpp[i])
|
if (!state->bpp[i])
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
switch (state->base.rotation & DRM_ROTATE_MASK) {
|
switch (state->base.rotation & DRM_MODE_ROTATE_MASK) {
|
||||||
case DRM_ROTATE_90:
|
case DRM_MODE_ROTATE_90:
|
||||||
offset = ((y_offset + state->src_y + patched_src_w - 1) /
|
offset = ((y_offset + state->src_y + patched_src_w - 1) /
|
||||||
ydiv) * fb->pitches[i];
|
ydiv) * fb->pitches[i];
|
||||||
offset += ((x_offset + state->src_x) / xdiv) *
|
offset += ((x_offset + state->src_x) / xdiv) *
|
||||||
|
@ -688,7 +688,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
|
||||||
fb->pitches[i];
|
fb->pitches[i];
|
||||||
state->pstride[i] = -fb->pitches[i] - state->bpp[i];
|
state->pstride[i] = -fb->pitches[i] - state->bpp[i];
|
||||||
break;
|
break;
|
||||||
case DRM_ROTATE_180:
|
case DRM_MODE_ROTATE_180:
|
||||||
offset = ((y_offset + state->src_y + patched_src_h - 1) /
|
offset = ((y_offset + state->src_y + patched_src_h - 1) /
|
||||||
ydiv) * fb->pitches[i];
|
ydiv) * fb->pitches[i];
|
||||||
offset += ((x_offset + state->src_x + patched_src_w - 1) /
|
offset += ((x_offset + state->src_x + patched_src_w - 1) /
|
||||||
|
@ -697,7 +697,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
|
||||||
state->bpp[i]) - fb->pitches[i];
|
state->bpp[i]) - fb->pitches[i];
|
||||||
state->pstride[i] = -2 * state->bpp[i];
|
state->pstride[i] = -2 * state->bpp[i];
|
||||||
break;
|
break;
|
||||||
case DRM_ROTATE_270:
|
case DRM_MODE_ROTATE_270:
|
||||||
offset = ((y_offset + state->src_y) / ydiv) *
|
offset = ((y_offset + state->src_y) / ydiv) *
|
||||||
fb->pitches[i];
|
fb->pitches[i];
|
||||||
offset += ((x_offset + state->src_x + patched_src_h - 1) /
|
offset += ((x_offset + state->src_x + patched_src_h - 1) /
|
||||||
|
@ -707,7 +707,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
|
||||||
(2 * state->bpp[i]);
|
(2 * state->bpp[i]);
|
||||||
state->pstride[i] = fb->pitches[i] - state->bpp[i];
|
state->pstride[i] = fb->pitches[i] - state->bpp[i];
|
||||||
break;
|
break;
|
||||||
case DRM_ROTATE_0:
|
case DRM_MODE_ROTATE_0:
|
||||||
default:
|
default:
|
||||||
offset = ((y_offset + state->src_y) / ydiv) *
|
offset = ((y_offset + state->src_y) / ydiv) *
|
||||||
fb->pitches[i];
|
fb->pitches[i];
|
||||||
|
@ -864,11 +864,11 @@ static int atmel_hlcdc_plane_init_properties(struct atmel_hlcdc_plane *plane,
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = drm_plane_create_rotation_property(&plane->base,
|
ret = drm_plane_create_rotation_property(&plane->base,
|
||||||
DRM_ROTATE_0,
|
DRM_MODE_ROTATE_0,
|
||||||
DRM_ROTATE_0 |
|
DRM_MODE_ROTATE_0 |
|
||||||
DRM_ROTATE_90 |
|
DRM_MODE_ROTATE_90 |
|
||||||
DRM_ROTATE_180 |
|
DRM_MODE_ROTATE_180 |
|
||||||
DRM_ROTATE_270);
|
DRM_MODE_ROTATE_270);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
ccflags-y := -Iinclude/drm
|
|
||||||
bochs-drm-y := bochs_drv.o bochs_mm.o bochs_kms.o bochs_fbdev.o bochs_hw.o
|
bochs-drm-y := bochs_drv.o bochs_mm.o bochs_kms.o bochs_fbdev.o bochs_hw.o
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_BOCHS) += bochs-drm.o
|
obj-$(CONFIG_DRM_BOCHS) += bochs-drm.o
|
||||||
|
|
|
@ -9,8 +9,8 @@
|
||||||
|
|
||||||
#include <drm/drm_gem.h>
|
#include <drm/drm_gem.h>
|
||||||
|
|
||||||
#include <ttm/ttm_bo_driver.h>
|
#include <drm/ttm/ttm_bo_driver.h>
|
||||||
#include <ttm/ttm_page_alloc.h>
|
#include <drm/ttm/ttm_page_alloc.h>
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
ccflags-y := -Iinclude/drm
|
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o
|
obj-$(CONFIG_DRM_ANALOGIX_ANX78XX) += analogix-anx78xx.o
|
||||||
obj-$(CONFIG_DRM_DUMB_VGA_DAC) += dumb-vga-dac.o
|
obj-$(CONFIG_DRM_DUMB_VGA_DAC) += dumb-vga-dac.o
|
||||||
obj-$(CONFIG_DRM_LVDS_ENCODER) += lvds-encoder.o
|
obj-$(CONFIG_DRM_LVDS_ENCODER) += lvds-encoder.o
|
||||||
|
|
|
@ -20,15 +20,13 @@
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/of.h>
|
#include <linux/of.h>
|
||||||
#include <linux/of_gpio.h>
|
#include <linux/of_gpio.h>
|
||||||
|
#include <drm/drm_atomic_helper.h>
|
||||||
|
#include <drm/drm_crtc.h>
|
||||||
|
#include <drm/drm_crtc_helper.h>
|
||||||
|
#include <drm/drm_edid.h>
|
||||||
#include <drm/drm_of.h>
|
#include <drm/drm_of.h>
|
||||||
#include <drm/drm_panel.h>
|
#include <drm/drm_panel.h>
|
||||||
|
#include <drm/drmP.h>
|
||||||
#include "drm_crtc.h"
|
|
||||||
#include "drm_crtc_helper.h"
|
|
||||||
#include "drm_atomic_helper.h"
|
|
||||||
#include "drm_edid.h"
|
|
||||||
#include "drmP.h"
|
|
||||||
|
|
||||||
#define PTN3460_EDID_ADDR 0x0
|
#define PTN3460_EDID_ADDR 0x0
|
||||||
#define PTN3460_EDID_EMULATION_ADDR 0x84
|
#define PTN3460_EDID_EMULATION_ADDR 0x84
|
||||||
|
|
|
@ -24,14 +24,12 @@
|
||||||
#include <linux/of_device.h>
|
#include <linux/of_device.h>
|
||||||
#include <linux/pm.h>
|
#include <linux/pm.h>
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
|
#include <drm/drm_atomic_helper.h>
|
||||||
|
#include <drm/drm_crtc.h>
|
||||||
|
#include <drm/drm_crtc_helper.h>
|
||||||
#include <drm/drm_of.h>
|
#include <drm/drm_of.h>
|
||||||
#include <drm/drm_panel.h>
|
#include <drm/drm_panel.h>
|
||||||
|
#include <drm/drmP.h>
|
||||||
#include "drmP.h"
|
|
||||||
#include "drm_crtc.h"
|
|
||||||
#include "drm_crtc_helper.h"
|
|
||||||
#include "drm_atomic_helper.h"
|
|
||||||
|
|
||||||
/* Brightness scale on the Parade chip */
|
/* Brightness scale on the Parade chip */
|
||||||
#define PS8622_MAX_BRIGHTNESS 0xff
|
#define PS8622_MAX_BRIGHTNESS 0xff
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
ccflags-y := -Iinclude/drm
|
|
||||||
cirrus-y := cirrus_main.o cirrus_mode.o \
|
cirrus-y := cirrus_main.o cirrus_mode.o \
|
||||||
cirrus_drv.o cirrus_fbdev.o cirrus_ttm.o
|
cirrus_drv.o cirrus_fbdev.o cirrus_ttm.o
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,9 @@
|
||||||
* Authors: Dave Airlie <airlied@redhat.com>
|
* Authors: Dave Airlie <airlied@redhat.com>
|
||||||
*/
|
*/
|
||||||
#include <drm/drmP.h>
|
#include <drm/drmP.h>
|
||||||
|
#include <drm/ttm/ttm_page_alloc.h>
|
||||||
|
|
||||||
#include "cirrus_drv.h"
|
#include "cirrus_drv.h"
|
||||||
#include <ttm/ttm_page_alloc.h>
|
|
||||||
|
|
||||||
static inline struct cirrus_device *
|
static inline struct cirrus_device *
|
||||||
cirrus_bdev(struct ttm_bo_device *bd)
|
cirrus_bdev(struct ttm_bo_device *bd)
|
||||||
|
|
|
@ -781,7 +781,7 @@ int drm_atomic_plane_set_property(struct drm_plane *plane,
|
||||||
} else if (property == config->prop_src_h) {
|
} else if (property == config->prop_src_h) {
|
||||||
state->src_h = val;
|
state->src_h = val;
|
||||||
} else if (property == plane->rotation_property) {
|
} else if (property == plane->rotation_property) {
|
||||||
if (!is_power_of_2(val & DRM_ROTATE_MASK))
|
if (!is_power_of_2(val & DRM_MODE_ROTATE_MASK))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
state->rotation = val;
|
state->rotation = val;
|
||||||
} else if (property == plane->zpos_property) {
|
} else if (property == plane->zpos_property) {
|
||||||
|
|
|
@ -3225,7 +3225,7 @@ void drm_atomic_helper_plane_reset(struct drm_plane *plane)
|
||||||
|
|
||||||
if (plane->state) {
|
if (plane->state) {
|
||||||
plane->state->plane = plane;
|
plane->state->plane = plane;
|
||||||
plane->state->rotation = DRM_ROTATE_0;
|
plane->state->rotation = DRM_MODE_ROTATE_0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
|
EXPORT_SYMBOL(drm_atomic_helper_plane_reset);
|
||||||
|
|
|
@ -119,17 +119,17 @@
|
||||||
* drm_property_create_bitmask()) called "rotation" and has the following
|
* drm_property_create_bitmask()) called "rotation" and has the following
|
||||||
* bitmask enumaration values:
|
* bitmask enumaration values:
|
||||||
*
|
*
|
||||||
* DRM_ROTATE_0:
|
* DRM_MODE_ROTATE_0:
|
||||||
* "rotate-0"
|
* "rotate-0"
|
||||||
* DRM_ROTATE_90:
|
* DRM_MODE_ROTATE_90:
|
||||||
* "rotate-90"
|
* "rotate-90"
|
||||||
* DRM_ROTATE_180:
|
* DRM_MODE_ROTATE_180:
|
||||||
* "rotate-180"
|
* "rotate-180"
|
||||||
* DRM_ROTATE_270:
|
* DRM_MODE_ROTATE_270:
|
||||||
* "rotate-270"
|
* "rotate-270"
|
||||||
* DRM_REFLECT_X:
|
* DRM_MODE_REFLECT_X:
|
||||||
* "reflect-x"
|
* "reflect-x"
|
||||||
* DRM_REFELCT_Y:
|
* DRM_MODE_REFLECT_Y:
|
||||||
* "reflect-y"
|
* "reflect-y"
|
||||||
*
|
*
|
||||||
* Rotation is the specified amount in degrees in counter clockwise direction,
|
* Rotation is the specified amount in degrees in counter clockwise direction,
|
||||||
|
@ -142,17 +142,17 @@ int drm_plane_create_rotation_property(struct drm_plane *plane,
|
||||||
unsigned int supported_rotations)
|
unsigned int supported_rotations)
|
||||||
{
|
{
|
||||||
static const struct drm_prop_enum_list props[] = {
|
static const struct drm_prop_enum_list props[] = {
|
||||||
{ __builtin_ffs(DRM_ROTATE_0) - 1, "rotate-0" },
|
{ __builtin_ffs(DRM_MODE_ROTATE_0) - 1, "rotate-0" },
|
||||||
{ __builtin_ffs(DRM_ROTATE_90) - 1, "rotate-90" },
|
{ __builtin_ffs(DRM_MODE_ROTATE_90) - 1, "rotate-90" },
|
||||||
{ __builtin_ffs(DRM_ROTATE_180) - 1, "rotate-180" },
|
{ __builtin_ffs(DRM_MODE_ROTATE_180) - 1, "rotate-180" },
|
||||||
{ __builtin_ffs(DRM_ROTATE_270) - 1, "rotate-270" },
|
{ __builtin_ffs(DRM_MODE_ROTATE_270) - 1, "rotate-270" },
|
||||||
{ __builtin_ffs(DRM_REFLECT_X) - 1, "reflect-x" },
|
{ __builtin_ffs(DRM_MODE_REFLECT_X) - 1, "reflect-x" },
|
||||||
{ __builtin_ffs(DRM_REFLECT_Y) - 1, "reflect-y" },
|
{ __builtin_ffs(DRM_MODE_REFLECT_Y) - 1, "reflect-y" },
|
||||||
};
|
};
|
||||||
struct drm_property *prop;
|
struct drm_property *prop;
|
||||||
|
|
||||||
WARN_ON((supported_rotations & DRM_ROTATE_MASK) == 0);
|
WARN_ON((supported_rotations & DRM_MODE_ROTATE_MASK) == 0);
|
||||||
WARN_ON(!is_power_of_2(rotation & DRM_ROTATE_MASK));
|
WARN_ON(!is_power_of_2(rotation & DRM_MODE_ROTATE_MASK));
|
||||||
WARN_ON(rotation & ~supported_rotations);
|
WARN_ON(rotation & ~supported_rotations);
|
||||||
|
|
||||||
prop = drm_property_create_bitmask(plane->dev, 0, "rotation",
|
prop = drm_property_create_bitmask(plane->dev, 0, "rotation",
|
||||||
|
@ -178,14 +178,14 @@ EXPORT_SYMBOL(drm_plane_create_rotation_property);
|
||||||
* @supported_rotations: Supported rotations
|
* @supported_rotations: Supported rotations
|
||||||
*
|
*
|
||||||
* Attempt to simplify the rotation to a form that is supported.
|
* Attempt to simplify the rotation to a form that is supported.
|
||||||
* Eg. if the hardware supports everything except DRM_REFLECT_X
|
* Eg. if the hardware supports everything except DRM_MODE_REFLECT_X
|
||||||
* one could call this function like this:
|
* one could call this function like this:
|
||||||
*
|
*
|
||||||
* drm_rotation_simplify(rotation, DRM_ROTATE_0 |
|
* drm_rotation_simplify(rotation, DRM_MODE_ROTATE_0 |
|
||||||
* DRM_ROTATE_90 | DRM_ROTATE_180 |
|
* DRM_MODE_ROTATE_90 | DRM_MODE_ROTATE_180 |
|
||||||
* DRM_ROTATE_270 | DRM_REFLECT_Y);
|
* DRM_MODE_ROTATE_270 | DRM_MODE_REFLECT_Y);
|
||||||
*
|
*
|
||||||
* to eliminate the DRM_ROTATE_X flag. Depending on what kind of
|
* to eliminate the DRM_MODE_ROTATE_X flag. Depending on what kind of
|
||||||
* transforms the hardware supports, this function may not
|
* transforms the hardware supports, this function may not
|
||||||
* be able to produce a supported transform, so the caller should
|
* be able to produce a supported transform, so the caller should
|
||||||
* check the result afterwards.
|
* check the result afterwards.
|
||||||
|
@ -194,9 +194,10 @@ unsigned int drm_rotation_simplify(unsigned int rotation,
|
||||||
unsigned int supported_rotations)
|
unsigned int supported_rotations)
|
||||||
{
|
{
|
||||||
if (rotation & ~supported_rotations) {
|
if (rotation & ~supported_rotations) {
|
||||||
rotation ^= DRM_REFLECT_X | DRM_REFLECT_Y;
|
rotation ^= DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y;
|
||||||
rotation = (rotation & DRM_REFLECT_MASK) |
|
rotation = (rotation & DRM_MODE_REFLECT_MASK) |
|
||||||
BIT((ffs(rotation & DRM_ROTATE_MASK) + 1) % 4);
|
BIT((ffs(rotation & DRM_MODE_ROTATE_MASK) + 1)
|
||||||
|
% 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
return rotation;
|
return rotation;
|
||||||
|
|
|
@ -378,7 +378,7 @@ retry:
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
plane_state->rotation = DRM_ROTATE_0;
|
plane_state->rotation = DRM_MODE_ROTATE_0;
|
||||||
|
|
||||||
plane->old_fb = plane->fb;
|
plane->old_fb = plane->fb;
|
||||||
plane_mask |= 1 << drm_plane_index(plane);
|
plane_mask |= 1 << drm_plane_index(plane);
|
||||||
|
@ -431,7 +431,7 @@ static int restore_fbdev_mode_legacy(struct drm_fb_helper *fb_helper)
|
||||||
if (plane->rotation_property)
|
if (plane->rotation_property)
|
||||||
drm_mode_plane_set_obj_prop(plane,
|
drm_mode_plane_set_obj_prop(plane,
|
||||||
plane->rotation_property,
|
plane->rotation_property,
|
||||||
DRM_ROTATE_0);
|
DRM_MODE_ROTATE_0);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < fb_helper->crtc_count; i++) {
|
for (i = 0; i < fb_helper->crtc_count; i++) {
|
||||||
|
|
|
@ -521,7 +521,7 @@ struct page **drm_gem_get_pages(struct drm_gem_object *obj)
|
||||||
|
|
||||||
npages = obj->size >> PAGE_SHIFT;
|
npages = obj->size >> PAGE_SHIFT;
|
||||||
|
|
||||||
pages = drm_malloc_ab(npages, sizeof(struct page *));
|
pages = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL);
|
||||||
if (pages == NULL)
|
if (pages == NULL)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
|
@ -546,7 +546,7 @@ fail:
|
||||||
while (i--)
|
while (i--)
|
||||||
put_page(pages[i]);
|
put_page(pages[i]);
|
||||||
|
|
||||||
drm_free_large(pages);
|
kvfree(pages);
|
||||||
return ERR_CAST(p);
|
return ERR_CAST(p);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_gem_get_pages);
|
EXPORT_SYMBOL(drm_gem_get_pages);
|
||||||
|
@ -582,7 +582,7 @@ void drm_gem_put_pages(struct drm_gem_object *obj, struct page **pages,
|
||||||
put_page(pages[i]);
|
put_page(pages[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_free_large(pages);
|
kvfree(pages);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(drm_gem_put_pages);
|
EXPORT_SYMBOL(drm_gem_put_pages);
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,7 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
|
||||||
|
|
||||||
ret = drm_plane_helper_check_update(plane, crtc, fb,
|
ret = drm_plane_helper_check_update(plane, crtc, fb,
|
||||||
&src, &dest, &clip,
|
&src, &dest, &clip,
|
||||||
DRM_ROTATE_0,
|
DRM_MODE_ROTATE_0,
|
||||||
DRM_PLANE_HELPER_NO_SCALING,
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
DRM_PLANE_HELPER_NO_SCALING,
|
DRM_PLANE_HELPER_NO_SCALING,
|
||||||
false, false, &visible);
|
false, false, &visible);
|
||||||
|
|
|
@ -310,38 +310,38 @@ void drm_rect_rotate(struct drm_rect *r,
|
||||||
{
|
{
|
||||||
struct drm_rect tmp;
|
struct drm_rect tmp;
|
||||||
|
|
||||||
if (rotation & (DRM_REFLECT_X | DRM_REFLECT_Y)) {
|
if (rotation & (DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y)) {
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
|
|
||||||
if (rotation & DRM_REFLECT_X) {
|
if (rotation & DRM_MODE_REFLECT_X) {
|
||||||
r->x1 = width - tmp.x2;
|
r->x1 = width - tmp.x2;
|
||||||
r->x2 = width - tmp.x1;
|
r->x2 = width - tmp.x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rotation & DRM_REFLECT_Y) {
|
if (rotation & DRM_MODE_REFLECT_Y) {
|
||||||
r->y1 = height - tmp.y2;
|
r->y1 = height - tmp.y2;
|
||||||
r->y2 = height - tmp.y1;
|
r->y2 = height - tmp.y1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (rotation & DRM_ROTATE_MASK) {
|
switch (rotation & DRM_MODE_ROTATE_MASK) {
|
||||||
case DRM_ROTATE_0:
|
case DRM_MODE_ROTATE_0:
|
||||||
break;
|
break;
|
||||||
case DRM_ROTATE_90:
|
case DRM_MODE_ROTATE_90:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = tmp.y1;
|
r->x1 = tmp.y1;
|
||||||
r->x2 = tmp.y2;
|
r->x2 = tmp.y2;
|
||||||
r->y1 = width - tmp.x2;
|
r->y1 = width - tmp.x2;
|
||||||
r->y2 = width - tmp.x1;
|
r->y2 = width - tmp.x1;
|
||||||
break;
|
break;
|
||||||
case DRM_ROTATE_180:
|
case DRM_MODE_ROTATE_180:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = width - tmp.x2;
|
r->x1 = width - tmp.x2;
|
||||||
r->x2 = width - tmp.x1;
|
r->x2 = width - tmp.x1;
|
||||||
r->y1 = height - tmp.y2;
|
r->y1 = height - tmp.y2;
|
||||||
r->y2 = height - tmp.y1;
|
r->y2 = height - tmp.y1;
|
||||||
break;
|
break;
|
||||||
case DRM_ROTATE_270:
|
case DRM_MODE_ROTATE_270:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = height - tmp.y2;
|
r->x1 = height - tmp.y2;
|
||||||
r->x2 = height - tmp.y1;
|
r->x2 = height - tmp.y1;
|
||||||
|
@ -373,8 +373,8 @@ EXPORT_SYMBOL(drm_rect_rotate);
|
||||||
* them when doing a rotatation and its inverse.
|
* them when doing a rotatation and its inverse.
|
||||||
* That is, if you do ::
|
* That is, if you do ::
|
||||||
*
|
*
|
||||||
* drm_rotate(&r, width, height, rotation);
|
* DRM_MODE_PROP_ROTATE(&r, width, height, rotation);
|
||||||
* drm_rotate_inv(&r, width, height, rotation);
|
* DRM_MODE_ROTATE_inv(&r, width, height, rotation);
|
||||||
*
|
*
|
||||||
* you will always get back the original rectangle.
|
* you will always get back the original rectangle.
|
||||||
*/
|
*/
|
||||||
|
@ -384,24 +384,24 @@ void drm_rect_rotate_inv(struct drm_rect *r,
|
||||||
{
|
{
|
||||||
struct drm_rect tmp;
|
struct drm_rect tmp;
|
||||||
|
|
||||||
switch (rotation & DRM_ROTATE_MASK) {
|
switch (rotation & DRM_MODE_ROTATE_MASK) {
|
||||||
case DRM_ROTATE_0:
|
case DRM_MODE_ROTATE_0:
|
||||||
break;
|
break;
|
||||||
case DRM_ROTATE_90:
|
case DRM_MODE_ROTATE_90:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = width - tmp.y2;
|
r->x1 = width - tmp.y2;
|
||||||
r->x2 = width - tmp.y1;
|
r->x2 = width - tmp.y1;
|
||||||
r->y1 = tmp.x1;
|
r->y1 = tmp.x1;
|
||||||
r->y2 = tmp.x2;
|
r->y2 = tmp.x2;
|
||||||
break;
|
break;
|
||||||
case DRM_ROTATE_180:
|
case DRM_MODE_ROTATE_180:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = width - tmp.x2;
|
r->x1 = width - tmp.x2;
|
||||||
r->x2 = width - tmp.x1;
|
r->x2 = width - tmp.x1;
|
||||||
r->y1 = height - tmp.y2;
|
r->y1 = height - tmp.y2;
|
||||||
r->y2 = height - tmp.y1;
|
r->y2 = height - tmp.y1;
|
||||||
break;
|
break;
|
||||||
case DRM_ROTATE_270:
|
case DRM_MODE_ROTATE_270:
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
r->x1 = tmp.y1;
|
r->x1 = tmp.y1;
|
||||||
r->x2 = tmp.y2;
|
r->x2 = tmp.y2;
|
||||||
|
@ -412,15 +412,15 @@ void drm_rect_rotate_inv(struct drm_rect *r,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rotation & (DRM_REFLECT_X | DRM_REFLECT_Y)) {
|
if (rotation & (DRM_MODE_REFLECT_X | DRM_MODE_REFLECT_Y)) {
|
||||||
tmp = *r;
|
tmp = *r;
|
||||||
|
|
||||||
if (rotation & DRM_REFLECT_X) {
|
if (rotation & DRM_MODE_REFLECT_X) {
|
||||||
r->x1 = width - tmp.x2;
|
r->x1 = width - tmp.x2;
|
||||||
r->x2 = width - tmp.x1;
|
r->x2 = width - tmp.x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (rotation & DRM_REFLECT_Y) {
|
if (rotation & DRM_MODE_REFLECT_Y) {
|
||||||
r->y1 = height - tmp.y2;
|
r->y1 = height - tmp.y2;
|
||||||
r->y2 = height - tmp.y1;
|
r->y2 = height - tmp.y1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -748,7 +748,7 @@ static struct page **etnaviv_gem_userptr_do_get_pages(
|
||||||
uintptr_t ptr;
|
uintptr_t ptr;
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
|
|
||||||
pvec = drm_malloc_ab(npages, sizeof(struct page *));
|
pvec = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL);
|
||||||
if (!pvec)
|
if (!pvec)
|
||||||
return ERR_PTR(-ENOMEM);
|
return ERR_PTR(-ENOMEM);
|
||||||
|
|
||||||
|
@ -772,7 +772,7 @@ static struct page **etnaviv_gem_userptr_do_get_pages(
|
||||||
|
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
release_pages(pvec, pinned, 0);
|
release_pages(pvec, pinned, 0);
|
||||||
drm_free_large(pvec);
|
kvfree(pvec);
|
||||||
return ERR_PTR(ret);
|
return ERR_PTR(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -823,7 +823,7 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj)
|
||||||
mm = get_task_mm(etnaviv_obj->userptr.task);
|
mm = get_task_mm(etnaviv_obj->userptr.task);
|
||||||
pinned = 0;
|
pinned = 0;
|
||||||
if (mm == current->mm) {
|
if (mm == current->mm) {
|
||||||
pvec = drm_malloc_ab(npages, sizeof(struct page *));
|
pvec = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL);
|
||||||
if (!pvec) {
|
if (!pvec) {
|
||||||
mmput(mm);
|
mmput(mm);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -832,7 +832,7 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj)
|
||||||
pinned = __get_user_pages_fast(etnaviv_obj->userptr.ptr, npages,
|
pinned = __get_user_pages_fast(etnaviv_obj->userptr.ptr, npages,
|
||||||
!etnaviv_obj->userptr.ro, pvec);
|
!etnaviv_obj->userptr.ro, pvec);
|
||||||
if (pinned < 0) {
|
if (pinned < 0) {
|
||||||
drm_free_large(pvec);
|
kvfree(pvec);
|
||||||
mmput(mm);
|
mmput(mm);
|
||||||
return pinned;
|
return pinned;
|
||||||
}
|
}
|
||||||
|
@ -845,7 +845,7 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj)
|
||||||
}
|
}
|
||||||
|
|
||||||
release_pages(pvec, pinned, 0);
|
release_pages(pvec, pinned, 0);
|
||||||
drm_free_large(pvec);
|
kvfree(pvec);
|
||||||
|
|
||||||
work = kmalloc(sizeof(*work), GFP_KERNEL);
|
work = kmalloc(sizeof(*work), GFP_KERNEL);
|
||||||
if (!work) {
|
if (!work) {
|
||||||
|
@ -879,7 +879,7 @@ static void etnaviv_gem_userptr_release(struct etnaviv_gem_object *etnaviv_obj)
|
||||||
int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
|
int npages = etnaviv_obj->base.size >> PAGE_SHIFT;
|
||||||
|
|
||||||
release_pages(etnaviv_obj->pages, npages, 0);
|
release_pages(etnaviv_obj->pages, npages, 0);
|
||||||
drm_free_large(etnaviv_obj->pages);
|
kvfree(etnaviv_obj->pages);
|
||||||
}
|
}
|
||||||
put_task_struct(etnaviv_obj->userptr.task);
|
put_task_struct(etnaviv_obj->userptr.task);
|
||||||
}
|
}
|
||||||
|
|
|
@ -87,7 +87,7 @@ static void etnaviv_gem_prime_release(struct etnaviv_gem_object *etnaviv_obj)
|
||||||
* ours, just free the array we allocated:
|
* ours, just free the array we allocated:
|
||||||
*/
|
*/
|
||||||
if (etnaviv_obj->pages)
|
if (etnaviv_obj->pages)
|
||||||
drm_free_large(etnaviv_obj->pages);
|
kvfree(etnaviv_obj->pages);
|
||||||
|
|
||||||
drm_prime_gem_destroy(&etnaviv_obj->base, etnaviv_obj->sgt);
|
drm_prime_gem_destroy(&etnaviv_obj->base, etnaviv_obj->sgt);
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,7 @@ struct drm_gem_object *etnaviv_gem_prime_import_sg_table(struct drm_device *dev,
|
||||||
npages = size / PAGE_SIZE;
|
npages = size / PAGE_SIZE;
|
||||||
|
|
||||||
etnaviv_obj->sgt = sgt;
|
etnaviv_obj->sgt = sgt;
|
||||||
etnaviv_obj->pages = drm_malloc_ab(npages, sizeof(struct page *));
|
etnaviv_obj->pages = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL);
|
||||||
if (!etnaviv_obj->pages) {
|
if (!etnaviv_obj->pages) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
|
@ -343,9 +343,9 @@ int etnaviv_ioctl_gem_submit(struct drm_device *dev, void *data,
|
||||||
* Copy the command submission and bo array to kernel space in
|
* Copy the command submission and bo array to kernel space in
|
||||||
* one go, and do this outside of any locks.
|
* one go, and do this outside of any locks.
|
||||||
*/
|
*/
|
||||||
bos = drm_malloc_ab(args->nr_bos, sizeof(*bos));
|
bos = kvmalloc_array(args->nr_bos, sizeof(*bos), GFP_KERNEL);
|
||||||
relocs = drm_malloc_ab(args->nr_relocs, sizeof(*relocs));
|
relocs = kvmalloc_array(args->nr_relocs, sizeof(*relocs), GFP_KERNEL);
|
||||||
stream = drm_malloc_ab(1, args->stream_size);
|
stream = kvmalloc_array(1, args->stream_size, GFP_KERNEL);
|
||||||
cmdbuf = etnaviv_cmdbuf_new(gpu->cmdbuf_suballoc,
|
cmdbuf = etnaviv_cmdbuf_new(gpu->cmdbuf_suballoc,
|
||||||
ALIGN(args->stream_size, 8) + 8,
|
ALIGN(args->stream_size, 8) + 8,
|
||||||
args->nr_bos);
|
args->nr_bos);
|
||||||
|
@ -487,11 +487,11 @@ err_submit_cmds:
|
||||||
if (cmdbuf)
|
if (cmdbuf)
|
||||||
etnaviv_cmdbuf_free(cmdbuf);
|
etnaviv_cmdbuf_free(cmdbuf);
|
||||||
if (stream)
|
if (stream)
|
||||||
drm_free_large(stream);
|
kvfree(stream);
|
||||||
if (bos)
|
if (bos)
|
||||||
drm_free_large(bos);
|
kvfree(bos);
|
||||||
if (relocs)
|
if (relocs)
|
||||||
drm_free_large(relocs);
|
kvfree(relocs);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,8 @@ static int exynos_drm_alloc_buf(struct exynos_drm_gem *exynos_gem)
|
||||||
|
|
||||||
nr_pages = exynos_gem->size >> PAGE_SHIFT;
|
nr_pages = exynos_gem->size >> PAGE_SHIFT;
|
||||||
|
|
||||||
exynos_gem->pages = drm_calloc_large(nr_pages, sizeof(struct page *));
|
exynos_gem->pages = kvmalloc_array(nr_pages, sizeof(struct page *),
|
||||||
|
GFP_KERNEL | __GFP_ZERO);
|
||||||
if (!exynos_gem->pages) {
|
if (!exynos_gem->pages) {
|
||||||
DRM_ERROR("failed to allocate pages.\n");
|
DRM_ERROR("failed to allocate pages.\n");
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
@ -101,7 +102,7 @@ err_dma_free:
|
||||||
dma_free_attrs(to_dma_dev(dev), exynos_gem->size, exynos_gem->cookie,
|
dma_free_attrs(to_dma_dev(dev), exynos_gem->size, exynos_gem->cookie,
|
||||||
exynos_gem->dma_addr, exynos_gem->dma_attrs);
|
exynos_gem->dma_addr, exynos_gem->dma_attrs);
|
||||||
err_free:
|
err_free:
|
||||||
drm_free_large(exynos_gem->pages);
|
kvfree(exynos_gem->pages);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +123,7 @@ static void exynos_drm_free_buf(struct exynos_drm_gem *exynos_gem)
|
||||||
(dma_addr_t)exynos_gem->dma_addr,
|
(dma_addr_t)exynos_gem->dma_addr,
|
||||||
exynos_gem->dma_attrs);
|
exynos_gem->dma_attrs);
|
||||||
|
|
||||||
drm_free_large(exynos_gem->pages);
|
kvfree(exynos_gem->pages);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int exynos_drm_gem_handle_create(struct drm_gem_object *obj,
|
static int exynos_drm_gem_handle_create(struct drm_gem_object *obj,
|
||||||
|
@ -559,7 +560,7 @@ exynos_drm_gem_prime_import_sg_table(struct drm_device *dev,
|
||||||
exynos_gem->dma_addr = sg_dma_address(sgt->sgl);
|
exynos_gem->dma_addr = sg_dma_address(sgt->sgl);
|
||||||
|
|
||||||
npages = exynos_gem->size >> PAGE_SHIFT;
|
npages = exynos_gem->size >> PAGE_SHIFT;
|
||||||
exynos_gem->pages = drm_malloc_ab(npages, sizeof(struct page *));
|
exynos_gem->pages = kvmalloc_array(npages, sizeof(struct page *), GFP_KERNEL);
|
||||||
if (!exynos_gem->pages) {
|
if (!exynos_gem->pages) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto err;
|
goto err;
|
||||||
|
@ -588,7 +589,7 @@ exynos_drm_gem_prime_import_sg_table(struct drm_device *dev,
|
||||||
return &exynos_gem->base;
|
return &exynos_gem->base;
|
||||||
|
|
||||||
err_free_large:
|
err_free_large:
|
||||||
drm_free_large(exynos_gem->pages);
|
kvfree(exynos_gem->pages);
|
||||||
err:
|
err:
|
||||||
drm_gem_object_release(&exynos_gem->base);
|
drm_gem_object_release(&exynos_gem->base);
|
||||||
kfree(exynos_gem);
|
kfree(exynos_gem);
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
#
|
#
|
||||||
# KMS driver for the GMA500
|
# KMS driver for the GMA500
|
||||||
#
|
#
|
||||||
ccflags-y += -I$(srctree)/include/drm
|
|
||||||
|
|
||||||
gma500_gfx-y += \
|
gma500_gfx-y += \
|
||||||
accel_2d.o \
|
accel_2d.o \
|
||||||
|
|
|
@ -30,8 +30,6 @@
|
||||||
static struct drm_display_mode *tpo_vid_get_config_mode(struct drm_device *dev)
|
static struct drm_display_mode *tpo_vid_get_config_mode(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
struct drm_display_mode *mode;
|
struct drm_display_mode *mode;
|
||||||
struct drm_psb_private *dev_priv = dev->dev_private;
|
|
||||||
struct oaktrail_timing_info *ti = &dev_priv->gct_data.DTD;
|
|
||||||
|
|
||||||
mode = kzalloc(sizeof(*mode), GFP_KERNEL);
|
mode = kzalloc(sizeof(*mode), GFP_KERNEL);
|
||||||
if (!mode)
|
if (!mode)
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
ccflags-y := -Iinclude/drm
|
|
||||||
hibmc-drm-y := hibmc_drm_drv.o hibmc_drm_de.o hibmc_drm_vdac.o hibmc_drm_fbdev.o hibmc_ttm.o
|
hibmc-drm-y := hibmc_drm_drv.o hibmc_drm_de.o hibmc_drm_vdac.o hibmc_drm_fbdev.o hibmc_ttm.o
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_HISI_HIBMC) += hibmc-drm.o
|
obj-$(CONFIG_DRM_HISI_HIBMC) += hibmc-drm.o
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <ttm/ttm_page_alloc.h>
|
#include <drm/ttm/ttm_page_alloc.h>
|
||||||
|
|
||||||
#include "hibmc_drm_drv.h"
|
#include "hibmc_drm_drv.h"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,3 @@
|
||||||
ccflags-y := -Iinclude/drm
|
|
||||||
|
|
||||||
ch7006-y := ch7006_drv.o ch7006_mode.o
|
ch7006-y := ch7006_drv.o ch7006_mode.o
|
||||||
obj-$(CONFIG_DRM_I2C_CH7006) += ch7006.o
|
obj-$(CONFIG_DRM_I2C_CH7006) += ch7006.o
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
# Makefile for the drm device driver. This driver provides support for the
|
# Makefile for the drm device driver. This driver provides support for the
|
||||||
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
|
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
|
||||||
|
|
||||||
ccflags-y := -Iinclude/drm
|
|
||||||
i810-y := i810_drv.o i810_dma.o
|
i810-y := i810_drv.o i810_dma.o
|
||||||
|
|
||||||
obj-$(CONFIG_DRM_I810) += i810.o
|
obj-$(CONFIG_DRM_I810) += i810.o
|
||||||
|
|
|
@ -229,7 +229,7 @@ static int i915_gem_stolen_list_info(struct seq_file *m, void *data)
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
total = READ_ONCE(dev_priv->mm.object_count);
|
total = READ_ONCE(dev_priv->mm.object_count);
|
||||||
objects = drm_malloc_ab(total, sizeof(*objects));
|
objects = kvmalloc_array(total, sizeof(*objects), GFP_KERNEL);
|
||||||
if (!objects)
|
if (!objects)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
@ -274,7 +274,7 @@ static int i915_gem_stolen_list_info(struct seq_file *m, void *data)
|
||||||
|
|
||||||
mutex_unlock(&dev->struct_mutex);
|
mutex_unlock(&dev->struct_mutex);
|
||||||
out:
|
out:
|
||||||
drm_free_large(objects);
|
kvfree(objects);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3095,17 +3095,17 @@ static const char *plane_rotation(unsigned int rotation)
|
||||||
{
|
{
|
||||||
static char buf[48];
|
static char buf[48];
|
||||||
/*
|
/*
|
||||||
* According to doc only one DRM_ROTATE_ is allowed but this
|
* According to doc only one DRM_MODE_ROTATE_ is allowed but this
|
||||||
* will print them all to visualize if the values are misused
|
* will print them all to visualize if the values are misused
|
||||||
*/
|
*/
|
||||||
snprintf(buf, sizeof(buf),
|
snprintf(buf, sizeof(buf),
|
||||||
"%s%s%s%s%s%s(0x%08x)",
|
"%s%s%s%s%s%s(0x%08x)",
|
||||||
(rotation & DRM_ROTATE_0) ? "0 " : "",
|
(rotation & DRM_MODE_ROTATE_0) ? "0 " : "",
|
||||||
(rotation & DRM_ROTATE_90) ? "90 " : "",
|
(rotation & DRM_MODE_ROTATE_90) ? "90 " : "",
|
||||||
(rotation & DRM_ROTATE_180) ? "180 " : "",
|
(rotation & DRM_MODE_ROTATE_180) ? "180 " : "",
|
||||||
(rotation & DRM_ROTATE_270) ? "270 " : "",
|
(rotation & DRM_MODE_ROTATE_270) ? "270 " : "",
|
||||||
(rotation & DRM_REFLECT_X) ? "FLIPX " : "",
|
(rotation & DRM_MODE_REFLECT_X) ? "FLIPX " : "",
|
||||||
(rotation & DRM_REFLECT_Y) ? "FLIPY " : "",
|
(rotation & DRM_MODE_REFLECT_Y) ? "FLIPY " : "",
|
||||||
rotation);
|
rotation);
|
||||||
|
|
||||||
return buf;
|
return buf;
|
||||||
|
|
|
@ -2504,7 +2504,7 @@ static void *i915_gem_object_map(const struct drm_i915_gem_object *obj,
|
||||||
|
|
||||||
if (n_pages > ARRAY_SIZE(stack_pages)) {
|
if (n_pages > ARRAY_SIZE(stack_pages)) {
|
||||||
/* Too big for stack -- allocate temporary array instead */
|
/* Too big for stack -- allocate temporary array instead */
|
||||||
pages = drm_malloc_gfp(n_pages, sizeof(*pages), GFP_TEMPORARY);
|
pages = kvmalloc_array(n_pages, sizeof(*pages), GFP_TEMPORARY);
|
||||||
if (!pages)
|
if (!pages)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -2526,7 +2526,7 @@ static void *i915_gem_object_map(const struct drm_i915_gem_object *obj,
|
||||||
addr = vmap(pages, n_pages, 0, pgprot);
|
addr = vmap(pages, n_pages, 0, pgprot);
|
||||||
|
|
||||||
if (pages != stack_pages)
|
if (pages != stack_pages)
|
||||||
drm_free_large(pages);
|
kvfree(pages);
|
||||||
|
|
||||||
return addr;
|
return addr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1019,11 +1019,11 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
total += exec[i].relocation_count;
|
total += exec[i].relocation_count;
|
||||||
|
|
||||||
reloc_offset = drm_malloc_ab(count, sizeof(*reloc_offset));
|
reloc_offset = kvmalloc_array(count, sizeof(*reloc_offset), GFP_KERNEL);
|
||||||
reloc = drm_malloc_ab(total, sizeof(*reloc));
|
reloc = kvmalloc_array(total, sizeof(*reloc), GFP_KERNEL);
|
||||||
if (reloc == NULL || reloc_offset == NULL) {
|
if (reloc == NULL || reloc_offset == NULL) {
|
||||||
drm_free_large(reloc);
|
kvfree(reloc);
|
||||||
drm_free_large(reloc_offset);
|
kvfree(reloc_offset);
|
||||||
mutex_lock(&dev->struct_mutex);
|
mutex_lock(&dev->struct_mutex);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
@ -1099,8 +1099,8 @@ i915_gem_execbuffer_relocate_slow(struct drm_device *dev,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
err:
|
err:
|
||||||
drm_free_large(reloc);
|
kvfree(reloc);
|
||||||
drm_free_large(reloc_offset);
|
kvfree(reloc_offset);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1859,13 +1859,13 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Copy in the exec list from userland */
|
/* Copy in the exec list from userland */
|
||||||
exec_list = drm_malloc_ab(sizeof(*exec_list), args->buffer_count);
|
exec_list = kvmalloc_array(sizeof(*exec_list), args->buffer_count, GFP_KERNEL);
|
||||||
exec2_list = drm_malloc_ab(sizeof(*exec2_list), args->buffer_count);
|
exec2_list = kvmalloc_array(sizeof(*exec2_list), args->buffer_count, GFP_KERNEL);
|
||||||
if (exec_list == NULL || exec2_list == NULL) {
|
if (exec_list == NULL || exec2_list == NULL) {
|
||||||
DRM_DEBUG("Failed to allocate exec list for %d buffers\n",
|
DRM_DEBUG("Failed to allocate exec list for %d buffers\n",
|
||||||
args->buffer_count);
|
args->buffer_count);
|
||||||
drm_free_large(exec_list);
|
kvfree(exec_list);
|
||||||
drm_free_large(exec2_list);
|
kvfree(exec2_list);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
ret = copy_from_user(exec_list,
|
ret = copy_from_user(exec_list,
|
||||||
|
@ -1874,8 +1874,8 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
DRM_DEBUG("copy %d exec entries failed %d\n",
|
DRM_DEBUG("copy %d exec entries failed %d\n",
|
||||||
args->buffer_count, ret);
|
args->buffer_count, ret);
|
||||||
drm_free_large(exec_list);
|
kvfree(exec_list);
|
||||||
drm_free_large(exec2_list);
|
kvfree(exec2_list);
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1924,8 +1924,8 @@ i915_gem_execbuffer(struct drm_device *dev, void *data,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_free_large(exec_list);
|
kvfree(exec_list);
|
||||||
drm_free_large(exec2_list);
|
kvfree(exec2_list);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1943,7 +1943,7 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
exec2_list = drm_malloc_gfp(args->buffer_count,
|
exec2_list = kvmalloc_array(args->buffer_count,
|
||||||
sizeof(*exec2_list),
|
sizeof(*exec2_list),
|
||||||
GFP_TEMPORARY);
|
GFP_TEMPORARY);
|
||||||
if (exec2_list == NULL) {
|
if (exec2_list == NULL) {
|
||||||
|
@ -1957,7 +1957,7 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
DRM_DEBUG("copy %d exec entries failed %d\n",
|
DRM_DEBUG("copy %d exec entries failed %d\n",
|
||||||
args->buffer_count, ret);
|
args->buffer_count, ret);
|
||||||
drm_free_large(exec2_list);
|
kvfree(exec2_list);
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1984,6 +1984,6 @@ i915_gem_execbuffer2(struct drm_device *dev, void *data,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_free_large(exec2_list);
|
kvfree(exec2_list);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3102,7 +3102,7 @@ intel_rotate_pages(struct intel_rotation_info *rot_info,
|
||||||
int ret = -ENOMEM;
|
int ret = -ENOMEM;
|
||||||
|
|
||||||
/* Allocate a temporary list of source pages for random access. */
|
/* Allocate a temporary list of source pages for random access. */
|
||||||
page_addr_list = drm_malloc_gfp(n_pages,
|
page_addr_list = kvmalloc_array(n_pages,
|
||||||
sizeof(dma_addr_t),
|
sizeof(dma_addr_t),
|
||||||
GFP_TEMPORARY);
|
GFP_TEMPORARY);
|
||||||
if (!page_addr_list)
|
if (!page_addr_list)
|
||||||
|
@ -3135,14 +3135,14 @@ intel_rotate_pages(struct intel_rotation_info *rot_info,
|
||||||
DRM_DEBUG_KMS("Created rotated page mapping for object size %zu (%ux%u tiles, %u pages)\n",
|
DRM_DEBUG_KMS("Created rotated page mapping for object size %zu (%ux%u tiles, %u pages)\n",
|
||||||
obj->base.size, rot_info->plane[0].width, rot_info->plane[0].height, size);
|
obj->base.size, rot_info->plane[0].width, rot_info->plane[0].height, size);
|
||||||
|
|
||||||
drm_free_large(page_addr_list);
|
kvfree(page_addr_list);
|
||||||
|
|
||||||
return st;
|
return st;
|
||||||
|
|
||||||
err_sg_alloc:
|
err_sg_alloc:
|
||||||
kfree(st);
|
kfree(st);
|
||||||
err_st_alloc:
|
err_st_alloc:
|
||||||
drm_free_large(page_addr_list);
|
kvfree(page_addr_list);
|
||||||
|
|
||||||
DRM_DEBUG_KMS("Failed to create rotated mapping for object size %zu! (%ux%u tiles, %u pages)\n",
|
DRM_DEBUG_KMS("Failed to create rotated mapping for object size %zu! (%ux%u tiles, %u pages)\n",
|
||||||
obj->base.size, rot_info->plane[0].width, rot_info->plane[0].height, size);
|
obj->base.size, rot_info->plane[0].width, rot_info->plane[0].height, size);
|
||||||
|
|
|
@ -507,7 +507,7 @@ __i915_gem_userptr_get_pages_worker(struct work_struct *_work)
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
pinned = 0;
|
pinned = 0;
|
||||||
|
|
||||||
pvec = drm_malloc_gfp(npages, sizeof(struct page *), GFP_TEMPORARY);
|
pvec = kvmalloc_array(npages, sizeof(struct page *), GFP_TEMPORARY);
|
||||||
if (pvec != NULL) {
|
if (pvec != NULL) {
|
||||||
struct mm_struct *mm = obj->userptr.mm->mm;
|
struct mm_struct *mm = obj->userptr.mm->mm;
|
||||||
unsigned int flags = 0;
|
unsigned int flags = 0;
|
||||||
|
@ -555,7 +555,7 @@ __i915_gem_userptr_get_pages_worker(struct work_struct *_work)
|
||||||
mutex_unlock(&obj->mm.lock);
|
mutex_unlock(&obj->mm.lock);
|
||||||
|
|
||||||
release_pages(pvec, pinned, 0);
|
release_pages(pvec, pinned, 0);
|
||||||
drm_free_large(pvec);
|
kvfree(pvec);
|
||||||
|
|
||||||
i915_gem_object_put(obj);
|
i915_gem_object_put(obj);
|
||||||
put_task_struct(work->task);
|
put_task_struct(work->task);
|
||||||
|
@ -642,7 +642,7 @@ i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj)
|
||||||
pinned = 0;
|
pinned = 0;
|
||||||
|
|
||||||
if (mm == current->mm) {
|
if (mm == current->mm) {
|
||||||
pvec = drm_malloc_gfp(num_pages, sizeof(struct page *),
|
pvec = kvmalloc_array(num_pages, sizeof(struct page *),
|
||||||
GFP_TEMPORARY |
|
GFP_TEMPORARY |
|
||||||
__GFP_NORETRY |
|
__GFP_NORETRY |
|
||||||
__GFP_NOWARN);
|
__GFP_NOWARN);
|
||||||
|
@ -669,7 +669,7 @@ i915_gem_userptr_get_pages(struct drm_i915_gem_object *obj)
|
||||||
|
|
||||||
if (IS_ERR(pages))
|
if (IS_ERR(pages))
|
||||||
release_pages(pvec, pinned, 0);
|
release_pages(pvec, pinned, 0);
|
||||||
drm_free_large(pvec);
|
kvfree(pvec);
|
||||||
|
|
||||||
return pages;
|
return pages;
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ intel_create_plane_state(struct drm_plane *plane)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
state->base.plane = plane;
|
state->base.plane = plane;
|
||||||
state->base.rotation = DRM_ROTATE_0;
|
state->base.rotation = DRM_MODE_ROTATE_0;
|
||||||
state->ckey.flags = I915_SET_COLORKEY_NONE;
|
state->ckey.flags = I915_SET_COLORKEY_NONE;
|
||||||
|
|
||||||
return state;
|
return state;
|
||||||
|
@ -178,8 +178,8 @@ int intel_plane_atomic_check_with_state(struct intel_crtc_state *crtc_state,
|
||||||
|
|
||||||
/* CHV ignores the mirror bit when the rotate bit is set :( */
|
/* CHV ignores the mirror bit when the rotate bit is set :( */
|
||||||
if (IS_CHERRYVIEW(dev_priv) &&
|
if (IS_CHERRYVIEW(dev_priv) &&
|
||||||
state->rotation & DRM_ROTATE_180 &&
|
state->rotation & DRM_MODE_ROTATE_180 &&
|
||||||
state->rotation & DRM_REFLECT_X) {
|
state->rotation & DRM_MODE_REFLECT_X) {
|
||||||
DRM_DEBUG_KMS("Cannot rotate and reflect at the same time\n");
|
DRM_DEBUG_KMS("Cannot rotate and reflect at the same time\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2468,7 +2468,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,
|
||||||
|
|
||||||
offset = _intel_compute_tile_offset(dev_priv, &x, &y,
|
offset = _intel_compute_tile_offset(dev_priv, &x, &y,
|
||||||
fb, i, fb->pitches[i],
|
fb, i, fb->pitches[i],
|
||||||
DRM_ROTATE_0, tile_size);
|
DRM_MODE_ROTATE_0, tile_size);
|
||||||
offset /= tile_size;
|
offset /= tile_size;
|
||||||
|
|
||||||
if (fb->modifier != DRM_FORMAT_MOD_LINEAR) {
|
if (fb->modifier != DRM_FORMAT_MOD_LINEAR) {
|
||||||
|
@ -2503,7 +2503,7 @@ intel_fill_fb_info(struct drm_i915_private *dev_priv,
|
||||||
drm_rect_rotate(&r,
|
drm_rect_rotate(&r,
|
||||||
rot_info->plane[i].width * tile_width,
|
rot_info->plane[i].width * tile_width,
|
||||||
rot_info->plane[i].height * tile_height,
|
rot_info->plane[i].height * tile_height,
|
||||||
DRM_ROTATE_270);
|
DRM_MODE_ROTATE_270);
|
||||||
x = r.x1;
|
x = r.x1;
|
||||||
y = r.y1;
|
y = r.y1;
|
||||||
|
|
||||||
|
@ -2939,7 +2939,7 @@ int skl_check_plane_surface(struct intel_plane_state *plane_state)
|
||||||
if (drm_rotation_90_or_270(rotation))
|
if (drm_rotation_90_or_270(rotation))
|
||||||
drm_rect_rotate(&plane_state->base.src,
|
drm_rect_rotate(&plane_state->base.src,
|
||||||
fb->width << 16, fb->height << 16,
|
fb->width << 16, fb->height << 16,
|
||||||
DRM_ROTATE_270);
|
DRM_MODE_ROTATE_270);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle the AUX surface first since
|
* Handle the AUX surface first since
|
||||||
|
@ -3017,10 +3017,10 @@ static u32 i9xx_plane_ctl(const struct intel_crtc_state *crtc_state,
|
||||||
fb->modifier == I915_FORMAT_MOD_X_TILED)
|
fb->modifier == I915_FORMAT_MOD_X_TILED)
|
||||||
dspcntr |= DISPPLANE_TILED;
|
dspcntr |= DISPPLANE_TILED;
|
||||||
|
|
||||||
if (rotation & DRM_ROTATE_180)
|
if (rotation & DRM_MODE_ROTATE_180)
|
||||||
dspcntr |= DISPPLANE_ROTATE_180;
|
dspcntr |= DISPPLANE_ROTATE_180;
|
||||||
|
|
||||||
if (rotation & DRM_REFLECT_X)
|
if (rotation & DRM_MODE_REFLECT_X)
|
||||||
dspcntr |= DISPPLANE_MIRROR;
|
dspcntr |= DISPPLANE_MIRROR;
|
||||||
|
|
||||||
return dspcntr;
|
return dspcntr;
|
||||||
|
@ -3048,10 +3048,10 @@ int i9xx_check_plane_surface(struct intel_plane_state *plane_state)
|
||||||
int src_w = drm_rect_width(&plane_state->base.src) >> 16;
|
int src_w = drm_rect_width(&plane_state->base.src) >> 16;
|
||||||
int src_h = drm_rect_height(&plane_state->base.src) >> 16;
|
int src_h = drm_rect_height(&plane_state->base.src) >> 16;
|
||||||
|
|
||||||
if (rotation & DRM_ROTATE_180) {
|
if (rotation & DRM_MODE_ROTATE_180) {
|
||||||
src_x += src_w - 1;
|
src_x += src_w - 1;
|
||||||
src_y += src_h - 1;
|
src_y += src_h - 1;
|
||||||
} else if (rotation & DRM_REFLECT_X) {
|
} else if (rotation & DRM_MODE_REFLECT_X) {
|
||||||
src_x += src_w - 1;
|
src_x += src_w - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3271,17 +3271,17 @@ static u32 skl_plane_ctl_tiling(uint64_t fb_modifier)
|
||||||
static u32 skl_plane_ctl_rotation(unsigned int rotation)
|
static u32 skl_plane_ctl_rotation(unsigned int rotation)
|
||||||
{
|
{
|
||||||
switch (rotation) {
|
switch (rotation) {
|
||||||
case DRM_ROTATE_0:
|
case DRM_MODE_ROTATE_0:
|
||||||
break;
|
break;
|
||||||
/*
|
/*
|
||||||
* DRM_ROTATE_ is counter clockwise to stay compatible with Xrandr
|
* DRM_MODE_ROTATE_ is counter clockwise to stay compatible with Xrandr
|
||||||
* while i915 HW rotation is clockwise, thats why this swapping.
|
* while i915 HW rotation is clockwise, thats why this swapping.
|
||||||
*/
|
*/
|
||||||
case DRM_ROTATE_90:
|
case DRM_MODE_ROTATE_90:
|
||||||
return PLANE_CTL_ROTATE_270;
|
return PLANE_CTL_ROTATE_270;
|
||||||
case DRM_ROTATE_180:
|
case DRM_MODE_ROTATE_180:
|
||||||
return PLANE_CTL_ROTATE_180;
|
return PLANE_CTL_ROTATE_180;
|
||||||
case DRM_ROTATE_270:
|
case DRM_MODE_ROTATE_270:
|
||||||
return PLANE_CTL_ROTATE_90;
|
return PLANE_CTL_ROTATE_90;
|
||||||
default:
|
default:
|
||||||
MISSING_CASE(rotation);
|
MISSING_CASE(rotation);
|
||||||
|
@ -4671,7 +4671,7 @@ int skl_update_scaler_crtc(struct intel_crtc_state *state)
|
||||||
const struct drm_display_mode *adjusted_mode = &state->base.adjusted_mode;
|
const struct drm_display_mode *adjusted_mode = &state->base.adjusted_mode;
|
||||||
|
|
||||||
return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX,
|
return skl_update_scaler(state, !state->base.active, SKL_CRTC_INDEX,
|
||||||
&state->scaler_state.scaler_id, DRM_ROTATE_0,
|
&state->scaler_state.scaler_id, DRM_MODE_ROTATE_0,
|
||||||
state->pipe_src_w, state->pipe_src_h,
|
state->pipe_src_w, state->pipe_src_h,
|
||||||
adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay);
|
adjusted_mode->crtc_hdisplay, adjusted_mode->crtc_vdisplay);
|
||||||
}
|
}
|
||||||
|
@ -9239,7 +9239,7 @@ static u32 i9xx_cursor_ctl(const struct intel_crtc_state *crtc_state,
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plane_state->base.rotation & DRM_ROTATE_180)
|
if (plane_state->base.rotation & DRM_MODE_ROTATE_180)
|
||||||
cntl |= CURSOR_ROTATE_180;
|
cntl |= CURSOR_ROTATE_180;
|
||||||
|
|
||||||
return cntl;
|
return cntl;
|
||||||
|
@ -9300,7 +9300,7 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
|
||||||
|
|
||||||
/* ILK+ do this automagically */
|
/* ILK+ do this automagically */
|
||||||
if (HAS_GMCH_DISPLAY(dev_priv) &&
|
if (HAS_GMCH_DISPLAY(dev_priv) &&
|
||||||
plane_state->base.rotation & DRM_ROTATE_180) {
|
plane_state->base.rotation & DRM_MODE_ROTATE_180) {
|
||||||
base += (plane_state->base.crtc_h *
|
base += (plane_state->base.crtc_h *
|
||||||
plane_state->base.crtc_w - 1) * 4;
|
plane_state->base.crtc_w - 1) * 4;
|
||||||
}
|
}
|
||||||
|
@ -13607,22 +13607,22 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 9) {
|
if (INTEL_GEN(dev_priv) >= 9) {
|
||||||
supported_rotations =
|
supported_rotations =
|
||||||
DRM_ROTATE_0 | DRM_ROTATE_90 |
|
DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
|
||||||
DRM_ROTATE_180 | DRM_ROTATE_270;
|
DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
|
||||||
} else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
|
} else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
|
||||||
supported_rotations =
|
supported_rotations =
|
||||||
DRM_ROTATE_0 | DRM_ROTATE_180 |
|
DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 |
|
||||||
DRM_REFLECT_X;
|
DRM_MODE_REFLECT_X;
|
||||||
} else if (INTEL_GEN(dev_priv) >= 4) {
|
} else if (INTEL_GEN(dev_priv) >= 4) {
|
||||||
supported_rotations =
|
supported_rotations =
|
||||||
DRM_ROTATE_0 | DRM_ROTATE_180;
|
DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180;
|
||||||
} else {
|
} else {
|
||||||
supported_rotations = DRM_ROTATE_0;
|
supported_rotations = DRM_MODE_ROTATE_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 4)
|
if (INTEL_GEN(dev_priv) >= 4)
|
||||||
drm_plane_create_rotation_property(&primary->base,
|
drm_plane_create_rotation_property(&primary->base,
|
||||||
DRM_ROTATE_0,
|
DRM_MODE_ROTATE_0,
|
||||||
supported_rotations);
|
supported_rotations);
|
||||||
|
|
||||||
drm_plane_helper_add(&primary->base, &intel_plane_helper_funcs);
|
drm_plane_helper_add(&primary->base, &intel_plane_helper_funcs);
|
||||||
|
@ -13777,9 +13777,9 @@ intel_cursor_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe)
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 4)
|
if (INTEL_GEN(dev_priv) >= 4)
|
||||||
drm_plane_create_rotation_property(&cursor->base,
|
drm_plane_create_rotation_property(&cursor->base,
|
||||||
DRM_ROTATE_0,
|
DRM_MODE_ROTATE_0,
|
||||||
DRM_ROTATE_0 |
|
DRM_MODE_ROTATE_0 |
|
||||||
DRM_ROTATE_180);
|
DRM_MODE_ROTATE_180);
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 9)
|
if (INTEL_GEN(dev_priv) >= 9)
|
||||||
state->scaler_id = -1;
|
state->scaler_id = -1;
|
||||||
|
|
|
@ -801,7 +801,7 @@ static bool intel_fbc_can_activate(struct intel_crtc *crtc)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (INTEL_GEN(dev_priv) <= 4 && !IS_G4X(dev_priv) &&
|
if (INTEL_GEN(dev_priv) <= 4 && !IS_G4X(dev_priv) &&
|
||||||
cache->plane.rotation != DRM_ROTATE_0) {
|
cache->plane.rotation != DRM_MODE_ROTATE_0) {
|
||||||
fbc->no_fbc_reason = "rotation unsupported";
|
fbc->no_fbc_reason = "rotation unsupported";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,7 @@ static int intelfb_create(struct drm_fb_helper *helper,
|
||||||
* This also validates that any existing fb inherited from the
|
* This also validates that any existing fb inherited from the
|
||||||
* BIOS is suitable for own access.
|
* BIOS is suitable for own access.
|
||||||
*/
|
*/
|
||||||
vma = intel_pin_and_fence_fb_obj(&ifbdev->fb->base, DRM_ROTATE_0);
|
vma = intel_pin_and_fence_fb_obj(&ifbdev->fb->base, DRM_MODE_ROTATE_0);
|
||||||
if (IS_ERR(vma)) {
|
if (IS_ERR(vma)) {
|
||||||
ret = PTR_ERR(vma);
|
ret = PTR_ERR(vma);
|
||||||
goto out_unlock;
|
goto out_unlock;
|
||||||
|
|
|
@ -398,10 +398,10 @@ static u32 vlv_sprite_ctl(const struct intel_crtc_state *crtc_state,
|
||||||
if (fb->modifier == I915_FORMAT_MOD_X_TILED)
|
if (fb->modifier == I915_FORMAT_MOD_X_TILED)
|
||||||
sprctl |= SP_TILED;
|
sprctl |= SP_TILED;
|
||||||
|
|
||||||
if (rotation & DRM_ROTATE_180)
|
if (rotation & DRM_MODE_ROTATE_180)
|
||||||
sprctl |= SP_ROTATE_180;
|
sprctl |= SP_ROTATE_180;
|
||||||
|
|
||||||
if (rotation & DRM_REFLECT_X)
|
if (rotation & DRM_MODE_REFLECT_X)
|
||||||
sprctl |= SP_MIRROR;
|
sprctl |= SP_MIRROR;
|
||||||
|
|
||||||
if (key->flags & I915_SET_COLORKEY_SOURCE)
|
if (key->flags & I915_SET_COLORKEY_SOURCE)
|
||||||
|
@ -533,7 +533,7 @@ static u32 ivb_sprite_ctl(const struct intel_crtc_state *crtc_state,
|
||||||
if (fb->modifier == I915_FORMAT_MOD_X_TILED)
|
if (fb->modifier == I915_FORMAT_MOD_X_TILED)
|
||||||
sprctl |= SPRITE_TILED;
|
sprctl |= SPRITE_TILED;
|
||||||
|
|
||||||
if (rotation & DRM_ROTATE_180)
|
if (rotation & DRM_MODE_ROTATE_180)
|
||||||
sprctl |= SPRITE_ROTATE_180;
|
sprctl |= SPRITE_ROTATE_180;
|
||||||
|
|
||||||
if (key->flags & I915_SET_COLORKEY_DESTINATION)
|
if (key->flags & I915_SET_COLORKEY_DESTINATION)
|
||||||
|
@ -674,7 +674,7 @@ static u32 ilk_sprite_ctl(const struct intel_crtc_state *crtc_state,
|
||||||
if (fb->modifier == I915_FORMAT_MOD_X_TILED)
|
if (fb->modifier == I915_FORMAT_MOD_X_TILED)
|
||||||
dvscntr |= DVS_TILED;
|
dvscntr |= DVS_TILED;
|
||||||
|
|
||||||
if (rotation & DRM_ROTATE_180)
|
if (rotation & DRM_MODE_ROTATE_180)
|
||||||
dvscntr |= DVS_ROTATE_180;
|
dvscntr |= DVS_ROTATE_180;
|
||||||
|
|
||||||
if (key->flags & I915_SET_COLORKEY_DESTINATION)
|
if (key->flags & I915_SET_COLORKEY_DESTINATION)
|
||||||
|
@ -1145,15 +1145,15 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
|
||||||
|
|
||||||
if (INTEL_GEN(dev_priv) >= 9) {
|
if (INTEL_GEN(dev_priv) >= 9) {
|
||||||
supported_rotations =
|
supported_rotations =
|
||||||
DRM_ROTATE_0 | DRM_ROTATE_90 |
|
DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_90 |
|
||||||
DRM_ROTATE_180 | DRM_ROTATE_270;
|
DRM_MODE_ROTATE_180 | DRM_MODE_ROTATE_270;
|
||||||
} else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
|
} else if (IS_CHERRYVIEW(dev_priv) && pipe == PIPE_B) {
|
||||||
supported_rotations =
|
supported_rotations =
|
||||||
DRM_ROTATE_0 | DRM_ROTATE_180 |
|
DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180 |
|
||||||
DRM_REFLECT_X;
|
DRM_MODE_REFLECT_X;
|
||||||
} else {
|
} else {
|
||||||
supported_rotations =
|
supported_rotations =
|
||||||
DRM_ROTATE_0 | DRM_ROTATE_180;
|
DRM_MODE_ROTATE_0 | DRM_MODE_ROTATE_180;
|
||||||
}
|
}
|
||||||
|
|
||||||
intel_plane->pipe = pipe;
|
intel_plane->pipe = pipe;
|
||||||
|
@ -1180,7 +1180,7 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv,
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
drm_plane_create_rotation_property(&intel_plane->base,
|
drm_plane_create_rotation_property(&intel_plane->base,
|
||||||
DRM_ROTATE_0,
|
DRM_MODE_ROTATE_0,
|
||||||
supported_rotations);
|
supported_rotations);
|
||||||
|
|
||||||
drm_plane_helper_add(&intel_plane->base, &intel_plane_helper_funcs);
|
drm_plane_helper_add(&intel_plane->base, &intel_plane_helper_funcs);
|
||||||
|
|
|
@ -117,7 +117,7 @@ static int igt_random_insert_remove(void *arg)
|
||||||
|
|
||||||
mock_engine_reset(engine);
|
mock_engine_reset(engine);
|
||||||
|
|
||||||
waiters = drm_malloc_gfp(count, sizeof(*waiters), GFP_TEMPORARY);
|
waiters = kvmalloc_array(count, sizeof(*waiters), GFP_TEMPORARY);
|
||||||
if (!waiters)
|
if (!waiters)
|
||||||
goto out_engines;
|
goto out_engines;
|
||||||
|
|
||||||
|
@ -169,7 +169,7 @@ out_order:
|
||||||
out_bitmap:
|
out_bitmap:
|
||||||
kfree(bitmap);
|
kfree(bitmap);
|
||||||
out_waiters:
|
out_waiters:
|
||||||
drm_free_large(waiters);
|
kvfree(waiters);
|
||||||
out_engines:
|
out_engines:
|
||||||
mock_engine_flush(engine);
|
mock_engine_flush(engine);
|
||||||
return err;
|
return err;
|
||||||
|
@ -187,7 +187,7 @@ static int igt_insert_complete(void *arg)
|
||||||
|
|
||||||
mock_engine_reset(engine);
|
mock_engine_reset(engine);
|
||||||
|
|
||||||
waiters = drm_malloc_gfp(count, sizeof(*waiters), GFP_TEMPORARY);
|
waiters = kvmalloc_array(count, sizeof(*waiters), GFP_TEMPORARY);
|
||||||
if (!waiters)
|
if (!waiters)
|
||||||
goto out_engines;
|
goto out_engines;
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ static int igt_insert_complete(void *arg)
|
||||||
out_bitmap:
|
out_bitmap:
|
||||||
kfree(bitmap);
|
kfree(bitmap);
|
||||||
out_waiters:
|
out_waiters:
|
||||||
drm_free_large(waiters);
|
kvfree(waiters);
|
||||||
out_engines:
|
out_engines:
|
||||||
mock_engine_flush(engine);
|
mock_engine_flush(engine);
|
||||||
return err;
|
return err;
|
||||||
|
@ -368,7 +368,7 @@ static int igt_wakeup(void *arg)
|
||||||
|
|
||||||
mock_engine_reset(engine);
|
mock_engine_reset(engine);
|
||||||
|
|
||||||
waiters = drm_malloc_gfp(count, sizeof(*waiters), GFP_TEMPORARY);
|
waiters = kvmalloc_array(count, sizeof(*waiters), GFP_TEMPORARY);
|
||||||
if (!waiters)
|
if (!waiters)
|
||||||
goto out_engines;
|
goto out_engines;
|
||||||
|
|
||||||
|
@ -454,7 +454,7 @@ out_waiters:
|
||||||
put_task_struct(waiters[n].tsk);
|
put_task_struct(waiters[n].tsk);
|
||||||
}
|
}
|
||||||
|
|
||||||
drm_free_large(waiters);
|
kvfree(waiters);
|
||||||
out_engines:
|
out_engines:
|
||||||
mock_engine_flush(engine);
|
mock_engine_flush(engine);
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -273,7 +273,7 @@ void ipu_plane_state_reset(struct drm_plane *plane)
|
||||||
|
|
||||||
if (ipu_state) {
|
if (ipu_state) {
|
||||||
ipu_state->base.plane = plane;
|
ipu_state->base.plane = plane;
|
||||||
ipu_state->base.rotation = DRM_ROTATE_0;
|
ipu_state->base.rotation = DRM_MODE_ROTATE_0;
|
||||||
}
|
}
|
||||||
|
|
||||||
plane->state = &ipu_state->base;
|
plane->state = &ipu_state->base;
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
# Makefile for the drm device driver. This driver provides support for the
|
# Makefile for the drm device driver. This driver provides support for the
|
||||||
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
|
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.
|
||||||
|
|
||||||
ccflags-y := -Iinclude/drm
|
|
||||||
mga-y := mga_drv.o mga_dma.o mga_state.o mga_warp.o mga_irq.o
|
mga-y := mga_drv.o mga_dma.o mga_state.o mga_warp.o mga_irq.o
|
||||||
|
|
||||||
mga-$(CONFIG_COMPAT) += mga_ioc32.o
|
mga-$(CONFIG_COMPAT) += mga_ioc32.o
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
ccflags-y := -Iinclude/drm
|
|
||||||
mgag200-y := mgag200_main.o mgag200_mode.o mgag200_cursor.o \
|
mgag200-y := mgag200_main.o mgag200_mode.o mgag200_cursor.o \
|
||||||
mgag200_drv.o mgag200_fb.o mgag200_i2c.o mgag200_ttm.o
|
mgag200_drv.o mgag200_fb.o mgag200_i2c.o mgag200_ttm.o
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,9 @@
|
||||||
* Authors: Dave Airlie <airlied@redhat.com>
|
* Authors: Dave Airlie <airlied@redhat.com>
|
||||||
*/
|
*/
|
||||||
#include <drm/drmP.h>
|
#include <drm/drmP.h>
|
||||||
|
#include <drm/ttm/ttm_page_alloc.h>
|
||||||
|
|
||||||
#include "mgag200_drv.h"
|
#include "mgag200_drv.h"
|
||||||
#include <ttm/ttm_page_alloc.h>
|
|
||||||
|
|
||||||
static inline struct mga_device *
|
static inline struct mga_device *
|
||||||
mgag200_bdev(struct ttm_bo_device *bd)
|
mgag200_bdev(struct ttm_bo_device *bd)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
ccflags-y := -Iinclude/drm -Idrivers/gpu/drm/msm
|
ccflags-y := -Idrivers/gpu/drm/msm
|
||||||
ccflags-$(CONFIG_DRM_MSM_DSI) += -Idrivers/gpu/drm/msm/dsi
|
ccflags-$(CONFIG_DRM_MSM_DSI) += -Idrivers/gpu/drm/msm/dsi
|
||||||
|
|
||||||
msm-y := \
|
msm-y := \
|
||||||
|
|
|
@ -17,9 +17,9 @@
|
||||||
#include <linux/of_platform.h>
|
#include <linux/of_platform.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
|
||||||
#include "drm_crtc.h"
|
#include <drm/drm_crtc.h>
|
||||||
#include "drm_mipi_dsi.h"
|
#include <drm/drm_mipi_dsi.h>
|
||||||
#include "drm_panel.h"
|
#include <drm/drm_panel.h>
|
||||||
|
|
||||||
#include "msm_drv.h"
|
#include "msm_drv.h"
|
||||||
|
|
||||||
|
|
|
@ -18,9 +18,9 @@
|
||||||
#include <linux/interrupt.h>
|
#include <linux/interrupt.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
|
#include <drm/drm_crtc.h>
|
||||||
|
#include <drm/drm_dp_helper.h>
|
||||||
|
|
||||||
#include "drm_crtc.h"
|
|
||||||
#include "drm_dp_helper.h"
|
|
||||||
#include "msm_drv.h"
|
#include "msm_drv.h"
|
||||||
|
|
||||||
#define edp_read(offset) msm_readl((offset))
|
#define edp_read(offset) msm_readl((offset))
|
||||||
|
|
|
@ -14,10 +14,10 @@
|
||||||
#include <linux/clk.h>
|
#include <linux/clk.h>
|
||||||
#include <linux/gpio/consumer.h>
|
#include <linux/gpio/consumer.h>
|
||||||
#include <linux/regulator/consumer.h>
|
#include <linux/regulator/consumer.h>
|
||||||
|
#include <drm/drm_crtc.h>
|
||||||
|
#include <drm/drm_dp_helper.h>
|
||||||
|
#include <drm/drm_edid.h>
|
||||||
|
|
||||||
#include "drm_crtc.h"
|
|
||||||
#include "drm_dp_helper.h"
|
|
||||||
#include "drm_edid.h"
|
|
||||||
#include "edp.h"
|
#include "edp.h"
|
||||||
#include "edp.xml.h"
|
#include "edp.xml.h"
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,12 @@
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mdp4_kms.h"
|
#include <drm/drm_crtc.h>
|
||||||
|
#include <drm/drm_crtc_helper.h>
|
||||||
|
#include <drm/drm_flip_work.h>
|
||||||
#include <drm/drm_mode.h>
|
#include <drm/drm_mode.h>
|
||||||
#include "drm_crtc.h"
|
|
||||||
#include "drm_crtc_helper.h"
|
#include "mdp4_kms.h"
|
||||||
#include "drm_flip_work.h"
|
|
||||||
|
|
||||||
struct mdp4_crtc {
|
struct mdp4_crtc {
|
||||||
struct drm_crtc base;
|
struct drm_crtc base;
|
||||||
|
|
|
@ -17,10 +17,10 @@
|
||||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "mdp4_kms.h"
|
#include <drm/drm_crtc.h>
|
||||||
|
#include <drm/drm_crtc_helper.h>
|
||||||
|
|
||||||
#include "drm_crtc.h"
|
#include "mdp4_kms.h"
|
||||||
#include "drm_crtc_helper.h"
|
|
||||||
|
|
||||||
struct mdp4_dsi_encoder {
|
struct mdp4_dsi_encoder {
|
||||||
struct drm_encoder base;
|
struct drm_encoder base;
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue