Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+36 -41
+19 -10
drivers/gpu/drm/qxl/qxl_cmd.c
··· 277 277 return 0; 278 278 } 279 279 280 - static int wait_for_io_cmd_user(struct qxl_device *qdev, uint8_t val, long port) 280 + static int wait_for_io_cmd_user(struct qxl_device *qdev, uint8_t val, long port, bool intr) 281 281 { 282 282 int irq_num; 283 283 long addr = qdev->io_base + port; ··· 285 285 286 286 mutex_lock(&qdev->async_io_mutex); 287 287 irq_num = atomic_read(&qdev->irq_received_io_cmd); 288 - 289 - 290 288 if (qdev->last_sent_io_cmd > irq_num) { 291 - ret = wait_event_interruptible(qdev->io_cmd_event, 292 - atomic_read(&qdev->irq_received_io_cmd) > irq_num); 293 - if (ret) 289 + if (intr) 290 + ret = wait_event_interruptible_timeout(qdev->io_cmd_event, 291 + atomic_read(&qdev->irq_received_io_cmd) > irq_num, 5*HZ); 292 + else 293 + ret = wait_event_timeout(qdev->io_cmd_event, 294 + atomic_read(&qdev->irq_received_io_cmd) > irq_num, 5*HZ); 295 + /* 0 is timeout, just bail the "hw" has gone away */ 296 + if (ret <= 0) 294 297 goto out; 295 298 irq_num = atomic_read(&qdev->irq_received_io_cmd); 296 299 } 297 300 outb(val, addr); 298 301 qdev->last_sent_io_cmd = irq_num + 1; 299 - ret = wait_event_interruptible(qdev->io_cmd_event, 300 - atomic_read(&qdev->irq_received_io_cmd) > irq_num); 302 + if (intr) 303 + ret = wait_event_interruptible_timeout(qdev->io_cmd_event, 304 + atomic_read(&qdev->irq_received_io_cmd) > irq_num, 5*HZ); 305 + else 306 + ret = wait_event_timeout(qdev->io_cmd_event, 307 + atomic_read(&qdev->irq_received_io_cmd) > irq_num, 5*HZ); 301 308 out: 309 + if (ret > 0) 310 + ret = 0; 302 311 mutex_unlock(&qdev->async_io_mutex); 303 312 return ret; 304 313 } ··· 317 308 int ret; 318 309 319 310 restart: 320 - ret = wait_for_io_cmd_user(qdev, val, port); 311 + ret = wait_for_io_cmd_user(qdev, val, port, false); 321 312 if (ret == -ERESTARTSYS) 322 313 goto restart; 323 314 } ··· 349 340 mutex_lock(&qdev->update_area_mutex); 350 341 qdev->ram_header->update_area = *area; 351 342 qdev->ram_header->update_surface = surface_id; 352 - ret = wait_for_io_cmd_user(qdev, 0, QXL_IO_UPDATE_AREA_ASYNC); 343 + ret = wait_for_io_cmd_user(qdev, 0, QXL_IO_UPDATE_AREA_ASYNC, true); 353 344 mutex_unlock(&qdev->update_area_mutex); 354 345 return ret; 355 346 }
+4 -13
drivers/gpu/drm/qxl/qxl_display.c
··· 428 428 int inc = 1; 429 429 430 430 qobj = gem_to_qxl_bo(qxl_fb->obj); 431 - if (qxl_fb != qdev->active_user_framebuffer) { 432 - DRM_INFO("%s: qxl_fb 0x%p != qdev->active_user_framebuffer 0x%p\n", 433 - __func__, qxl_fb, qdev->active_user_framebuffer); 434 - } 431 + /* if we aren't primary surface ignore this */ 432 + if (!qobj->is_primary) 433 + return 0; 434 + 435 435 if (!num_clips) { 436 436 num_clips = 1; 437 437 clips = &norect; ··· 604 604 mode->hdisplay, 605 605 mode->vdisplay); 606 606 } 607 - qdev->mode_set = true; 608 607 return 0; 609 608 } 610 609 ··· 892 893 { 893 894 struct drm_gem_object *obj; 894 895 struct qxl_framebuffer *qxl_fb; 895 - struct qxl_device *qdev = dev->dev_private; 896 896 int ret; 897 897 898 898 obj = drm_gem_object_lookup(dev, file_priv, mode_cmd->handles[0]); ··· 906 908 drm_gem_object_unreference_unlocked(obj); 907 909 return NULL; 908 910 } 909 - 910 - if (qdev->active_user_framebuffer) { 911 - DRM_INFO("%s: active_user_framebuffer %p -> %p\n", 912 - __func__, 913 - qdev->active_user_framebuffer, qxl_fb); 914 - } 915 - qdev->active_user_framebuffer = qxl_fb; 916 911 917 912 return &qxl_fb->base; 918 913 }
-7
drivers/gpu/drm/qxl/qxl_drv.h
··· 255 255 struct qxl_gem gem; 256 256 struct qxl_mode_info mode_info; 257 257 258 - /* 259 - * last created framebuffer with fb_create 260 - * only used by debugfs dumbppm 261 - */ 262 - struct qxl_framebuffer *active_user_framebuffer; 263 - 264 258 struct fb_info *fbdev_info; 265 259 struct qxl_framebuffer *fbdev_qfb; 266 260 void *ram_physical; ··· 264 270 struct qxl_ring *cursor_ring; 265 271 266 272 struct qxl_ram_header *ram_header; 267 - bool mode_set; 268 273 269 274 bool primary_created; 270 275
+1
drivers/gpu/drm/qxl/qxl_ioctl.c
··· 294 294 goto out; 295 295 296 296 if (!qobj->pin_count) { 297 + qxl_ttm_placement_from_domain(qobj, qobj->type); 297 298 ret = ttm_bo_validate(&qobj->tbo, &qobj->placement, 298 299 true, false); 299 300 if (unlikely(ret))
+1 -1
drivers/gpu/drm/radeon/r300_cmdbuf.c
··· 75 75 OUT_RING(CP_PACKET0(R300_RE_CLIPRECT_TL_0, nr * 2 - 1)); 76 76 77 77 for (i = 0; i < nr; ++i) { 78 - if (DRM_COPY_FROM_USER_UNCHECKED 78 + if (DRM_COPY_FROM_USER 79 79 (&box, &cmdbuf->boxes[n + i], sizeof(box))) { 80 80 DRM_ERROR("copy cliprect faulted\n"); 81 81 return -EFAULT;
+11 -1
drivers/gpu/drm/radeon/radeon_drv.c
··· 147 147 #endif 148 148 149 149 int radeon_no_wb; 150 - int radeon_modeset = 1; 150 + int radeon_modeset = -1; 151 151 int radeon_dynclks = -1; 152 152 int radeon_r4xx_atom = 0; 153 153 int radeon_agpmode = 0; ··· 456 456 457 457 static int __init radeon_init(void) 458 458 { 459 + #ifdef CONFIG_VGA_CONSOLE 460 + if (vgacon_text_force() && radeon_modeset == -1) { 461 + DRM_INFO("VGACON disable radeon kernel modesetting.\n"); 462 + radeon_modeset = 0; 463 + } 464 + #endif 465 + /* set to modesetting by default if not nomodeset */ 466 + if (radeon_modeset == -1) 467 + radeon_modeset = 1; 468 + 459 469 if (radeon_modeset == 1) { 460 470 DRM_INFO("radeon kernel modesetting enabled.\n"); 461 471 driver = &kms_driver;
-9
include/drm/drm_os_linux.h
··· 87 87 /** Other copying of data from kernel space */ 88 88 #define DRM_COPY_TO_USER(arg1, arg2, arg3) \ 89 89 copy_to_user(arg1, arg2, arg3) 90 - /* Macros for copyfrom user, but checking readability only once */ 91 - #define DRM_VERIFYAREA_READ( uaddr, size ) \ 92 - (access_ok( VERIFY_READ, uaddr, size ) ? 0 : -EFAULT) 93 - #define DRM_COPY_FROM_USER_UNCHECKED(arg1, arg2, arg3) \ 94 - __copy_from_user(arg1, arg2, arg3) 95 - #define DRM_COPY_TO_USER_UNCHECKED(arg1, arg2, arg3) \ 96 - __copy_to_user(arg1, arg2, arg3) 97 - #define DRM_GET_USER_UNCHECKED(val, uaddr) \ 98 - __get_user(val, uaddr) 99 90 100 91 #define DRM_HZ HZ 101 92