File drm.spec of Package drm.openSUSE_Leap_42.3_Update

#
# spec file for package drm
#
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# needssslcertforbuild


%define kernel_version 4.9.33
# define otherarchs aarch64

Name:           drm
BuildRequires:  %kernel_module_package_buildreqs
BuildRequires:  kernel-source
Url:            http://kernel.org/
Summary:        Backported drm kernel modules
License:        GPL-2.0-only
Group:          System/Kernel
ExclusiveArch:  x86_64 %{?otherarchs}
Version:        4.9.33
Release:        0
Source0:        drm-%{kernel_version}.tar.xz
Source2:        Module.supported
Source3:        preamble
Patch1:         0001-drm-Don-t-use-driver-specific-i2c-locking.patch
Patch2:         0002-drm-i915-Add-u64_to_user_ptr-macro.patch
Patch3:         0003-drm-i915-Remove-use-of-vmap-notifier.patch
Patch4:         0004-drm-Remove-use-of-non-exisiting-__malloc-attribute.patch
Patch5:         0005-drm-i915-Remove-call-to-intel-gtt.patch
Patch6:         0006-drm-i915-Add-extra-argument-to-get_user_pages_remote.patch
Patch7:         0007-makefile-Add-a-makefile-for-the-oot-build.patch
Patch8:         0008-intel_ips-Include-the-header-file.patch
Patch9:         0009-drm-amdkfd-Replace-in_compat_syscall-with-is_compat_.patch
Patch10:        0010-drm-bochs-cirrus-i915-Fixup-missing-PCI-IDs.patch
Patch11:        0011-drm-vmwgfx-Remove-missing-stack-frame-code.patch
Patch12:        0012-drm-Make-all-drivers-use-the-correct-include-directo.patch
Patch13:        0013-drm-virtio-Fix-compile-warning-for-use-of-find_vbq.patch
Patch14:        0014-drm-dma_attrs-revert.patch
Patch15:        0015-workaround-for-pci-d3_bridge.patch
Patch16:        0016-drm-amdgpu-add-the-interface-of-waiting-multiple-fen.patch
Patch20:        0020-drm-msm-Remove-use-of-vmap-notifier.patch
Patch21:        0021-drm-msm-Add-u64_to_user_ptr.patch
Patch22:        0022-drm-tegra-Revert-dsi-runtime-pm.patch
Patch23:        0023-drm-msm-Disable-dsi-pll-8960-phy.patch
Patch24:        0024-drm-tegra-Workaround-for-pinconf_generic_dt_free_map.patch
Patch25:        0025-drm-i915-comment-out-PCI_DEV_FLAGS_NEEDS_RESUME.patch
Patch26:        0026-host1x-build-hack.patch
Patch27:        0027-enable-AMDGPU-flavors.diff
# Upstream fixes
# v4.9.34
Patch101:       0101-drm-amdgpu-Fix-overflow-of-watermark-calcs-at-4k-res.patch
Patch102:       0102-drm-i915-Fix-GVT-g-PVINFO-version-compatibility-chec.patch
Patch103:       0103-drm-mediatek-fix-mtk_hdmi_setup_vendor_specific_info.patch
Patch104:       0104-drm-vc4-Fix-OOPSes-from-trying-to-cache-a-partially-.patch
# v4.9.35
Patch105:       0105-drm-radeon-add-a-PX-quirk-for-another-K53TK-variant.patch
Patch106:       0106-drm-radeon-add-a-quirk-for-Toshiba-Satellite-L20-183.patch
Patch107:       0107-drm-amdgpu-atom-fix-ps-allocation-size-for-EnableDis.patch
Patch108:       0108-drm-amdgpu-adjust-default-display-clock.patch
# v4.9.36
Patch109:       0109-drm-ast-Handle-configuration-without-P2A-bridge.patch
Patch110:       0110-drm-vmwgfx-Free-hash-table-allocated-by-cmdbuf-manag.patch
Patch111:       0111-drm-amdgpu-fix-program-vce-instance-logic-error.patch
Patch112:       0112-drm-amdgpu-add-support-for-new-hainan-variants.patch
Patch113:       0113-drm-amdgpu-check-ring-being-ready-before-using.patch
Patch114:       0114-drm-etnaviv-trick-drm_mm-into-giving-out-a-low-IOVA.patch
Patch115:       0115-drm-radeon-si-load-special-ucode-for-certain-MC-conf.patch
Patch116:       0116-drm-amd-powerplay-fix-vce-cg-logic-error-on-CZ-St.patch
Patch117:       0117-drm-amd-powerplay-refine-vce-dpm-update-code-on-Cz.patch
# v4.9.37
Patch118:       0118-drm-virtio-don-t-leak-bo-on-drm_gem_object_init-fail.patch
# v4.9.40
Patch119:       0119-drm-amd-amdgpu-Return-error-if-initiating-read-out-o.patch
Patch120:       0120-drm-radeon-ci-disable-mclk-switching-for-high-refres.patch
Patch121:       0121-drm-radeon-Fix-eDP-for-single-display-iMac10-1-v2.patch
Patch122:       0122-drm-ttm-Fix-use-after-free-in-ttm_bo_clean_mm.patch
Patch123:       0123-drm-mst-Fix-error-handling-during-MST-sideband-messa.patch
Patch124:       0124-drm-mst-Avoid-dereferencing-a-NULL-mstb-in-drm_dp_ms.patch
Patch125:       0125-drm-mst-Avoid-processing-partially-received-up-down-.patch
# v4.9.41
Patch126:       0126-drm-vmwgfx-Fix-gcc-7.1.1-warning.patch
Patch127:       0127-drm-nouveau-disp-nv50-bump-max-chans-to-21.patch
Patch128:       0128-drm-nouveau-bar-gf100-fix-access-to-upper-half-of-BA.patch
Patch129:       0129-drm-rcar-du-Simplify-and-fix-probe-error-handling.patch
Patch130:       0130-drm-msm-Ensure-that-the-hardware-write-pointer-is-va.patch
Patch131:       0131-drm-msm-Put-back-the-vaddr-in-submit_reloc.patch
Patch132:       0132-drm-msm-Verify-that-MSM_SUBMIT_BO_FLAGS-are-set.patch
# v4.9.42
Patch133:       0133-drm-amdgpu-Fix-undue-fallthroughs-in-golden-register.patch
Patch134:       0134-drm-virtio-fix-framebuffer-sparse-warning.patch
# v4.9.44
Patch135:       0135-drm-etnaviv-Fix-off-by-one-error-in-reloc-checking.patch
Patch136:       0136-drm-i915-Fix-out-of-bounds-array-access-in-bdw_load_.patch
# v4.9.46
Patch137:       0137-drm-Release-driver-tracking-before-making-the-object.patch
Patch138:       0138-drm-atomic-If-the-atomic-check-fails-return-its-valu.patch
Patch139:       0139-drm-rcar-du-Fix-crash-in-encoder-failure-error-path.patch
Patch140:       0140-drm-rcar-du-Fix-display-timing-controller-parameter.patch
Patch141:       0141-drm-rcar-du-Fix-H-V-sync-signal-polarity-configurati.patch
# v4.9.48
Patch142:       0142-drm-ttm-Fix-accounting-error-when-fail-to-get-pages-.patch
# v4.9.49
Patch143:       0143-drm-nouveau-pci-msi-disable-MSI-on-big-endian-platfo.patch
Patch144:       0144-drm-bridge-adv7511-Use-work_struct-to-defer-hotplug-.patch
Patch145:       0145-drm-bridge-adv7511-Switch-to-using-drm_kms_helper_ho.patch
# v4.9.52
Patch146:       0146-drm-sun4i-Implement-drm_driver-lastclose-to-restore-.patch
# v4.9.53
Patch147:       0147-drm-radeon-disable-hard-reset-in-hibernate-for-APUs.patch
Patch148:       0148-etnaviv-fix-gem-object-list-corruption.patch
# v4.9.54
Patch149:       0149-drm-i915-Fix-the-overlay-frontbuffer-tracking.patch
Patch150:       0150-drm-i915-psr-disable-psr2-for-resolution-greater-tha.patch
Patch151:       0151-drm-amdkfd-fix-improper-return-value-on-error.patch
Patch152:       0152-drm-mali-dp-Fix-destination-size-handling-when-rotat.patch
Patch153:       0153-drm-mali-dp-Fix-transposed-horizontal-vertical-flip.patch
# v4.9.55
Patch154:       0154-drm-i915-bios-ignore-HDMI-on-port-A.patch
# v4.9.56
Patch155:       0155-drm-i915-edp-Get-the-Panel-Power-Off-timestamp-after.patch
# v4.9.57
Patch156:       0156-drm-i915-Read-timings-from-the-correct-transcoder-in.patch
Patch157:       0157-drm-i915-bios-parse-DDI-ports-also-for-CHV-for-HDMI-.patch
# v4.9.58
Patch158:       0158-drm-amdgpu-refuse-to-reserve-io-mem-for-split-VRAM-b.patch
Patch159:       0159-drm-nouveau-gr-gf100-fix-ccache-error-logging.patch
# v4.9.59
Patch160:       0160-drm-nouveau-bsp-g92-disable-by-default.patch
Patch161:       0161-drm-nouveau-mmu-flush-tlbs-before-deleting-page-tabl.patch
# v4.9.60
Patch162:       0162-drm-amd-powerplay-fix-uninitialized-variable.patch
Patch163:       0163-drm-amdgpu-return-ENOENT-from-uvd-6.0-early-init-for.patch
Patch164:       0164-drm-i915-edp-read-edp-display-control-registers-unco.patch
Patch165:       0165-drm-msm-Fix-potential-buffer-overflow-issue.patch
Patch166:       0166-drm-msm-fix-an-integer-overflow-test.patch
Patch167:       0167-drm-amdgpu-when-dpm-disabled-also-need-to-stop-start.patch
Patch168:       0168-drm-fsl-dcu-check-for-clk_prepare_enable-error.patch
Patch169:       0169-drm-exynos-g2d-prevent-integer-overflow-in.patch
# v4.9.61
Patch170:       0170-drm-drm_minor_register-Clean-up-debugfs-on-failure.patch
Patch171:       0171-drm-mali-dp-fix-Lx_CONTROL-register-fields-clobber.patch
Patch172:       0172-drm-i915-Do-not-rely-on-wm-preservation-for-ILK-wate.patch
Patch173:       0173-drm-vmwgfx-Fix-Ubuntu-17.10-Wayland-black-screen-iss.patch
Patch174:       0174-drm-bridge-adv7511-Rework-adv7511_power_on-off-so-th.patch
Patch175:       0175-drm-bridge-adv7511-Reuse-__adv7511_power_on-off-when.patch
Patch176:       0176-drm-bridge-adv7511-Re-write-the-i2c-address-before-E.patch
# v4.9.63
Patch177:       0177-drm-sti-sti_vtg-Handle-return-NULL-error-from-devm_i.patch
Patch178:       0178-drm-omap-panel-sony-acx565akm.c-Add-MODULE_ALIAS.patch
Patch179:       0179-gpu-drm-mgag200-mgag200_main-Handle-error-from-pci_i.patch
# v4.9.66
Patch501:       0501-Revert-drm-i915-Do-not-rely-on-wm-preservation-for-I.patch
Patch502:       0502-drm-sun4i-Fix-a-return-value-in-case-of-error.patch
Patch503:       0503-drm-armada-Fix-compile-fail.patch
Patch504:       0504-drm-Apply-range-restriction-after-color-adjustment-w.patch
Patch505:       0505-drm-mediatek-don-t-use-drm_put_dev.patch
# v4.9.67
Patch506:       0506-Revert-drm-radeon-dont-switch-vt-on-suspend.patch
Patch507:       0507-drm-amdgpu-potential-uninitialized-variable-in-amdgp.patch
Patch508:       0508-drm-amdgpu-Potential-uninitialized-variable-in-amdgp.patch
Patch509:       0509-drm-radeon-fix-atombios-on-big-endian.patch
Patch510:       0510-drm-panel-simple-Add-missing-panel_simple_unprepare-.patch
Patch511:       0511-drm-hisilicon-Ensure-LDI-regs-are-properly-configure.patch
Patch512:       0512-drm-ttm-once-more-fix-ttm_buffer_object_transfer.patch
Patch513:       0513-drm-amd-pp-fix-typecast-error-in-powerplay.patch
Patch514:       0514-drm-i915-Don-t-try-indexed-reads-to-alternate-slave-.patch
Patch515:       0515-drm-i915-Prevent-zero-length-index-write.patch
# v4.9.68
Patch516:       0516-drm-fsl-dcu-avoid-disabling-pixel-clock-twice-on-sus.patch
Patch517:       0517-drm-fsl-dcu-enable-IRQ-before-drm_atomic_helper_resu.patch
Patch518:       0518-drm-exynos-decon5433-update-shadow-registers-iff-the.patch
Patch519:       0519-drm-exynos-decon5433-set-STANDALONE_UPDATE_F-also-if.patch
Patch520:       0520-drm-amdgpu-fix-bug-set-incorrect-value-to-vce-regist.patch
Patch521:       0521-drm-exynos-decon5433-set-STANDALONE_UPDATE_F-on-outp.patch
Patch522:       0522-drm-amdgpu-fix-unload-driver-issue-for-virtual-displ.patch
# v4.9.69
Patch523:       0523-drm-exynos-gem-Drop-NONCONTIG-flag-for-buffers-alloc.patch
Patch524:       0524-Revert-drm-armada-Fix-compile-fail.patch
Patch525:       0525-drm-amd-amdgpu-fix-console-deadlock-if-late-init-fai.patch
# v4.9.71
Patch526:       0526-drm-amdgpu-fix-parser-init-error-path-to-avoid-crash.patch
Patch527:       0527-drm-omap-fix-dmabuf-mmap-for-dma_alloc-ed-buffers.patch
Patch528:       0528-drm-amd-remove-broken-include-path.patch
Patch529:       0529-drm-radeon-si-add-dpm-quirk-for-Oland.patch
Patch530:       0530-drm-radeon-reinstate-oland-workaround-for-sclk.patch
# v4.9.77
Patch531:       0531-drm-vmwgfx-Potential-off-by-one-in-vmw_view_add.patch
# v4.9.80
Patch532:       0532-drm-vc4-Account-for-interrupts-in-flight.patch
Patch533:       0533-drm-amdgpu-Fix-SDMA-load-unload-sequence-on-HWS-disa.patch
Patch534:       0534-drm-amdkfd-Fix-SDMA-ring-buffer-size-calculation.patch
Patch535:       0535-drm-amdkfd-Fix-SDMA-oversubsription-handling.patch
Patch536:       0536-drm-amdgpu-don-t-try-to-move-pinned-BOs.patch
Patch537:       0537-drm-bridge-tc358767-do-no-fail-on-hi-res-displays.patch
Patch538:       0538-drm-bridge-tc358767-filter-out-too-high-modes.patch
Patch539:       0539-drm-bridge-tc358767-fix-DP0_MISC-register-set.patch
Patch540:       0540-drm-bridge-tc358767-fix-timing-calculations.patch
Patch541:       0541-drm-bridge-tc358767-fix-AUXDATAn-registers-access.patch
Patch542:       0542-drm-bridge-tc358767-fix-1-lane-behavior.patch
Patch543:       0543-drm-omap-Fix-error-handling-path-in-omap_dmm_probe.patch
Patch544:       0544-drm-vc4-Move-IRQ-enable-to-PM-path.patch
# v4.9.81
Patch545:       0545-drm-rcar-du-Use-the-VBK-interrupt-for-vblank-events.patch
Patch546:       0546-drm-rcar-du-Fix-race-condition-when-disabling-planes.patch
# Upstream DP-MST fixes
Patch201:       0201-drm-Add-driver-private-objects-to-atomic-state.patch
Patch202:       0202-drm-dp-Introduce-MST-topology-state-to-track-availab.patch
# hisilicon hibmc driver
Patch301:       0301-drm-hisilicon-hibmc-Add-hisilicon-hibmc-drm-master-d.patch
Patch302:       0302-drm-hisilicon-hibmc-Add-video-memory-management.patch
Patch303:       0303-drm-hisilicon-hibmc-Add-support-for-frame-buffer.patch
Patch304:       0304-drm-hisilicon-hibmc-Add-support-for-display-engine.patch
Patch305:       0305-drm-hisilicon-hibmc-Add-support-for-VDAC.patch
Patch306:       0306-drm-hisilicon-hibmc-Add-support-for-vblank-interrupt.patch
Patch307:       0307-drm-hisilicon-hibmc-Checking-for-NULL-instead-of-IS_.patch
Patch308:       0308-drm-hisilicon-hibmc-mark-PM-functions-__maybe_unused.patch
Patch309:       0309-drm-hisilicon-hibmc-Fix-wrong-pointer-passed-to-PTR_.patch
# AMDGPU / radeon fixes
Patch401:       0401-drm-radeon-Add-module-param-to-control-CIK-support.patch
Patch402:       0402-drm-radeon-Add-module-param-to-control-SI-support.patch
Patch403:       0403-drm-radeon-Make-si_support-and-cik_support-parameter.patch
Patch404:       0404-drm-amdgpu-Add-module-param-to-control-CIK-support.patch
Patch405:       0405-drm-amdgpu-Add-module-param-to-control-SI-support.patch
Patch406:       0406-drm-amdgpu-Update-Kconfig-help-for-SI-and-CIK-suppor.patch
Patch407:       0407-drm-amdgpu-radeon-Use-radeon-by-default-for-CIK-GPUs.patch
Patch408:       0408-amdgpu-Set-cik-si_support-to-1-by-default-if-radeon-.patch
# SLE patches
Patch1001:      1001-drm-mgag200-Added-support-for-the-new-device-G200eH3.patch
Patch1002:      1002-drm-i915-Add-intel_uncore_suspend-resume-functions.patch
Patch1003:      1003-drm-i915-Listen-for-PMIC-bus-access-notifications.patch
Patch1004:      1004-drm-i915-Fix-crash-after-S3-resume-with-DP-MST-mode-.patch
Patch1005:      1005-drm-i915-Use-pagecache-write-to-prepopulate-shmemfs-.patch
Patch1006:      1006-drm-mgag200-Fix-to-always-set-HiPri-for-G200e4.patch
Patch1007:      1007-drm-i915-Disable-tv-output-on-i9x5gm.patch
Patch1008:      1008-drm-i915-Serialize-GTT-Aperture-accesses-on-BXT.patch
Patch1010:      1010-drm-i915-Unify-active-context-tracking-between-legac.patch
Patch1011:      1011-drm-vmwgfx-Support-topology-greater-than-texture-siz.patch
Patch1012:      1012-drm-vmwgfx-Fix-large-topology-crash.patch
Patch1013:      1013-drm-vmwgfx-Limit-max-desktop-dimensions-to-8Kx8K.patch
Patch1014:      1014-drm-i915-Restore-marking-context-objects-as-dirty-on.patch
Patch1015:      1015-drm-i915-gpu-reset-oops-fix.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
# Use a hardcoded list of KBL pci ids in the preamble file
%define __ksyms_supplements %{nil}
%kernel_module_package -p %_sourcedir/preamble

%description
Backported drm kernel modules for upgrading to the 4.9.x kernel implemntations.
This is mainly for supporting Intel Kabylake graphics, but also for bringing
up / fixing the other graphics devices.

%prep
%setup -q -c -n %{name} -T -a 0
cp %{S:2} .
cp -a /usr/src/linux/drivers/gpu/host1x drivers/gpu/
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%patch10 -p1
%patch11 -p1
%patch12 -p1
%patch13 -p1
%patch14 -p1
if ! grep -q d3_bridge /usr/src/linux/include/linux/pci.h; then
%patch15 -p1
fi
%patch16 -p1
%patch20 -p1
%patch21 -p1
%patch22 -p1
%patch23 -p1
%patch24 -p1
%patch25 -p1
%patch26 -p1
%patch27 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1
%patch106 -p1
%patch107 -p1
%patch108 -p1
%patch109 -p1
%patch110 -p1
%patch111 -p1
%patch112 -p1
%patch113 -p1
%patch114 -p1
%patch115 -p1
%patch116 -p1
%patch117 -p1
%patch118 -p1
%patch119 -p1
%patch120 -p1
%patch121 -p1
%patch122 -p1
%patch123 -p1
%patch124 -p1
%patch125 -p1
%patch126 -p1
%patch127 -p1
%patch128 -p1
%patch129 -p1
%patch130 -p1
%patch131 -p1
%patch132 -p1
%patch133 -p1
%patch134 -p1
%patch135 -p1
%patch136 -p1
%patch137 -p1
%patch138 -p1
%patch139 -p1
%patch140 -p1
%patch141 -p1
%patch142 -p1
%patch143 -p1
%patch144 -p1
%patch145 -p1
%patch146 -p1
%patch147 -p1
%patch148 -p1
%patch149 -p1
%patch150 -p1
%patch151 -p1
%patch152 -p1
%patch153 -p1
%patch154 -p1
%patch155 -p1
%patch156 -p1
%patch157 -p1
%patch158 -p1
%patch159 -p1
%patch160 -p1
%patch161 -p1
%patch162 -p1
%patch163 -p1
%patch164 -p1
%patch165 -p1
%patch166 -p1
%patch167 -p1
%patch168 -p1
%patch169 -p1
%patch170 -p1
%patch171 -p1
%patch172 -p1
%patch173 -p1
%patch174 -p1
%patch175 -p1
%patch176 -p1
%patch177 -p1
%patch178 -p1
%patch179 -p1
%patch501 -p1
%patch502 -p1
%patch503 -p1
%patch504 -p1
%patch505 -p1
%patch506 -p1
%patch507 -p1
%patch508 -p1
%patch509 -p1
%patch510 -p1
%patch511 -p1
%patch512 -p1
%patch513 -p1
%patch514 -p1
%patch515 -p1
%patch516 -p1
%patch517 -p1
%patch518 -p1
%patch519 -p1
%patch520 -p1
%patch521 -p1
%patch522 -p1
%patch523 -p1
%patch524 -p1
%patch525 -p1
%patch526 -p1
%patch527 -p1
%patch528 -p1
%patch529 -p1
%patch530 -p1
%patch531 -p1
%patch532 -p1
%patch533 -p1
%patch534 -p1
%patch535 -p1
%patch536 -p1
%patch537 -p1
%patch538 -p1
%patch539 -p1
%patch540 -p1
%patch541 -p1
%patch542 -p1
%patch543 -p1
%patch544 -p1
%patch545 -p1
%patch546 -p1
# disabled DP-MST fixes due to regression (bsc#1087047)
%if 0
%patch201 -p1
%patch202 -p1
%endif
%patch301 -p1
%patch302 -p1
%patch303 -p1
%patch304 -p1
%patch305 -p1
%patch306 -p1
%patch307 -p1
%patch308 -p1
%patch309 -p1
%patch401 -p1
%patch402 -p1
%patch403 -p1
%patch404 -p1
%patch405 -p1
%patch406 -p1
%patch407 -p1
%patch408 -p1
%patch1001 -p1
%patch1002 -p1
%patch1003 -p1
%patch1004 -p1
%patch1005 -p1
%patch1006 -p1
%patch1007 -p1
%patch1008 -p1
%patch1010 -p1
%patch1011 -p1
%patch1012 -p1
%patch1013 -p1
%patch1014 -p1
%patch1015 -p1

%build
# copy to each flavor
set -- *
for flavor in %flavors_to_build; do
  mkdir -p build-$flavor && cp -al "$@" build-$flavor
done
for flavor in %flavors_to_build; do
  make %{?jobs:-j %jobs} -C /usr/src/linux-obj/%_target_cpu/$flavor \
       M=$(pwd)/build-$flavor \
       CONFIG_DRM_AMDGPU_SI=y \
       CONFIG_DRM_AMDGPU_CIK=y
done

%install
export INSTALL_MOD_PATH=%{buildroot}
export INSTALL_MOD_DIR=updates
export BRP_PESIGN_FILES="*.ko"
for flavor in %flavors_to_build; do
  make -C /usr/src/linux-obj/%_target_cpu/$flavor \
    M=$(pwd)/build-$flavor modules_install \
    CONFIG_DRM_AMDGPU_SI=y \
    CONFIG_DRM_AMDGPU_CIK=y
done

# a hack for creating a dummy *.ko file that has been removed
for i in %{buildroot}/lib/modules/*/updates/drivers/gpu/drm/i2c; do
  test -f $i/ch7006.ko && \
  ln -s ch7006.ko $i/adv7511.ko
done

%changelog