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

Merge tag 'tilcdc-4.16' of https://github.com/jsarha/linux into drm-next

drm/tilcdc changes for 4.16

* tag 'tilcdc-4.16' of https://github.com/jsarha/linux:
drm/tilcdc: make tilcdc_mode_hvtotal() static
drm/tilcdc: Remove drm_framebuffer_get() and *_put() calls
drm/tilcdc: ensure nonatomic iowrite64 is not used

+2 -51
+1 -50
drivers/gpu/drm/tilcdc/tilcdc_crtc.c
··· 51 51 ktime_t last_vblank; 52 52 unsigned int hvtotal_us; 53 53 54 - struct drm_framebuffer *curr_fb; 55 54 struct drm_framebuffer *next_fb; 56 - 57 - /* for deferred fb unref's: */ 58 - struct drm_flip_work unref_work; 59 55 60 56 /* Only set if an external encoder is connected */ 61 57 bool simulate_vesa_sync; ··· 66 70 }; 67 71 #define to_tilcdc_crtc(x) container_of(x, struct tilcdc_crtc, base) 68 72 69 - static void unref_worker(struct drm_flip_work *work, void *val) 70 - { 71 - struct tilcdc_crtc *tilcdc_crtc = 72 - container_of(work, struct tilcdc_crtc, unref_work); 73 - struct drm_device *dev = tilcdc_crtc->base.dev; 74 - 75 - mutex_lock(&dev->mode_config.mutex); 76 - drm_framebuffer_put(val); 77 - mutex_unlock(&dev->mode_config.mutex); 78 - } 79 - 80 73 static void set_scanout(struct drm_crtc *crtc, struct drm_framebuffer *fb) 81 74 { 82 - struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); 83 75 struct drm_device *dev = crtc->dev; 84 76 struct tilcdc_drm_private *priv = dev->dev_private; 85 77 struct drm_gem_cma_object *gem; ··· 92 108 93 109 dma_base_and_ceiling = (u64)end << 32 | start; 94 110 tilcdc_write64(dev, LCDC_DMA_FB_BASE_ADDR_0_REG, dma_base_and_ceiling); 95 - 96 - if (tilcdc_crtc->curr_fb) 97 - drm_flip_work_queue(&tilcdc_crtc->unref_work, 98 - tilcdc_crtc->curr_fb); 99 - 100 - tilcdc_crtc->curr_fb = fb; 101 111 } 102 112 103 113 /* ··· 272 294 LCDC_V2_CORE_CLK_EN); 273 295 } 274 296 275 - uint tilcdc_mode_hvtotal(const struct drm_display_mode *mode) 297 + static uint tilcdc_mode_hvtotal(const struct drm_display_mode *mode) 276 298 { 277 299 return (uint) div_u64(1000llu * mode->htotal * mode->vtotal, 278 300 mode->clock); ··· 442 464 443 465 set_scanout(crtc, fb); 444 466 445 - drm_framebuffer_get(fb); 446 - 447 467 crtc->hwmode = crtc->state->adjusted_mode; 448 468 449 469 tilcdc_crtc->hvtotal_us = ··· 500 524 { 501 525 struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); 502 526 struct drm_device *dev = crtc->dev; 503 - struct tilcdc_drm_private *priv = dev->dev_private; 504 527 int ret; 505 528 506 529 mutex_lock(&tilcdc_crtc->enable_lock); ··· 528 553 tilcdc_crtc_disable_irqs(dev); 529 554 530 555 pm_runtime_put_sync(dev->dev); 531 - 532 - if (tilcdc_crtc->next_fb) { 533 - drm_flip_work_queue(&tilcdc_crtc->unref_work, 534 - tilcdc_crtc->next_fb); 535 - tilcdc_crtc->next_fb = NULL; 536 - } 537 - 538 - if (tilcdc_crtc->curr_fb) { 539 - drm_flip_work_queue(&tilcdc_crtc->unref_work, 540 - tilcdc_crtc->curr_fb); 541 - tilcdc_crtc->curr_fb = NULL; 542 - } 543 - 544 - drm_flip_work_commit(&tilcdc_crtc->unref_work, priv->wq); 545 556 546 557 tilcdc_crtc->enabled = false; 547 558 mutex_unlock(&tilcdc_crtc->enable_lock); ··· 575 614 576 615 static void tilcdc_crtc_destroy(struct drm_crtc *crtc) 577 616 { 578 - struct tilcdc_crtc *tilcdc_crtc = to_tilcdc_crtc(crtc); 579 617 struct tilcdc_drm_private *priv = crtc->dev->dev_private; 580 618 581 619 tilcdc_crtc_shutdown(crtc); ··· 583 623 584 624 of_node_put(crtc->port); 585 625 drm_crtc_cleanup(crtc); 586 - drm_flip_work_cleanup(&tilcdc_crtc->unref_work); 587 626 } 588 627 589 628 int tilcdc_crtc_update_fb(struct drm_crtc *crtc, ··· 597 638 return -EBUSY; 598 639 } 599 640 600 - drm_framebuffer_get(fb); 601 - 602 - crtc->primary->fb = fb; 603 641 tilcdc_crtc->event = event; 604 642 605 643 mutex_lock(&tilcdc_crtc->enable_lock); ··· 892 936 893 937 now = ktime_get(); 894 938 895 - drm_flip_work_commit(&tilcdc_crtc->unref_work, priv->wq); 896 - 897 939 spin_lock_irqsave(&tilcdc_crtc->irq_lock, flags); 898 940 899 941 tilcdc_crtc->last_vblank = now; ··· 1017 1063 mutex_init(&tilcdc_crtc->enable_lock); 1018 1064 1019 1065 init_waitqueue_head(&tilcdc_crtc->frame_done_wq); 1020 - 1021 - drm_flip_work_init(&tilcdc_crtc->unref_work, 1022 - "unref", unref_worker); 1023 1066 1024 1067 spin_lock_init(&tilcdc_crtc->irq_lock); 1025 1068 INIT_WORK(&tilcdc_crtc->recover_work, tilcdc_crtc_recover_work);
+1 -1
drivers/gpu/drm/tilcdc/tilcdc_regs.h
··· 133 133 struct tilcdc_drm_private *priv = dev->dev_private; 134 134 volatile void __iomem *addr = priv->mmio + reg; 135 135 136 - #ifdef iowrite64 136 + #if defined(iowrite64) && !defined(iowrite64_is_nonatomic) 137 137 iowrite64(data, addr); 138 138 #else 139 139 __iowmb();