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

Merge tag 'exynos-drm-next-for-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

Summary:
- Rework vblank handling
. This patch series adds frame counter callback and removes
unnecessary pipe relevnt fields and simplifies event handling.
- clean up and fix up sw-trigger relevant code
. This patch series moves TE relevant code from Panel and HDMI
to DECON driver to fix a race between interrupt handlers and
DECON disable, and to fix timeout issue at wait-for-vblank.
. It removes unnecessary flags and check code specific to Exynos driver.

* tag 'exynos-drm-next-for-v4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (27 commits)
drm/exynos/decon5433: remove useless check
drm/exynos/decon5433: kill BIT_SUSPENDED flag
drm/exynos/decon5433: kill BIT_WIN_UPDATED flag
drm/exynos/decon5433: kill BIT_CLKS_ENABLED flag
drm/exynos/decon5433: kill BIT_IRQS_ENABLED flag
drm/exynos/decon5433: move TE handling to DECON
dt-bindings: exynos5433-decon: add TE interrupt binding
dt-bindings: exynos5433-decon: fix interrupts bindings
drm/exynos/decon5433: always do sw-trigger when vblanks enabled
drm/exynos: mixer: document YCbCr magic numbers
drm/exynos: mixer: simplify mixer_cfg_rgb_fmt()
drm/exynos/dsi: fix bridge_node DT parsing
drm/exynos/hdmi: fix pipeline disable order
drm/exynos/decon5433: simplify shadow protect code
drm/exynos/decon5433: kill BIT_IRQS_ENABLED
drm/exynos/decon5433: kill DECON_UPDATE workaround
drm/exynos: kill mode_set_nofb callback
drm/exynos: kill pipe field from drivers contexts
drm/exynos: set plane possible_crtcs in exynos_plane_init
drm/exynos: kill exynos_drm_private::pipe
...

+195 -302
+7 -6
Documentation/devicetree/bindings/display/exynos/exynos5433-decon.txt
··· 8 8 - compatible: value should be one of: 9 9 "samsung,exynos5433-decon", "samsung,exynos5433-decon-tv"; 10 10 - reg: physical base address and length of the DECON registers set. 11 - - interrupts: should contain a list of all DECON IP block interrupts in the 12 - order: VSYNC, LCD_SYSTEM. The interrupt specifier format 13 - depends on the interrupt controller used. 14 - - interrupt-names: should contain the interrupt names: "vsync", "lcd_sys" 15 - in the same order as they were listed in the interrupts 16 - property. 11 + - interrupt-names: should contain the interrupt names depending on mode of work: 12 + video mode: "vsync", 13 + command mode: "lcd_sys", 14 + command mode with software trigger: "lcd_sys", "te". 15 + - interrupts or interrupts-extended: list of interrupt specifiers corresponding 16 + to names privided in interrupt-names, as described in 17 + interrupt-controller/interrupts.txt 17 18 - clocks: must include clock specifiers corresponding to entries in the 18 19 clock-names property. 19 20 - clock-names: list of clock names sorted in the same order as the clocks
+95 -123
drivers/gpu/drm/exynos/exynos5433_drm_decon.c
··· 47 47 "sclk_decon_eclk", 48 48 }; 49 49 50 - enum decon_flag_bits { 51 - BIT_CLKS_ENABLED, 52 - BIT_IRQS_ENABLED, 53 - BIT_WIN_UPDATED, 54 - BIT_SUSPENDED, 55 - BIT_REQUEST_UPDATE 56 - }; 57 - 58 50 struct decon_context { 59 51 struct device *dev; 60 52 struct drm_device *drm_dev; ··· 56 64 void __iomem *addr; 57 65 struct regmap *sysreg; 58 66 struct clk *clks[ARRAY_SIZE(decon_clks_name)]; 59 - int pipe; 60 - unsigned long flags; 67 + unsigned int irq; 68 + unsigned int te_irq; 61 69 unsigned long out_type; 62 70 int first_win; 63 71 spinlock_t vblank_lock; ··· 89 97 struct decon_context *ctx = crtc->ctx; 90 98 u32 val; 91 99 92 - if (test_bit(BIT_SUSPENDED, &ctx->flags)) 93 - return -EPERM; 100 + val = VIDINTCON0_INTEN; 101 + if (ctx->out_type & IFTYPE_I80) 102 + val |= VIDINTCON0_FRAMEDONE; 103 + else 104 + val |= VIDINTCON0_INTFRMEN | VIDINTCON0_FRAMESEL_FP; 94 105 95 - if (!test_and_set_bit(BIT_IRQS_ENABLED, &ctx->flags)) { 96 - val = VIDINTCON0_INTEN; 97 - if (ctx->out_type & IFTYPE_I80) 98 - val |= VIDINTCON0_FRAMEDONE; 99 - else 100 - val |= VIDINTCON0_INTFRMEN | VIDINTCON0_FRAMESEL_FP; 106 + writel(val, ctx->addr + DECON_VIDINTCON0); 101 107 102 - writel(val, ctx->addr + DECON_VIDINTCON0); 103 - } 108 + enable_irq(ctx->irq); 109 + if (!(ctx->out_type & I80_HW_TRG)) 110 + enable_irq(ctx->te_irq); 104 111 105 112 return 0; 106 113 } ··· 108 117 { 109 118 struct decon_context *ctx = crtc->ctx; 110 119 111 - if (test_bit(BIT_SUSPENDED, &ctx->flags)) 112 - return; 120 + if (!(ctx->out_type & I80_HW_TRG)) 121 + disable_irq_nosync(ctx->te_irq); 122 + disable_irq_nosync(ctx->irq); 113 123 114 - if (test_and_clear_bit(BIT_IRQS_ENABLED, &ctx->flags)) 115 - writel(0, ctx->addr + DECON_VIDINTCON0); 124 + writel(0, ctx->addr + DECON_VIDINTCON0); 116 125 } 117 126 118 127 /* return number of starts/ends of frame transmissions since reset */ ··· 157 166 return frm; 158 167 } 159 168 169 + static u32 decon_get_vblank_counter(struct exynos_drm_crtc *crtc) 170 + { 171 + struct decon_context *ctx = crtc->ctx; 172 + 173 + return decon_get_frame_count(ctx, false); 174 + } 175 + 160 176 static void decon_setup_trigger(struct decon_context *ctx) 161 177 { 162 178 if (!(ctx->out_type & (IFTYPE_I80 | I80_HW_TRG))) ··· 190 192 struct drm_display_mode *m = &crtc->base.mode; 191 193 bool interlaced = false; 192 194 u32 val; 193 - 194 - if (test_bit(BIT_SUSPENDED, &ctx->flags)) 195 - return; 196 195 197 196 if (ctx->out_type & IFTYPE_HDMI) { 198 197 m->crtc_hsync_start = m->crtc_hdisplay + 10; ··· 304 309 writel(val, ctx->addr + DECON_WINCONx(win)); 305 310 } 306 311 307 - static void decon_shadow_protect_win(struct decon_context *ctx, int win, 308 - bool protect) 312 + static void decon_shadow_protect(struct decon_context *ctx, bool protect) 309 313 { 310 - decon_set_bits(ctx, DECON_SHADOWCON, SHADOWCON_Wx_PROTECT(win), 314 + decon_set_bits(ctx, DECON_SHADOWCON, SHADOWCON_PROTECT_MASK, 311 315 protect ? ~0 : 0); 312 316 } 313 317 314 318 static void decon_atomic_begin(struct exynos_drm_crtc *crtc) 315 319 { 316 320 struct decon_context *ctx = crtc->ctx; 317 - int i; 318 321 319 - if (test_bit(BIT_SUSPENDED, &ctx->flags)) 320 - return; 321 - 322 - for (i = ctx->first_win; i < WINDOWS_NR; i++) 323 - decon_shadow_protect_win(ctx, i, true); 322 + decon_shadow_protect(ctx, true); 324 323 } 325 324 326 325 #define BIT_VAL(x, e, s) (((x) & ((1 << ((e) - (s) + 1)) - 1)) << (s)) ··· 333 344 unsigned int pitch = fb->pitches[0]; 334 345 dma_addr_t dma_addr = exynos_drm_fb_dma_addr(fb, 0); 335 346 u32 val; 336 - 337 - if (test_bit(BIT_SUSPENDED, &ctx->flags)) 338 - return; 339 347 340 348 if (crtc->base.mode.flags & DRM_MODE_FLAG_INTERLACE) { 341 349 val = COORDINATE_X(state->crtc.x) | ··· 376 390 377 391 /* window enable */ 378 392 decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, ~0); 379 - set_bit(BIT_REQUEST_UPDATE, &ctx->flags); 380 393 } 381 394 382 395 static void decon_disable_plane(struct exynos_drm_crtc *crtc, ··· 384 399 struct decon_context *ctx = crtc->ctx; 385 400 unsigned int win = plane->index; 386 401 387 - if (test_bit(BIT_SUSPENDED, &ctx->flags)) 388 - return; 389 - 390 402 decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0); 391 - set_bit(BIT_REQUEST_UPDATE, &ctx->flags); 392 403 } 393 404 394 405 static void decon_atomic_flush(struct exynos_drm_crtc *crtc) 395 406 { 396 407 struct decon_context *ctx = crtc->ctx; 397 408 unsigned long flags; 398 - int i; 399 - 400 - if (test_bit(BIT_SUSPENDED, &ctx->flags)) 401 - return; 402 409 403 410 spin_lock_irqsave(&ctx->vblank_lock, flags); 404 411 405 - for (i = ctx->first_win; i < WINDOWS_NR; i++) 406 - decon_shadow_protect_win(ctx, i, false); 412 + decon_shadow_protect(ctx, false); 407 413 408 - if (test_and_clear_bit(BIT_REQUEST_UPDATE, &ctx->flags)) 409 - decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0); 410 - 411 - if (ctx->out_type & IFTYPE_I80) 412 - set_bit(BIT_WIN_UPDATED, &ctx->flags); 414 + decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0); 413 415 414 416 ctx->frame_id = decon_get_frame_count(ctx, true); 415 417 ··· 445 473 { 446 474 struct decon_context *ctx = crtc->ctx; 447 475 448 - if (!test_and_clear_bit(BIT_SUSPENDED, &ctx->flags)) 449 - return; 450 - 451 476 pm_runtime_get_sync(ctx->dev); 452 477 453 478 exynos_drm_pipe_clk_enable(crtc, true); 454 479 455 - set_bit(BIT_CLKS_ENABLED, &ctx->flags); 456 - 457 480 decon_swreset(ctx); 458 - 459 - /* if vblank was enabled status, enable it again. */ 460 - if (test_and_clear_bit(BIT_IRQS_ENABLED, &ctx->flags)) 461 - decon_enable_vblank(ctx->crtc); 462 481 463 482 decon_commit(ctx->crtc); 464 483 } ··· 459 496 struct decon_context *ctx = crtc->ctx; 460 497 int i; 461 498 462 - if (test_bit(BIT_SUSPENDED, &ctx->flags)) 463 - return; 499 + if (!(ctx->out_type & I80_HW_TRG)) 500 + synchronize_irq(ctx->te_irq); 501 + synchronize_irq(ctx->irq); 464 502 465 503 /* 466 504 * We need to make sure that all windows are disabled before we ··· 473 509 474 510 decon_swreset(ctx); 475 511 476 - clear_bit(BIT_CLKS_ENABLED, &ctx->flags); 477 - 478 512 exynos_drm_pipe_clk_enable(crtc, false); 479 513 480 514 pm_runtime_put_sync(ctx->dev); 481 - 482 - set_bit(BIT_SUSPENDED, &ctx->flags); 483 515 } 484 516 485 - static void decon_te_irq_handler(struct exynos_drm_crtc *crtc) 517 + static irqreturn_t decon_te_irq_handler(int irq, void *dev_id) 486 518 { 487 - struct decon_context *ctx = crtc->ctx; 519 + struct decon_context *ctx = dev_id; 488 520 489 - if (!test_bit(BIT_CLKS_ENABLED, &ctx->flags) || 490 - (ctx->out_type & I80_HW_TRG)) 491 - return; 521 + decon_set_bits(ctx, DECON_TRIGCON, TRIGCON_SWTRIGCMD, ~0); 492 522 493 - if (test_and_clear_bit(BIT_WIN_UPDATED, &ctx->flags)) 494 - decon_set_bits(ctx, DECON_TRIGCON, TRIGCON_SWTRIGCMD, ~0); 523 + return IRQ_HANDLED; 495 524 } 496 525 497 526 static void decon_clear_channels(struct exynos_drm_crtc *crtc) ··· 500 543 goto err; 501 544 } 502 545 503 - for (win = 0; win < WINDOWS_NR; win++) { 504 - decon_shadow_protect_win(ctx, win, true); 546 + decon_shadow_protect(ctx, true); 547 + for (win = 0; win < WINDOWS_NR; win++) 505 548 decon_set_bits(ctx, DECON_WINCONx(win), WINCONx_ENWIN_F, 0); 506 - decon_shadow_protect_win(ctx, win, false); 507 - } 549 + decon_shadow_protect(ctx, false); 508 550 509 551 decon_set_bits(ctx, DECON_UPDATE, STANDALONE_UPDATE_F, ~0); 510 552 ··· 520 564 .disable = decon_disable, 521 565 .enable_vblank = decon_enable_vblank, 522 566 .disable_vblank = decon_disable_vblank, 567 + .get_vblank_counter = decon_get_vblank_counter, 523 568 .atomic_begin = decon_atomic_begin, 524 569 .update_plane = decon_update_plane, 525 570 .disable_plane = decon_disable_plane, 526 571 .atomic_flush = decon_atomic_flush, 527 - .te_handler = decon_te_irq_handler, 528 572 }; 529 573 530 574 static int decon_bind(struct device *dev, struct device *master, void *data) 531 575 { 532 576 struct decon_context *ctx = dev_get_drvdata(dev); 533 577 struct drm_device *drm_dev = data; 534 - struct exynos_drm_private *priv = drm_dev->dev_private; 535 578 struct exynos_drm_plane *exynos_plane; 536 579 enum exynos_drm_output_type out_type; 537 580 unsigned int win; 538 581 int ret; 539 582 540 583 ctx->drm_dev = drm_dev; 541 - ctx->pipe = priv->pipe++; 584 + drm_dev->max_vblank_count = 0xffffffff; 542 585 543 586 for (win = ctx->first_win; win < WINDOWS_NR; win++) { 544 587 int tmp = (win == ctx->first_win) ? 0 : win; ··· 548 593 ctx->configs[win].type = decon_win_types[tmp]; 549 594 550 595 ret = exynos_plane_init(drm_dev, &ctx->planes[win], win, 551 - 1 << ctx->pipe, &ctx->configs[win]); 596 + &ctx->configs[win]); 552 597 if (ret) 553 598 return ret; 554 599 } ··· 557 602 out_type = (ctx->out_type & IFTYPE_HDMI) ? EXYNOS_DISPLAY_TYPE_HDMI 558 603 : EXYNOS_DISPLAY_TYPE_LCD; 559 604 ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base, 560 - ctx->pipe, out_type, 561 - &decon_crtc_ops, ctx); 562 - if (IS_ERR(ctx->crtc)) { 563 - ret = PTR_ERR(ctx->crtc); 564 - goto err; 565 - } 605 + out_type, &decon_crtc_ops, ctx); 606 + if (IS_ERR(ctx->crtc)) 607 + return PTR_ERR(ctx->crtc); 566 608 567 609 decon_clear_channels(ctx->crtc); 568 610 569 - ret = drm_iommu_attach_device(drm_dev, dev); 570 - if (ret) 571 - goto err; 572 - 573 - return ret; 574 - err: 575 - priv->pipe--; 576 - return ret; 611 + return drm_iommu_attach_device(drm_dev, dev); 577 612 } 578 613 579 614 static void decon_unbind(struct device *dev, struct device *master, void *data) ··· 604 659 struct decon_context *ctx = dev_id; 605 660 u32 val; 606 661 607 - if (!test_bit(BIT_CLKS_ENABLED, &ctx->flags)) 608 - goto out; 609 - 610 662 val = readl(ctx->addr + DECON_VIDINTCON1); 611 663 val &= VIDINTCON1_INTFRMDONEPEND | VIDINTCON1_INTFRMPEND; 612 664 ··· 619 677 decon_handle_vblank(ctx); 620 678 } 621 679 622 - out: 623 680 return IRQ_HANDLED; 624 681 } 625 682 ··· 673 732 }; 674 733 MODULE_DEVICE_TABLE(of, exynos5433_decon_driver_dt_match); 675 734 735 + static int decon_conf_irq(struct decon_context *ctx, const char *name, 736 + irq_handler_t handler, unsigned long int flags, bool required) 737 + { 738 + struct platform_device *pdev = to_platform_device(ctx->dev); 739 + int ret, irq = platform_get_irq_byname(pdev, name); 740 + 741 + if (irq < 0) { 742 + if (irq == -EPROBE_DEFER) 743 + return irq; 744 + if (required) 745 + dev_err(ctx->dev, "cannot get %s IRQ\n", name); 746 + else 747 + irq = 0; 748 + return irq; 749 + } 750 + irq_set_status_flags(irq, IRQ_NOAUTOEN); 751 + ret = devm_request_irq(ctx->dev, irq, handler, flags, "drm_decon", ctx); 752 + if (ret < 0) { 753 + dev_err(ctx->dev, "IRQ %s request failed\n", name); 754 + return ret; 755 + } 756 + 757 + return irq; 758 + } 759 + 676 760 static int exynos5433_decon_probe(struct platform_device *pdev) 677 761 { 678 762 struct device *dev = &pdev->dev; ··· 710 744 if (!ctx) 711 745 return -ENOMEM; 712 746 713 - __set_bit(BIT_SUSPENDED, &ctx->flags); 714 747 ctx->dev = dev; 715 748 ctx->out_type = (unsigned long)of_device_get_match_data(dev); 716 749 spin_lock_init(&ctx->vblank_lock); ··· 718 753 ctx->first_win = 1; 719 754 } else if (of_get_child_by_name(dev->of_node, "i80-if-timings")) { 720 755 ctx->out_type |= IFTYPE_I80; 721 - } 722 - 723 - if (ctx->out_type & I80_HW_TRG) { 724 - ctx->sysreg = syscon_regmap_lookup_by_phandle(dev->of_node, 725 - "samsung,disp-sysreg"); 726 - if (IS_ERR(ctx->sysreg)) { 727 - dev_err(dev, "failed to get system register\n"); 728 - return PTR_ERR(ctx->sysreg); 729 - } 730 756 } 731 757 732 758 for (i = 0; i < ARRAY_SIZE(decon_clks_name); i++) { ··· 742 786 return PTR_ERR(ctx->addr); 743 787 } 744 788 745 - res = platform_get_resource_byname(pdev, IORESOURCE_IRQ, 746 - (ctx->out_type & IFTYPE_I80) ? "lcd_sys" : "vsync"); 747 - if (!res) { 748 - dev_err(dev, "cannot find IRQ resource\n"); 749 - return -ENXIO; 789 + if (ctx->out_type & IFTYPE_I80) { 790 + ret = decon_conf_irq(ctx, "lcd_sys", decon_irq_handler, 0, true); 791 + if (ret < 0) 792 + return ret; 793 + ctx->irq = ret; 794 + 795 + ret = decon_conf_irq(ctx, "te", decon_te_irq_handler, 796 + IRQF_TRIGGER_RISING, false); 797 + if (ret < 0) 798 + return ret; 799 + if (ret) { 800 + ctx->te_irq = ret; 801 + ctx->out_type &= ~I80_HW_TRG; 802 + } 803 + } else { 804 + ret = decon_conf_irq(ctx, "vsync", decon_irq_handler, 0, true); 805 + if (ret < 0) 806 + return ret; 807 + ctx->irq = ret; 750 808 } 751 809 752 - ret = devm_request_irq(dev, res->start, decon_irq_handler, 0, 753 - "drm_decon", ctx); 754 - if (ret < 0) { 755 - dev_err(dev, "lcd_sys irq request failed\n"); 756 - return ret; 810 + if (ctx->out_type & I80_HW_TRG) { 811 + ctx->sysreg = syscon_regmap_lookup_by_phandle(dev->of_node, 812 + "samsung,disp-sysreg"); 813 + if (IS_ERR(ctx->sysreg)) { 814 + dev_err(dev, "failed to get system register\n"); 815 + return PTR_ERR(ctx->sysreg); 816 + } 757 817 } 758 818 759 819 platform_set_drvdata(pdev, ctx);
+4 -15
drivers/gpu/drm/exynos/exynos7_drm_decon.c
··· 55 55 unsigned long irq_flags; 56 56 bool i80_if; 57 57 bool suspended; 58 - int pipe; 59 58 wait_queue_head_t wait_vsync_queue; 60 59 atomic_t wait_vsync_event; 61 60 ··· 129 130 static int decon_ctx_initialize(struct decon_context *ctx, 130 131 struct drm_device *drm_dev) 131 132 { 132 - struct exynos_drm_private *priv = drm_dev->dev_private; 133 - int ret; 134 - 135 133 ctx->drm_dev = drm_dev; 136 - ctx->pipe = priv->pipe++; 137 134 138 135 decon_clear_channels(ctx->crtc); 139 136 140 - ret = drm_iommu_attach_device(drm_dev, ctx->dev); 141 - if (ret) 142 - priv->pipe--; 143 - 144 - return ret; 137 + return drm_iommu_attach_device(drm_dev, ctx->dev); 145 138 } 146 139 147 140 static void decon_ctx_remove(struct decon_context *ctx) ··· 581 590 static const struct exynos_drm_crtc_ops decon_crtc_ops = { 582 591 .enable = decon_enable, 583 592 .disable = decon_disable, 584 - .commit = decon_commit, 585 593 .enable_vblank = decon_enable_vblank, 586 594 .disable_vblank = decon_disable_vblank, 587 595 .atomic_begin = decon_atomic_begin, ··· 602 612 writel(clear_bit, ctx->regs + VIDINTCON1); 603 613 604 614 /* check the crtc is detached already from encoder */ 605 - if (ctx->pipe < 0 || !ctx->drm_dev) 615 + if (!ctx->drm_dev) 606 616 goto out; 607 617 608 618 if (!ctx->i80_if) { ··· 639 649 ctx->configs[i].type = decon_win_types[i]; 640 650 641 651 ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, 642 - 1 << ctx->pipe, &ctx->configs[i]); 652 + &ctx->configs[i]); 643 653 if (ret) 644 654 return ret; 645 655 } 646 656 647 657 exynos_plane = &ctx->planes[DEFAULT_WIN]; 648 658 ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base, 649 - ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD, 650 - &decon_crtc_ops, ctx); 659 + EXYNOS_DISPLAY_TYPE_LCD, &decon_crtc_ops, ctx); 651 660 if (IS_ERR(ctx->crtc)) { 652 661 decon_ctx_remove(ctx); 653 662 return PTR_ERR(ctx->crtc);
+22 -28
drivers/gpu/drm/exynos/exynos_drm_crtc.c
··· 49 49 } 50 50 } 51 51 52 - static void 53 - exynos_drm_crtc_mode_set_nofb(struct drm_crtc *crtc) 54 - { 55 - struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); 56 - 57 - if (exynos_crtc->ops->commit) 58 - exynos_crtc->ops->commit(exynos_crtc); 59 - } 60 - 61 52 static int exynos_crtc_atomic_check(struct drm_crtc *crtc, 62 53 struct drm_crtc_state *state) 63 54 { ··· 84 93 static const struct drm_crtc_helper_funcs exynos_crtc_helper_funcs = { 85 94 .enable = exynos_drm_crtc_enable, 86 95 .disable = exynos_drm_crtc_disable, 87 - .mode_set_nofb = exynos_drm_crtc_mode_set_nofb, 88 96 .atomic_check = exynos_crtc_atomic_check, 89 97 .atomic_begin = exynos_crtc_atomic_begin, 90 98 .atomic_flush = exynos_crtc_atomic_flush, ··· 95 105 struct drm_pending_vblank_event *event = crtc->state->event; 96 106 unsigned long flags; 97 107 98 - if (event) { 99 - crtc->state->event = NULL; 100 - spin_lock_irqsave(&crtc->dev->event_lock, flags); 101 - if (drm_crtc_vblank_get(crtc) == 0) 102 - drm_crtc_arm_vblank_event(crtc, event); 103 - else 104 - drm_crtc_send_vblank_event(crtc, event); 105 - spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 106 - } 108 + if (!event) 109 + return; 110 + crtc->state->event = NULL; 107 111 112 + WARN_ON(drm_crtc_vblank_get(crtc) != 0); 113 + 114 + spin_lock_irqsave(&crtc->dev->event_lock, flags); 115 + drm_crtc_arm_vblank_event(crtc, event); 116 + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 108 117 } 109 118 110 119 static void exynos_drm_crtc_destroy(struct drm_crtc *crtc) ··· 132 143 exynos_crtc->ops->disable_vblank(exynos_crtc); 133 144 } 134 145 146 + static u32 exynos_drm_crtc_get_vblank_counter(struct drm_crtc *crtc) 147 + { 148 + struct exynos_drm_crtc *exynos_crtc = to_exynos_crtc(crtc); 149 + 150 + if (exynos_crtc->ops->get_vblank_counter) 151 + return exynos_crtc->ops->get_vblank_counter(exynos_crtc); 152 + 153 + return 0; 154 + } 155 + 135 156 static const struct drm_crtc_funcs exynos_crtc_funcs = { 136 157 .set_config = drm_atomic_helper_set_config, 137 158 .page_flip = drm_atomic_helper_page_flip, ··· 151 152 .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state, 152 153 .enable_vblank = exynos_drm_crtc_enable_vblank, 153 154 .disable_vblank = exynos_drm_crtc_disable_vblank, 155 + .get_vblank_counter = exynos_drm_crtc_get_vblank_counter, 154 156 }; 155 157 156 158 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, 157 159 struct drm_plane *plane, 158 - int pipe, 159 160 enum exynos_drm_output_type type, 160 161 const struct exynos_drm_crtc_ops *ops, 161 162 void *ctx) ··· 168 169 if (!exynos_crtc) 169 170 return ERR_PTR(-ENOMEM); 170 171 171 - exynos_crtc->pipe = pipe; 172 172 exynos_crtc->type = type; 173 173 exynos_crtc->ops = ops; 174 174 exynos_crtc->ctx = ctx; ··· 194 196 { 195 197 struct drm_crtc *crtc; 196 198 197 - list_for_each_entry(crtc, &drm_dev->mode_config.crtc_list, head) { 198 - struct exynos_drm_crtc *exynos_crtc; 199 - 200 - exynos_crtc = to_exynos_crtc(crtc); 201 - if (exynos_crtc->type == out_type) 202 - return exynos_crtc->pipe; 203 - } 199 + drm_for_each_crtc(crtc, drm_dev) 200 + if (to_exynos_crtc(crtc)->type == out_type) 201 + return drm_crtc_index(crtc); 204 202 205 203 return -EPERM; 206 204 }
-1
drivers/gpu/drm/exynos/exynos_drm_crtc.h
··· 19 19 20 20 struct exynos_drm_crtc *exynos_drm_crtc_create(struct drm_device *drm_dev, 21 21 struct drm_plane *plane, 22 - int pipe, 23 22 enum exynos_drm_output_type type, 24 23 const struct exynos_drm_crtc_ops *ops, 25 24 void *context);
+2 -17
drivers/gpu/drm/exynos/exynos_drm_drv.h
··· 115 115 * 116 116 * @enable: enable the device 117 117 * @disable: disable the device 118 - * @commit: set current hw specific display mode to hw. 119 118 * @enable_vblank: specific driver callback for enabling vblank interrupt. 120 119 * @disable_vblank: specific driver callback for disabling vblank interrupt. 121 120 * @atomic_check: validate state ··· 129 130 struct exynos_drm_crtc_ops { 130 131 void (*enable)(struct exynos_drm_crtc *crtc); 131 132 void (*disable)(struct exynos_drm_crtc *crtc); 132 - void (*commit)(struct exynos_drm_crtc *crtc); 133 133 int (*enable_vblank)(struct exynos_drm_crtc *crtc); 134 134 void (*disable_vblank)(struct exynos_drm_crtc *crtc); 135 + u32 (*get_vblank_counter)(struct exynos_drm_crtc *crtc); 135 136 int (*atomic_check)(struct exynos_drm_crtc *crtc, 136 137 struct drm_crtc_state *state); 137 138 void (*atomic_begin)(struct exynos_drm_crtc *crtc); ··· 152 153 * 153 154 * @base: crtc object. 154 155 * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. 155 - * @pipe: a crtc index created at load() with a new crtc object creation 156 - * and the crtc object would be set to private->crtc array 157 - * to get a crtc object corresponding to this pipe from private->crtc 158 - * array when irq interrupt occurred. the reason of using this pipe is that 159 - * drm framework doesn't support multiple irq yet. 160 - * we can refer to the crtc to current hardware interrupt occurred through 161 - * this pipe value. 162 - * @enabled: if the crtc is enabled or not 163 - * @event: vblank event that is currently queued for flip 164 - * @wait_update: wait all pending planes updates to finish 165 - * @pending_update: number of pending plane updates in this crtc 166 156 * @ops: pointer to callbacks for exynos drm specific functionality 167 157 * @ctx: A pointer to the crtc's implementation specific context 158 + * @pipe_clk: A pointer to the crtc's pipeline clock. 168 159 */ 169 160 struct exynos_drm_crtc { 170 161 struct drm_crtc base; 171 162 enum exynos_drm_output_type type; 172 - unsigned int pipe; 173 163 const struct exynos_drm_crtc_ops *ops; 174 164 void *ctx; 175 165 struct exynos_drm_clk *pipe_clk; ··· 191 203 * otherwise default one. 192 204 * @da_space_size: size of device address space. 193 205 * if 0 then default value is used for it. 194 - * @pipe: the pipe number for this crtc/manager. 195 206 * @pending: the crtcs that have pending updates to finish 196 207 * @lock: protect access to @pending 197 208 * @wait: wait an atomic commit to finish ··· 200 213 201 214 struct device *dma_dev; 202 215 void *mapping; 203 - 204 - unsigned int pipe; 205 216 206 217 /* for atomic commit */ 207 218 u32 pending;
+10 -18
drivers/gpu/drm/exynos/exynos_drm_dsi.c
··· 1633 1633 { 1634 1634 struct device *dev = dsi->dev; 1635 1635 struct device_node *node = dev->of_node; 1636 - struct device_node *ep; 1637 1636 int ret; 1638 1637 1639 1638 ret = exynos_dsi_of_read_u32(node, "samsung,pll-clock-frequency", ··· 1640 1641 if (ret < 0) 1641 1642 return ret; 1642 1643 1643 - ep = of_graph_get_endpoint_by_regs(node, DSI_PORT_OUT, 0); 1644 - if (!ep) { 1645 - dev_err(dev, "no output port with endpoint specified\n"); 1646 - return -EINVAL; 1647 - } 1648 - 1649 - ret = exynos_dsi_of_read_u32(ep, "samsung,burst-clock-frequency", 1644 + ret = exynos_dsi_of_read_u32(node, "samsung,burst-clock-frequency", 1650 1645 &dsi->burst_clk_rate); 1651 1646 if (ret < 0) 1652 - goto end; 1647 + return ret; 1653 1648 1654 - ret = exynos_dsi_of_read_u32(ep, "samsung,esc-clock-frequency", 1649 + ret = exynos_dsi_of_read_u32(node, "samsung,esc-clock-frequency", 1655 1650 &dsi->esc_clk_rate); 1656 1651 if (ret < 0) 1657 - goto end; 1652 + return ret; 1658 1653 1659 - of_node_put(ep); 1660 - 1661 - dsi->bridge_node = of_graph_get_remote_node(node, DSI_PORT_OUT, 0); 1654 + dsi->bridge_node = of_graph_get_remote_node(node, DSI_PORT_IN, 0); 1662 1655 if (!dsi->bridge_node) 1663 1656 return -EINVAL; 1664 1657 1665 - end: 1666 - of_node_put(ep); 1667 - 1668 - return ret; 1658 + return 0; 1669 1659 } 1670 1660 1671 1661 static int exynos_dsi_bind(struct device *dev, struct device *master, ··· 1805 1817 1806 1818 static int exynos_dsi_remove(struct platform_device *pdev) 1807 1819 { 1820 + struct exynos_dsi *dsi = platform_get_drvdata(pdev); 1821 + 1822 + of_node_put(dsi->bridge_node); 1823 + 1808 1824 pm_runtime_disable(&pdev->dev); 1809 1825 1810 1826 component_del(&pdev->dev, &exynos_dsi_component_ops);
+5 -19
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 179 179 u32 i80ifcon; 180 180 bool i80_if; 181 181 bool suspended; 182 - int pipe; 183 182 wait_queue_head_t wait_vsync_queue; 184 183 atomic_t wait_vsync_event; 185 184 atomic_t win_updated; ··· 353 354 354 355 /* Wait for vsync, as disable channel takes effect at next vsync */ 355 356 if (ch_enabled) { 356 - int pipe = ctx->pipe; 357 - 358 - /* ensure that vblank interrupt won't be reported to core */ 359 357 ctx->suspended = false; 360 - ctx->pipe = -1; 361 358 362 359 fimd_enable_vblank(ctx->crtc); 363 360 fimd_wait_for_vblank(ctx->crtc); 364 361 fimd_disable_vblank(ctx->crtc); 365 362 366 363 ctx->suspended = true; 367 - ctx->pipe = pipe; 368 364 } 369 365 370 366 clk_disable_unprepare(ctx->lcd_clk); ··· 893 899 u32 trg_type = ctx->driver_data->trg_type; 894 900 895 901 /* Checks the crtc is detached already from encoder */ 896 - if (ctx->pipe < 0 || !ctx->drm_dev) 902 + if (!ctx->drm_dev) 897 903 return; 898 904 899 905 if (trg_type == I80_HW_TRG) ··· 928 934 static const struct exynos_drm_crtc_ops fimd_crtc_ops = { 929 935 .enable = fimd_enable, 930 936 .disable = fimd_disable, 931 - .commit = fimd_commit, 932 937 .enable_vblank = fimd_enable_vblank, 933 938 .disable_vblank = fimd_disable_vblank, 934 939 .atomic_begin = fimd_atomic_begin, ··· 950 957 writel(clear_bit, ctx->regs + VIDINTCON1); 951 958 952 959 /* check the crtc is detached already from encoder */ 953 - if (ctx->pipe < 0 || !ctx->drm_dev) 960 + if (!ctx->drm_dev) 954 961 goto out; 955 962 956 963 if (!ctx->i80_if) ··· 975 982 { 976 983 struct fimd_context *ctx = dev_get_drvdata(dev); 977 984 struct drm_device *drm_dev = data; 978 - struct exynos_drm_private *priv = drm_dev->dev_private; 979 985 struct exynos_drm_plane *exynos_plane; 980 986 unsigned int i; 981 987 int ret; 982 988 983 989 ctx->drm_dev = drm_dev; 984 - ctx->pipe = priv->pipe++; 985 990 986 991 for (i = 0; i < WINDOWS_NR; i++) { 987 992 ctx->configs[i].pixel_formats = fimd_formats; ··· 987 996 ctx->configs[i].zpos = i; 988 997 ctx->configs[i].type = fimd_win_types[i]; 989 998 ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, 990 - 1 << ctx->pipe, &ctx->configs[i]); 999 + &ctx->configs[i]); 991 1000 if (ret) 992 1001 return ret; 993 1002 } 994 1003 995 1004 exynos_plane = &ctx->planes[DEFAULT_WIN]; 996 1005 ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base, 997 - ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD, 998 - &fimd_crtc_ops, ctx); 1006 + EXYNOS_DISPLAY_TYPE_LCD, &fimd_crtc_ops, ctx); 999 1007 if (IS_ERR(ctx->crtc)) 1000 1008 return PTR_ERR(ctx->crtc); 1001 1009 ··· 1009 1019 if (is_drm_iommu_supported(drm_dev)) 1010 1020 fimd_clear_channels(ctx->crtc); 1011 1021 1012 - ret = drm_iommu_attach_device(drm_dev, dev); 1013 - if (ret) 1014 - priv->pipe--; 1015 - 1016 - return ret; 1022 + return drm_iommu_attach_device(drm_dev, dev); 1017 1023 } 1018 1024 1019 1025 static void fimd_unbind(struct device *dev, struct device *master,
+2 -3
drivers/gpu/drm/exynos/exynos_drm_plane.c
··· 273 273 } 274 274 275 275 int exynos_plane_init(struct drm_device *dev, 276 - struct exynos_drm_plane *exynos_plane, 277 - unsigned int index, unsigned long possible_crtcs, 276 + struct exynos_drm_plane *exynos_plane, unsigned int index, 278 277 const struct exynos_drm_plane_config *config) 279 278 { 280 279 int err; 281 280 282 281 err = drm_universal_plane_init(dev, &exynos_plane->base, 283 - possible_crtcs, 282 + 1 << dev->mode_config.num_crtc, 284 283 &exynos_plane_funcs, 285 284 config->pixel_formats, 286 285 config->num_pixel_formats,
-1
drivers/gpu/drm/exynos/exynos_drm_plane.h
··· 11 11 12 12 int exynos_plane_init(struct drm_device *dev, 13 13 struct exynos_drm_plane *exynos_plane, unsigned int index, 14 - unsigned long possible_crtcs, 15 14 const struct exynos_drm_plane_config *config);
+3 -19
drivers/gpu/drm/exynos/exynos_drm_vidi.c
··· 51 51 bool suspended; 52 52 struct timer_list timer; 53 53 struct mutex lock; 54 - int pipe; 55 54 }; 56 55 57 56 static inline struct vidi_context *encoder_to_vidi(struct drm_encoder *e) ··· 152 153 mutex_unlock(&ctx->lock); 153 154 } 154 155 155 - static int vidi_ctx_initialize(struct vidi_context *ctx, 156 - struct drm_device *drm_dev) 157 - { 158 - struct exynos_drm_private *priv = drm_dev->dev_private; 159 - 160 - ctx->drm_dev = drm_dev; 161 - ctx->pipe = priv->pipe++; 162 - 163 - return 0; 164 - } 165 - 166 156 static const struct exynos_drm_crtc_ops vidi_crtc_ops = { 167 157 .enable = vidi_enable, 168 158 .disable = vidi_disable, ··· 164 176 static void vidi_fake_vblank_timer(unsigned long arg) 165 177 { 166 178 struct vidi_context *ctx = (void *)arg; 167 - 168 - if (ctx->pipe < 0) 169 - return; 170 179 171 180 if (drm_crtc_handle_vblank(&ctx->crtc->base)) 172 181 mod_timer(&ctx->timer, ··· 384 399 unsigned int i; 385 400 int pipe, ret; 386 401 387 - vidi_ctx_initialize(ctx, drm_dev); 402 + ctx->drm_dev = drm_dev; 388 403 389 404 plane_config.pixel_formats = formats; 390 405 plane_config.num_pixel_formats = ARRAY_SIZE(formats); ··· 394 409 plane_config.type = vidi_win_types[i]; 395 410 396 411 ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, 397 - 1 << ctx->pipe, &plane_config); 412 + &plane_config); 398 413 if (ret) 399 414 return ret; 400 415 } 401 416 402 417 exynos_plane = &ctx->planes[DEFAULT_WIN]; 403 418 ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base, 404 - ctx->pipe, EXYNOS_DISPLAY_TYPE_VIDI, 405 - &vidi_crtc_ops, ctx); 419 + EXYNOS_DISPLAY_TYPE_VIDI, &vidi_crtc_ops, ctx); 406 420 if (IS_ERR(ctx->crtc)) { 407 421 DRM_ERROR("failed to create crtc.\n"); 408 422 return PTR_ERR(ctx->crtc);
+3 -10
drivers/gpu/drm/exynos/exynos_hdmi.c
··· 1486 1486 static void hdmi_disable(struct drm_encoder *encoder) 1487 1487 { 1488 1488 struct hdmi_context *hdata = encoder_to_hdmi(encoder); 1489 - struct drm_crtc *crtc = encoder->crtc; 1490 - const struct drm_crtc_helper_funcs *funcs = NULL; 1491 1489 1492 1490 if (!hdata->powered) 1493 1491 return; ··· 1496 1498 * to disable TV Subsystem should be as following, 1497 1499 * VP -> Mixer -> HDMI 1498 1500 * 1499 - * Below codes will try to disable Mixer and VP(if used) 1500 - * prior to disabling HDMI. 1501 + * To achieve such sequence HDMI is disabled together with HDMI PHY, via 1502 + * pipe clock callback. 1501 1503 */ 1502 - if (crtc) 1503 - funcs = crtc->helper_private; 1504 - if (funcs && funcs->disable) 1505 - (*funcs->disable)(crtc); 1506 - 1507 - cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID); 1508 1504 cancel_delayed_work(&hdata->hotplug_work); 1505 + cec_notifier_set_phys_addr(hdata->notifier, CEC_PHYS_ADDR_INVALID); 1509 1506 1510 1507 hdmiphy_disable(hdata); 1511 1508 }
+36 -40
drivers/gpu/drm/exynos/exynos_mixer.c
··· 45 45 #define MIXER_WIN_NR 3 46 46 #define VP_DEFAULT_WIN 2 47 47 48 + /* 49 + * Mixer color space conversion coefficient triplet. 50 + * Used for CSC from RGB to YCbCr. 51 + * Each coefficient is a 10-bit fixed point number with 52 + * sign and no integer part, i.e. 53 + * [0:8] = fractional part (representing a value y = x / 2^9) 54 + * [9] = sign 55 + * Negative values are encoded with two's complement. 56 + */ 57 + #define MXR_CSC_C(x) ((int)((x) * 512.0) & 0x3ff) 58 + #define MXR_CSC_CT(a0, a1, a2) \ 59 + ((MXR_CSC_C(a0) << 20) | (MXR_CSC_C(a1) << 10) | (MXR_CSC_C(a2) << 0)) 60 + 61 + /* YCbCr value, used for mixer background color configuration. */ 62 + #define MXR_YCBCR_VAL(y, cb, cr) (((y) << 16) | ((cb) << 8) | ((cr) << 0)) 63 + 48 64 /* The pixelformats that are natively supported by the mixer. */ 49 65 #define MXR_FORMAT_RGB565 4 50 66 #define MXR_FORMAT_ARGB1555 5 ··· 115 99 struct drm_device *drm_dev; 116 100 struct exynos_drm_crtc *crtc; 117 101 struct exynos_drm_plane planes[MIXER_WIN_NR]; 118 - int pipe; 119 102 unsigned long flags; 120 103 121 104 struct mixer_resources mixer_res; ··· 397 382 struct mixer_resources *res = &ctx->mixer_res; 398 383 u32 val; 399 384 400 - if (height == 480) { 385 + switch (height) { 386 + case 480: 387 + case 576: 401 388 val = MXR_CFG_RGB601_0_255; 402 - } else if (height == 576) { 403 - val = MXR_CFG_RGB601_0_255; 404 - } else if (height == 720) { 389 + break; 390 + case 720: 391 + case 1080: 392 + default: 405 393 val = MXR_CFG_RGB709_16_235; 394 + /* Configure the BT.709 CSC matrix for full range RGB. */ 406 395 mixer_reg_write(res, MXR_CM_COEFF_Y, 407 - (1 << 30) | (94 << 20) | (314 << 10) | 408 - (32 << 0)); 396 + MXR_CSC_CT( 0.184, 0.614, 0.063) | 397 + MXR_CM_COEFF_RGB_FULL); 409 398 mixer_reg_write(res, MXR_CM_COEFF_CB, 410 - (972 << 20) | (851 << 10) | (225 << 0)); 399 + MXR_CSC_CT(-0.102, -0.338, 0.440)); 411 400 mixer_reg_write(res, MXR_CM_COEFF_CR, 412 - (225 << 20) | (820 << 10) | (1004 << 0)); 413 - } else if (height == 1080) { 414 - val = MXR_CFG_RGB709_16_235; 415 - mixer_reg_write(res, MXR_CM_COEFF_Y, 416 - (1 << 30) | (94 << 20) | (314 << 10) | 417 - (32 << 0)); 418 - mixer_reg_write(res, MXR_CM_COEFF_CB, 419 - (972 << 20) | (851 << 10) | (225 << 0)); 420 - mixer_reg_write(res, MXR_CM_COEFF_CR, 421 - (225 << 20) | (820 << 10) | (1004 << 0)); 422 - } else { 423 - val = MXR_CFG_RGB709_16_235; 424 - mixer_reg_write(res, MXR_CM_COEFF_Y, 425 - (1 << 30) | (94 << 20) | (314 << 10) | 426 - (32 << 0)); 427 - mixer_reg_write(res, MXR_CM_COEFF_CB, 428 - (972 << 20) | (851 << 10) | (225 << 0)); 429 - mixer_reg_write(res, MXR_CM_COEFF_CR, 430 - (225 << 20) | (820 << 10) | (1004 << 0)); 401 + MXR_CSC_CT( 0.440, -0.399, -0.040)); 402 + break; 431 403 } 432 404 433 405 mixer_reg_writemask(res, MXR_CFG, val, MXR_CFG_RGB_FMT_MASK); ··· 731 729 /* reset default layer priority */ 732 730 mixer_reg_write(res, MXR_LAYER_CFG, 0); 733 731 734 - /* setting background color */ 735 - mixer_reg_write(res, MXR_BG_COLOR0, 0x008080); 736 - mixer_reg_write(res, MXR_BG_COLOR1, 0x008080); 737 - mixer_reg_write(res, MXR_BG_COLOR2, 0x008080); 732 + /* set all background colors to RGB (0,0,0) */ 733 + mixer_reg_write(res, MXR_BG_COLOR0, MXR_YCBCR_VAL(0, 128, 128)); 734 + mixer_reg_write(res, MXR_BG_COLOR1, MXR_YCBCR_VAL(0, 128, 128)); 735 + mixer_reg_write(res, MXR_BG_COLOR2, MXR_YCBCR_VAL(0, 128, 128)); 738 736 739 737 if (test_bit(MXR_BIT_VP_ENABLED, &ctx->flags)) { 740 738 /* configuration of Video Processor Registers */ ··· 902 900 priv = drm_dev->dev_private; 903 901 904 902 mixer_ctx->drm_dev = drm_dev; 905 - mixer_ctx->pipe = priv->pipe++; 906 903 907 904 /* acquire resources: regs, irqs, clocks */ 908 905 ret = mixer_resources_init(mixer_ctx); ··· 919 918 } 920 919 } 921 920 922 - ret = drm_iommu_attach_device(drm_dev, mixer_ctx->dev); 923 - if (ret) 924 - priv->pipe--; 925 - 926 - return ret; 921 + return drm_iommu_attach_device(drm_dev, mixer_ctx->dev); 927 922 } 928 923 929 924 static void mixer_ctx_remove(struct mixer_context *mixer_ctx) ··· 1155 1158 continue; 1156 1159 1157 1160 ret = exynos_plane_init(drm_dev, &ctx->planes[i], i, 1158 - 1 << ctx->pipe, &plane_configs[i]); 1161 + &plane_configs[i]); 1159 1162 if (ret) 1160 1163 return ret; 1161 1164 } 1162 1165 1163 1166 exynos_plane = &ctx->planes[DEFAULT_WIN]; 1164 1167 ctx->crtc = exynos_drm_crtc_create(drm_dev, &exynos_plane->base, 1165 - ctx->pipe, EXYNOS_DISPLAY_TYPE_HDMI, 1166 - &mixer_crtc_ops, ctx); 1168 + EXYNOS_DISPLAY_TYPE_HDMI, &mixer_crtc_ops, ctx); 1167 1169 if (IS_ERR(ctx->crtc)) { 1168 1170 mixer_ctx_remove(ctx); 1169 1171 ret = PTR_ERR(ctx->crtc);
+5 -2
drivers/gpu/drm/exynos/regs-mixer.h
··· 140 140 #define MXR_INT_EN_VSYNC (1 << 11) 141 141 #define MXR_INT_EN_ALL (0x0f << 8) 142 142 143 - /* bit for MXR_INT_STATUS */ 143 + /* bits for MXR_INT_STATUS */ 144 144 #define MXR_INT_CLEAR_VSYNC (1 << 11) 145 145 #define MXR_INT_STATUS_VSYNC (1 << 0) 146 146 147 - /* bit for MXR_LAYER_CFG */ 147 + /* bits for MXR_LAYER_CFG */ 148 148 #define MXR_LAYER_CFG_GRP1_VAL(x) MXR_MASK_VAL(x, 11, 8) 149 149 #define MXR_LAYER_CFG_GRP1_MASK MXR_LAYER_CFG_GRP1_VAL(~0) 150 150 #define MXR_LAYER_CFG_GRP0_VAL(x) MXR_MASK_VAL(x, 7, 4) 151 151 #define MXR_LAYER_CFG_GRP0_MASK MXR_LAYER_CFG_GRP0_VAL(~0) 152 152 #define MXR_LAYER_CFG_VP_VAL(x) MXR_MASK_VAL(x, 3, 0) 153 153 #define MXR_LAYER_CFG_VP_MASK MXR_LAYER_CFG_VP_VAL(~0) 154 + 155 + /* bits for MXR_CM_COEFF_Y */ 156 + #define MXR_CM_COEFF_RGB_FULL (1 << 30) 154 157 155 158 #endif /* SAMSUNG_REGS_MIXER_H */ 156 159
+1
include/video/exynos5433_decon.h
··· 118 118 #define WINCONx_ENWIN_F (1 << 0) 119 119 120 120 /* SHADOWCON */ 121 + #define SHADOWCON_PROTECT_MASK GENMASK(14, 10) 121 122 #define SHADOWCON_Wx_PROTECT(n) (1 << (10 + (n))) 122 123 123 124 /* VIDOSDxD */