mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-18 18:23:53 +08:00
Merge branch 'drm-next' of git://people.freedesktop.org/~airlied/linux
Pull drm fixes from Dave Airlie: "Fix for radeon nomodeset regression, old radeon interface cliprects fix, 2 qxl crasher fixes, and a couple of minor cleanups. I may have a new AMD hw support branch next week, its one of those doesn't affect anything existing just adds new support, I'll see how it shapes up and I might ask you to take it, just thought I'd warn in advance." * 'drm-next' of git://people.freedesktop.org/~airlied/linux: drm/radeon: restore nomodeset operation (v2) qxl: fix bug with object eviction and update area drm/qxl: drop active_user_framebuffer as its unneeded qxl: drop unused variable. drm/qxl: fix ioport interactions for kernel submitted commands. drm: remove unused wrapper macros drm/radeon: check incoming cliprects pointer
This commit is contained in:
commit
ec50f2a97a
@ -277,7 +277,7 @@ out_unref:
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int wait_for_io_cmd_user(struct qxl_device *qdev, uint8_t val, long port)
|
static int wait_for_io_cmd_user(struct qxl_device *qdev, uint8_t val, long port, bool intr)
|
||||||
{
|
{
|
||||||
int irq_num;
|
int irq_num;
|
||||||
long addr = qdev->io_base + port;
|
long addr = qdev->io_base + port;
|
||||||
@ -285,20 +285,29 @@ static int wait_for_io_cmd_user(struct qxl_device *qdev, uint8_t val, long port)
|
|||||||
|
|
||||||
mutex_lock(&qdev->async_io_mutex);
|
mutex_lock(&qdev->async_io_mutex);
|
||||||
irq_num = atomic_read(&qdev->irq_received_io_cmd);
|
irq_num = atomic_read(&qdev->irq_received_io_cmd);
|
||||||
|
|
||||||
|
|
||||||
if (qdev->last_sent_io_cmd > irq_num) {
|
if (qdev->last_sent_io_cmd > irq_num) {
|
||||||
ret = wait_event_interruptible(qdev->io_cmd_event,
|
if (intr)
|
||||||
atomic_read(&qdev->irq_received_io_cmd) > irq_num);
|
ret = wait_event_interruptible_timeout(qdev->io_cmd_event,
|
||||||
if (ret)
|
atomic_read(&qdev->irq_received_io_cmd) > irq_num, 5*HZ);
|
||||||
|
else
|
||||||
|
ret = wait_event_timeout(qdev->io_cmd_event,
|
||||||
|
atomic_read(&qdev->irq_received_io_cmd) > irq_num, 5*HZ);
|
||||||
|
/* 0 is timeout, just bail the "hw" has gone away */
|
||||||
|
if (ret <= 0)
|
||||||
goto out;
|
goto out;
|
||||||
irq_num = atomic_read(&qdev->irq_received_io_cmd);
|
irq_num = atomic_read(&qdev->irq_received_io_cmd);
|
||||||
}
|
}
|
||||||
outb(val, addr);
|
outb(val, addr);
|
||||||
qdev->last_sent_io_cmd = irq_num + 1;
|
qdev->last_sent_io_cmd = irq_num + 1;
|
||||||
ret = wait_event_interruptible(qdev->io_cmd_event,
|
if (intr)
|
||||||
atomic_read(&qdev->irq_received_io_cmd) > irq_num);
|
ret = wait_event_interruptible_timeout(qdev->io_cmd_event,
|
||||||
|
atomic_read(&qdev->irq_received_io_cmd) > irq_num, 5*HZ);
|
||||||
|
else
|
||||||
|
ret = wait_event_timeout(qdev->io_cmd_event,
|
||||||
|
atomic_read(&qdev->irq_received_io_cmd) > irq_num, 5*HZ);
|
||||||
out:
|
out:
|
||||||
|
if (ret > 0)
|
||||||
|
ret = 0;
|
||||||
mutex_unlock(&qdev->async_io_mutex);
|
mutex_unlock(&qdev->async_io_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -308,7 +317,7 @@ static void wait_for_io_cmd(struct qxl_device *qdev, uint8_t val, long port)
|
|||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
restart:
|
restart:
|
||||||
ret = wait_for_io_cmd_user(qdev, val, port);
|
ret = wait_for_io_cmd_user(qdev, val, port, false);
|
||||||
if (ret == -ERESTARTSYS)
|
if (ret == -ERESTARTSYS)
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
@ -340,7 +349,7 @@ int qxl_io_update_area(struct qxl_device *qdev, struct qxl_bo *surf,
|
|||||||
mutex_lock(&qdev->update_area_mutex);
|
mutex_lock(&qdev->update_area_mutex);
|
||||||
qdev->ram_header->update_area = *area;
|
qdev->ram_header->update_area = *area;
|
||||||
qdev->ram_header->update_surface = surface_id;
|
qdev->ram_header->update_surface = surface_id;
|
||||||
ret = wait_for_io_cmd_user(qdev, 0, QXL_IO_UPDATE_AREA_ASYNC);
|
ret = wait_for_io_cmd_user(qdev, 0, QXL_IO_UPDATE_AREA_ASYNC, true);
|
||||||
mutex_unlock(&qdev->update_area_mutex);
|
mutex_unlock(&qdev->update_area_mutex);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -428,10 +428,10 @@ static int qxl_framebuffer_surface_dirty(struct drm_framebuffer *fb,
|
|||||||
int inc = 1;
|
int inc = 1;
|
||||||
|
|
||||||
qobj = gem_to_qxl_bo(qxl_fb->obj);
|
qobj = gem_to_qxl_bo(qxl_fb->obj);
|
||||||
if (qxl_fb != qdev->active_user_framebuffer) {
|
/* if we aren't primary surface ignore this */
|
||||||
DRM_INFO("%s: qxl_fb 0x%p != qdev->active_user_framebuffer 0x%p\n",
|
if (!qobj->is_primary)
|
||||||
__func__, qxl_fb, qdev->active_user_framebuffer);
|
return 0;
|
||||||
}
|
|
||||||
if (!num_clips) {
|
if (!num_clips) {
|
||||||
num_clips = 1;
|
num_clips = 1;
|
||||||
clips = &norect;
|
clips = &norect;
|
||||||
@ -604,7 +604,6 @@ static int qxl_crtc_mode_set(struct drm_crtc *crtc,
|
|||||||
mode->hdisplay,
|
mode->hdisplay,
|
||||||
mode->vdisplay);
|
mode->vdisplay);
|
||||||
}
|
}
|
||||||
qdev->mode_set = true;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -893,7 +892,6 @@ qxl_user_framebuffer_create(struct drm_device *dev,
|
|||||||
{
|
{
|
||||||
struct drm_gem_object *obj;
|
struct drm_gem_object *obj;
|
||||||
struct qxl_framebuffer *qxl_fb;
|
struct qxl_framebuffer *qxl_fb;
|
||||||
struct qxl_device *qdev = dev->dev_private;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
|
obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]);
|
||||||
@ -909,13 +907,6 @@ qxl_user_framebuffer_create(struct drm_device *dev,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qdev->active_user_framebuffer) {
|
|
||||||
DRM_INFO("%s: active_user_framebuffer %p -> %p\n",
|
|
||||||
__func__,
|
|
||||||
qdev->active_user_framebuffer, qxl_fb);
|
|
||||||
}
|
|
||||||
qdev->active_user_framebuffer = qxl_fb;
|
|
||||||
|
|
||||||
return &qxl_fb->base;
|
return &qxl_fb->base;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,12 +255,6 @@ struct qxl_device {
|
|||||||
struct qxl_gem gem;
|
struct qxl_gem gem;
|
||||||
struct qxl_mode_info mode_info;
|
struct qxl_mode_info mode_info;
|
||||||
|
|
||||||
/*
|
|
||||||
* last created framebuffer with fb_create
|
|
||||||
* only used by debugfs dumbppm
|
|
||||||
*/
|
|
||||||
struct qxl_framebuffer *active_user_framebuffer;
|
|
||||||
|
|
||||||
struct fb_info *fbdev_info;
|
struct fb_info *fbdev_info;
|
||||||
struct qxl_framebuffer *fbdev_qfb;
|
struct qxl_framebuffer *fbdev_qfb;
|
||||||
void *ram_physical;
|
void *ram_physical;
|
||||||
@ -270,7 +264,6 @@ struct qxl_device {
|
|||||||
struct qxl_ring *cursor_ring;
|
struct qxl_ring *cursor_ring;
|
||||||
|
|
||||||
struct qxl_ram_header *ram_header;
|
struct qxl_ram_header *ram_header;
|
||||||
bool mode_set;
|
|
||||||
|
|
||||||
bool primary_created;
|
bool primary_created;
|
||||||
|
|
||||||
|
@ -294,6 +294,7 @@ static int qxl_update_area_ioctl(struct drm_device *dev, void *data,
|
|||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
if (!qobj->pin_count) {
|
if (!qobj->pin_count) {
|
||||||
|
qxl_ttm_placement_from_domain(qobj, qobj->type);
|
||||||
ret = ttm_bo_validate(&qobj->tbo, &qobj->placement,
|
ret = ttm_bo_validate(&qobj->tbo, &qobj->placement,
|
||||||
true, false);
|
true, false);
|
||||||
if (unlikely(ret))
|
if (unlikely(ret))
|
||||||
|
@ -75,7 +75,7 @@ static int r300_emit_cliprects(drm_radeon_private_t *dev_priv,
|
|||||||
OUT_RING(CP_PACKET0(R300_RE_CLIPRECT_TL_0, nr * 2 - 1));
|
OUT_RING(CP_PACKET0(R300_RE_CLIPRECT_TL_0, nr * 2 - 1));
|
||||||
|
|
||||||
for (i = 0; i < nr; ++i) {
|
for (i = 0; i < nr; ++i) {
|
||||||
if (DRM_COPY_FROM_USER_UNCHECKED
|
if (DRM_COPY_FROM_USER
|
||||||
(&box, &cmdbuf->boxes[n + i], sizeof(box))) {
|
(&box, &cmdbuf->boxes[n + i], sizeof(box))) {
|
||||||
DRM_ERROR("copy cliprect faulted\n");
|
DRM_ERROR("copy cliprect faulted\n");
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
@ -147,7 +147,7 @@ static inline void radeon_unregister_atpx_handler(void) {}
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
int radeon_no_wb;
|
int radeon_no_wb;
|
||||||
int radeon_modeset = 1;
|
int radeon_modeset = -1;
|
||||||
int radeon_dynclks = -1;
|
int radeon_dynclks = -1;
|
||||||
int radeon_r4xx_atom = 0;
|
int radeon_r4xx_atom = 0;
|
||||||
int radeon_agpmode = 0;
|
int radeon_agpmode = 0;
|
||||||
@ -456,6 +456,16 @@ static struct pci_driver radeon_kms_pci_driver = {
|
|||||||
|
|
||||||
static int __init radeon_init(void)
|
static int __init radeon_init(void)
|
||||||
{
|
{
|
||||||
|
#ifdef CONFIG_VGA_CONSOLE
|
||||||
|
if (vgacon_text_force() && radeon_modeset == -1) {
|
||||||
|
DRM_INFO("VGACON disable radeon kernel modesetting.\n");
|
||||||
|
radeon_modeset = 0;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
/* set to modesetting by default if not nomodeset */
|
||||||
|
if (radeon_modeset == -1)
|
||||||
|
radeon_modeset = 1;
|
||||||
|
|
||||||
if (radeon_modeset == 1) {
|
if (radeon_modeset == 1) {
|
||||||
DRM_INFO("radeon kernel modesetting enabled.\n");
|
DRM_INFO("radeon kernel modesetting enabled.\n");
|
||||||
driver = &kms_driver;
|
driver = &kms_driver;
|
||||||
|
@ -87,15 +87,6 @@ static __inline__ int mtrr_del(int reg, unsigned long base, unsigned long size)
|
|||||||
/** Other copying of data from kernel space */
|
/** Other copying of data from kernel space */
|
||||||
#define DRM_COPY_TO_USER(arg1, arg2, arg3) \
|
#define DRM_COPY_TO_USER(arg1, arg2, arg3) \
|
||||||
copy_to_user(arg1, arg2, arg3)
|
copy_to_user(arg1, arg2, arg3)
|
||||||
/* Macros for copyfrom user, but checking readability only once */
|
|
||||||
#define DRM_VERIFYAREA_READ( uaddr, size ) \
|
|
||||||
(access_ok( VERIFY_READ, uaddr, size ) ? 0 : -EFAULT)
|
|
||||||
#define DRM_COPY_FROM_USER_UNCHECKED(arg1, arg2, arg3) \
|
|
||||||
__copy_from_user(arg1, arg2, arg3)
|
|
||||||
#define DRM_COPY_TO_USER_UNCHECKED(arg1, arg2, arg3) \
|
|
||||||
__copy_to_user(arg1, arg2, arg3)
|
|
||||||
#define DRM_GET_USER_UNCHECKED(val, uaddr) \
|
|
||||||
__get_user(val, uaddr)
|
|
||||||
|
|
||||||
#define DRM_HZ HZ
|
#define DRM_HZ HZ
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user