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.

drm/msm/a6xx: Store primFifoThreshold in struct a6xx_info

The if-else monster is so unmaintainable that one case is repeated
twice. Get rid of it.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Patchwork: https://patchwork.freedesktop.org/patch/611092/
[add missing entry to a615 catalog to resolve conflict]
Signed-off-by: Rob Clark <robdclark@chromium.org>

authored by

Konrad Dybcio and committed by
Rob Clark
2bbb5fe3 1b3975ef

+21 -19
+15
drivers/gpu/drm/msm/adreno/a6xx_catalog.c
··· 636 636 .a6xx = &(const struct a6xx_info) { 637 637 .hwcg = a612_hwcg, 638 638 .protect = &a630_protect, 639 + .prim_fifo_threshold = 0x00080000, 639 640 }, 640 641 /* 641 642 * There are (at least) three SoCs implementing A610: SM6125 ··· 667 666 .a6xx = &(const struct a6xx_info) { 668 667 .hwcg = a615_hwcg, 669 668 .protect = &a630_protect, 669 + .prim_fifo_threshold = 0x0018000, 670 670 }, 671 671 .speedbins = ADRENO_SPEEDBINS( 672 672 /* ··· 696 694 .a6xx = &(const struct a6xx_info) { 697 695 .hwcg = a615_hwcg, 698 696 .protect = &a630_protect, 697 + .prim_fifo_threshold = 0x00180000, 699 698 }, 700 699 .speedbins = ADRENO_SPEEDBINS( 701 700 { 0, 0 }, ··· 719 716 .init = a6xx_gpu_init, 720 717 .a6xx = &(const struct a6xx_info) { 721 718 .protect = &a630_protect, 719 + .prim_fifo_threshold = 0x00180000, 722 720 }, 723 721 .speedbins = ADRENO_SPEEDBINS( 724 722 { 0, 0 }, ··· 742 738 .a6xx = &(const struct a6xx_info) { 743 739 .hwcg = a615_hwcg, 744 740 .protect = &a630_protect, 741 + .prim_fifo_threshold = 0x00018000, 745 742 }, 746 743 .speedbins = ADRENO_SPEEDBINS( 747 744 { 0, 0 }, ··· 765 760 .a6xx = &(const struct a6xx_info) { 766 761 .hwcg = a615_hwcg, 767 762 .protect = &a630_protect, 763 + .prim_fifo_threshold = 0x00018000, 768 764 }, 769 765 .speedbins = ADRENO_SPEEDBINS( 770 766 { 0, 0 }, ··· 788 782 .a6xx = &(const struct a6xx_info) { 789 783 .hwcg = a615_hwcg, 790 784 .protect = &a630_protect, 785 + .prim_fifo_threshold = 0x00018000, 791 786 }, 792 787 .speedbins = ADRENO_SPEEDBINS( 793 788 { 0, 0 }, ··· 816 809 .a6xx = &(const struct a6xx_info) { 817 810 .hwcg = a630_hwcg, 818 811 .protect = &a630_protect, 812 + .prim_fifo_threshold = 0x00180000, 819 813 }, 820 814 }, { 821 815 .chip_ids = ADRENO_CHIP_IDS(0x06040001), ··· 834 826 .a6xx = &(const struct a6xx_info) { 835 827 .hwcg = a640_hwcg, 836 828 .protect = &a630_protect, 829 + .prim_fifo_threshold = 0x00180000, 837 830 }, 838 831 .speedbins = ADRENO_SPEEDBINS( 839 832 { 0, 0 }, ··· 857 848 .a6xx = &(const struct a6xx_info) { 858 849 .hwcg = a650_hwcg, 859 850 .protect = &a650_protect, 851 + .prim_fifo_threshold = 0x00300200, 860 852 }, 861 853 .address_space_size = SZ_16G, 862 854 .speedbins = ADRENO_SPEEDBINS( ··· 883 873 .a6xx = &(const struct a6xx_info) { 884 874 .hwcg = a660_hwcg, 885 875 .protect = &a660_protect, 876 + .prim_fifo_threshold = 0x00300200, 886 877 }, 887 878 .address_space_size = SZ_16G, 888 879 }, { ··· 902 891 .a6xx = &(const struct a6xx_info) { 903 892 .hwcg = a660_hwcg, 904 893 .protect = &a660_protect, 894 + .prim_fifo_threshold = 0x00200200, 905 895 }, 906 896 .address_space_size = SZ_16G, 907 897 .speedbins = ADRENO_SPEEDBINS( ··· 928 916 .a6xx = &(const struct a6xx_info) { 929 917 .hwcg = a640_hwcg, 930 918 .protect = &a630_protect, 919 + .prim_fifo_threshold = 0x00200200, 931 920 }, 932 921 }, { 933 922 .chip_ids = ADRENO_CHIP_IDS(0x06090000), ··· 946 933 .a6xx = &(const struct a6xx_info) { 947 934 .hwcg = a690_hwcg, 948 935 .protect = &a690_protect, 936 + .prim_fifo_threshold = 0x00800200, 949 937 }, 950 938 .address_space_size = SZ_16G, 951 939 } ··· 1207 1193 .a6xx = &(const struct a6xx_info) { 1208 1194 .hwcg = a702_hwcg, 1209 1195 .protect = &a650_protect, 1196 + .prim_fifo_threshold = 0x0000c000, 1210 1197 }, 1211 1198 .speedbins = ADRENO_SPEEDBINS( 1212 1199 { 0, 0 },
+5 -19
drivers/gpu/drm/msm/adreno/a6xx_gpu.c
··· 981 981 } else if (!adreno_is_a7xx(adreno_gpu)) 982 982 gpu_write(gpu, REG_A6XX_CP_MEM_POOL_SIZE, 128); 983 983 984 - /* Setting the primFifo thresholds default values, 985 - * and vccCacheSkipDis=1 bit (0x200) for A640 and newer 986 - */ 987 - if (adreno_is_a702(adreno_gpu)) 988 - gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x0000c000); 989 - else if (adreno_is_a690(adreno_gpu)) 990 - gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00800200); 991 - else if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu)) 992 - gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00300200); 993 - else if (adreno_is_a640_family(adreno_gpu) || adreno_is_7c3(adreno_gpu)) 994 - gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00200200); 995 - else if (adreno_is_a650(adreno_gpu) || adreno_is_a660(adreno_gpu)) 996 - gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00300200); 997 - else if (adreno_is_a619(adreno_gpu)) 998 - gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00018000); 999 - else if (adreno_is_a610(adreno_gpu)) 1000 - gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00080000); 1001 - else if (!adreno_is_a7xx(adreno_gpu)) 1002 - gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 0x00180000); 984 + 985 + /* Set the default primFifo threshold values */ 986 + if (adreno_gpu->info->a6xx->prim_fifo_threshold) 987 + gpu_write(gpu, REG_A6XX_PC_DBG_ECO_CNTL, 988 + adreno_gpu->info->a6xx->prim_fifo_threshold); 1003 989 1004 990 /* Set the AHB default slave response to "ERROR" */ 1005 991 gpu_write(gpu, REG_A6XX_CP_AHB_CNTL, 0x1);
+1
drivers/gpu/drm/msm/adreno/a6xx_gpu.h
··· 22 22 const struct adreno_reglist *hwcg; 23 23 const struct adreno_protect *protect; 24 24 u32 gmu_chipid; 25 + u32 prim_fifo_threshold; 25 26 }; 26 27 27 28 struct a6xx_gpu {