Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 693704 | Differences between
and this patch

Collapse All | Expand All

(-)a/kernel/conftest.sh (+46 lines)
Lines 265-270 build_cflags() { Link Here
265
    if [ -n "$BUILD_PARAMS" ]; then
265
    if [ -n "$BUILD_PARAMS" ]; then
266
        CFLAGS="$CFLAGS -D$BUILD_PARAMS"
266
        CFLAGS="$CFLAGS -D$BUILD_PARAMS"
267
    fi
267
    fi
268
269
    # Check if gcc supports asm goto and set CC_HAVE_ASM_GOTO if it does.
270
    # Older kernels perform this check and set this flag in Kbuild, and since
271
    # conftest.sh runs outside of Kbuild it ends up building without this flag.
272
    # Starting with commit e9666d10a5677a494260d60d1fa0b73cc7646eb3 this test
273
    # is done within Kconfig, and the preprocessor flag is no longer needed.
274
275
    GCC_GOTO_SH="$SOURCES/build/gcc-goto.sh"
276
277
    if [ -f "$GCC_GOTO_SH" ]; then
278
        # Newer versions of gcc-goto.sh don't print anything on success, but
279
        # this is okay, since it's no longer necessary to set CC_HAVE_ASM_GOTO
280
        # based on the output of those versions of gcc-goto.sh.
281
        if [ `/bin/sh "$GCC_GOTO_SH" "$CC"` = "y" ]; then
282
            CFLAGS="$CFLAGS -DCC_HAVE_ASM_GOTO"
283
        fi
284
    fi
268
}
285
}
269
286
270
CONFTEST_PREAMBLE="#include \"conftest.h\"
287
CONFTEST_PREAMBLE="#include \"conftest.h\"
Lines 1521-1526 compile_test() { Link Here
1521
            compile_check_conftest "$CODE" "NV_DRM_AVAILABLE" "" "generic"
1538
            compile_check_conftest "$CODE" "NV_DRM_AVAILABLE" "" "generic"
1522
        ;;
1539
        ;;
1523
1540
1541
        drm_driver_prime_flag_present)
1542
            #
1543
            # Determine whether driver feature flag DRIVER_PRIME is present.
1544
            #
1545
            # The DRIVER_PRIME flag was added by commit 3248877ea179 (drm:
1546
            # base prime/dma-buf support (v5)) in v3.4 (2011-11-25) and is
1547
            # removed by commit 0424fdaf883a (drm/prime: Actually remove
1548
            # DRIVER_PRIME everywhere) on 2019-06-17.
1549
            #
1550
            # DRIVER_PRIME definition moved from drmP.h to drm_drv.h by
1551
            # commit 85e634bce01a (drm: Extract drm_drv.h) in v4.10
1552
            # (2016-11-14).
1553
            #
1554
            # DRIVER_PRIME define is changed to enum value by commit
1555
            # 0e2a933b02c9 (drm: Switch DRIVER_ flags to an enum) in v5.1
1556
            # (2019-01-29).
1557
            #
1558
            CODE="
1559
            #include <drm/drmP.h>
1560
            #if defined(NV_DRM_DRM_DRV_H_PRESENT)
1561
            #include <drm/drm_drv.h>
1562
            #endif
1563
            unsigned int drm_driver_prime_flag_present_conftest(void) {
1564
                return DRIVER_PRIME;
1565
            }"
1566
1567
            compile_check_conftest "$CODE" "NV_DRM_DRIVER_PRIME_FLAG_PRESENT" "" "types"
1568
        ;;
1569
1524
        proc_create_data)
1570
        proc_create_data)
1525
            #
1571
            #
1526
            # Determine if the proc_create_data() function is present.
1572
            # Determine if the proc_create_data() function is present.
(-)a/kernel/nv-drm.c (-3 / +6 lines)
Lines 156-166 static const struct file_operations nv_drm_fops = { Link Here
156
};
156
};
157
157
158
static struct drm_driver nv_drm_driver = {
158
static struct drm_driver nv_drm_driver = {
159
    .driver_features =
160
#if defined(NV_DRM_DRIVER_PRIME_FLAG_PRESENT)
161
                       DRIVER_PRIME |
162
#endif
159
#if defined(DRIVER_LEGACY) || LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
163
#if defined(DRIVER_LEGACY) || LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
160
    .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
164
                       DRIVER_LEGACY |
161
#else
162
    .driver_features = DRIVER_GEM | DRIVER_PRIME,
163
#endif
165
#endif
166
                       DRIVER_GEM,
164
    .load = nv_drm_load,
167
    .load = nv_drm_load,
165
    .unload = nv_drm_unload,
168
    .unload = nv_drm_unload,
166
    .fops = &nv_drm_fops,
169
    .fops = &nv_drm_fops,
(-)a/kernel/nvidia-modules-common.mk (-2 / +1 lines)
Lines 176-182 ifndef NV_VERBOSE Link Here
176
endif
176
endif
177
177
178
KBUILD_PARAMS += KBUILD_VERBOSE=$(NV_VERBOSE)
178
KBUILD_PARAMS += KBUILD_VERBOSE=$(NV_VERBOSE)
179
KBUILD_PARAMS += -C $(KERNEL_SOURCES) SUBDIRS=$(PWD)
179
KBUILD_PARAMS += -C $(KERNEL_SOURCES) M=$(PWD)
180
KBUILD_PARAMS += ARCH=$(ARCH)
180
KBUILD_PARAMS += ARCH=$(ARCH)
181
181
182
#
182
#
183
- 

Return to bug 693704