mirror of
git://nv-tegra.nvidia.com/tegra/kernel-src/nv-kernel-display-driver.git
synced 2025-12-24 10:41:52 +03:00
Compare commits
1 Commits
jetson_35.
...
jetson_35.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f54f1d5a5 |
@@ -1,7 +1,7 @@
|
||||
# NVIDIA Linux Open GPU Kernel Module Source
|
||||
|
||||
This is the source release of the NVIDIA Linux open GPU kernel modules,
|
||||
version 35.6.1.
|
||||
version 35.2.1.
|
||||
|
||||
|
||||
## How to Build
|
||||
@@ -17,7 +17,7 @@ as root:
|
||||
|
||||
Note that the kernel modules built here must be used with gsp.bin
|
||||
firmware and user-space NVIDIA GPU driver components from a corresponding
|
||||
35.6.1 driver release. This can be achieved by installing
|
||||
35.2.1 driver release. This can be achieved by installing
|
||||
the NVIDIA GPU driver from the .run file using the `--no-kernel-modules`
|
||||
option. E.g.,
|
||||
|
||||
@@ -72,7 +72,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
|
||||
EXTRA_CFLAGS += -I$(src)
|
||||
EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
|
||||
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
|
||||
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"35.6.1\"
|
||||
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"35.2.1\"
|
||||
|
||||
ifneq ($(SYSSRCHOST1X),)
|
||||
EXTRA_CFLAGS += -I$(SYSSRCHOST1X)
|
||||
@@ -98,7 +98,6 @@ EXTRA_CFLAGS += -ffreestanding
|
||||
|
||||
ifeq ($(ARCH),arm64)
|
||||
EXTRA_CFLAGS += -mgeneral-regs-only -march=armv8-a
|
||||
EXTRA_CFLAGS += $(call cc-option,-mno-outline-atomics,)
|
||||
endif
|
||||
|
||||
ifeq ($(ARCH),x86_64)
|
||||
@@ -227,7 +227,6 @@ static inline uid_t __kuid_val(uid_t uid)
|
||||
#endif
|
||||
|
||||
#include <linux/fb.h> /* fb_info struct */
|
||||
#include <linux/screen_info.h> /* screen_info */
|
||||
|
||||
#if !defined(CONFIG_PCI)
|
||||
#warning "Attempting to build driver for a platform with no PCI support!"
|
||||
@@ -1648,12 +1647,23 @@ extern NvBool nv_ats_supported;
|
||||
* and any other baggage we want to carry along
|
||||
*
|
||||
*/
|
||||
#define NV_MAXNUM_DISPLAY_DEVICES 8
|
||||
|
||||
typedef struct
|
||||
{
|
||||
acpi_handle dev_handle;
|
||||
int dev_id;
|
||||
} nv_video_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
nvidia_stack_t *sp;
|
||||
struct acpi_device *device;
|
||||
struct acpi_handle *handle;
|
||||
|
||||
nv_video_t pNvVideo[NV_MAXNUM_DISPLAY_DEVICES];
|
||||
|
||||
int notify_handler_installed;
|
||||
int default_display_mask;
|
||||
} nv_acpi_t;
|
||||
|
||||
#endif
|
||||
@@ -35,6 +35,8 @@ extern nvidia_module_t nv_fops;
|
||||
|
||||
void nv_acpi_register_notifier (nv_linux_state_t *);
|
||||
void nv_acpi_unregister_notifier (nv_linux_state_t *);
|
||||
int nv_acpi_init (void);
|
||||
int nv_acpi_uninit (void);
|
||||
|
||||
NvU8 nv_find_pci_capability (struct pci_dev *, NvU8);
|
||||
|
||||
@@ -47,9 +47,11 @@ extern nv_cap_t *nvidia_caps_root;
|
||||
|
||||
extern const NvBool nv_is_rm_firmware_supported_os;
|
||||
|
||||
|
||||
#include <nvi2c.h>
|
||||
#include <nvimpshared.h>
|
||||
|
||||
|
||||
#include <nv-kernel-interface-api.h>
|
||||
|
||||
/* NVIDIA's reserved major character device number (Linux). */
|
||||
@@ -312,6 +314,10 @@ typedef enum
|
||||
NV_SOC_IRQ_DPAUX_TYPE,
|
||||
NV_SOC_IRQ_GPIO_TYPE,
|
||||
NV_SOC_IRQ_HDACODEC_TYPE,
|
||||
|
||||
|
||||
|
||||
|
||||
NV_SOC_IRQ_INVALID_TYPE
|
||||
} nv_soc_irq_type_t;
|
||||
|
||||
@@ -593,9 +599,11 @@ typedef enum
|
||||
((nv)->iso_iommu_present)
|
||||
|
||||
/*
|
||||
* NVIDIA ACPI event ID to be passed into the core NVIDIA driver for
|
||||
* AC/DC event.
|
||||
* NVIDIA ACPI event IDs to be passed into the core NVIDIA
|
||||
* driver for various events like display switch events,
|
||||
* AC/battery events, etc..
|
||||
*/
|
||||
#define NV_SYSTEM_ACPI_DISPLAY_SWITCH_EVENT 0x8001
|
||||
#define NV_SYSTEM_ACPI_BATTERY_POWER_EVENT 0x8002
|
||||
|
||||
/*
|
||||
@@ -604,6 +612,14 @@ typedef enum
|
||||
#define NV_SYSTEM_GPU_ADD_EVENT 0x9001
|
||||
#define NV_SYSTEM_GPU_REMOVE_EVENT 0x9002
|
||||
|
||||
/*
|
||||
* Status bit definitions for display switch hotkey events.
|
||||
*/
|
||||
#define NV_HOTKEY_STATUS_DISPLAY_ENABLE_LCD 0x01
|
||||
#define NV_HOTKEY_STATUS_DISPLAY_ENABLE_CRT 0x02
|
||||
#define NV_HOTKEY_STATUS_DISPLAY_ENABLE_TV 0x04
|
||||
#define NV_HOTKEY_STATUS_DISPLAY_ENABLE_DFP 0x08
|
||||
|
||||
/*
|
||||
* NVIDIA ACPI sub-event IDs (event types) to be passed into
|
||||
* to core NVIDIA driver for ACPI events.
|
||||
@@ -850,9 +866,11 @@ void NV_API_CALL nv_dma_release_dma_buf (nv_dma_buf_t *);
|
||||
|
||||
void NV_API_CALL nv_schedule_uvm_isr (nv_state_t *);
|
||||
|
||||
|
||||
NvBool NV_API_CALL nv_platform_supports_s0ix (void);
|
||||
NvBool NV_API_CALL nv_s2idle_pm_configured (void);
|
||||
|
||||
|
||||
NvBool NV_API_CALL nv_is_chassis_notebook (void);
|
||||
void NV_API_CALL nv_allow_runtime_suspend (nv_state_t *nv);
|
||||
void NV_API_CALL nv_disallow_runtime_suspend (nv_state_t *nv);
|
||||
@@ -862,6 +880,7 @@ typedef void (*nvTegraDceClientIpcCallback)(NvU32, NvU32, NvU32, void *, void *)
|
||||
NV_STATUS NV_API_CALL nv_get_num_phys_pages (void *, NvU32 *);
|
||||
NV_STATUS NV_API_CALL nv_get_phys_pages (void *, void *, NvU32 *);
|
||||
|
||||
|
||||
NV_STATUS NV_API_CALL nv_i2c_transfer(nv_state_t *, NvU32, NvU8, nv_i2c_msg_t *, int);
|
||||
void NV_API_CALL nv_i2c_unregister_clients(nv_state_t *);
|
||||
NV_STATUS NV_API_CALL nv_i2c_bus_status(nv_state_t *, NvU32, NvS32 *, NvS32 *);
|
||||
@@ -906,6 +925,7 @@ void NV_API_CALL nv_dsi_panel_cleanup(nv_state_t *, void *);
|
||||
NV_STATUS NV_API_CALL nv_soc_mipi_cal_reset(nv_state_t *);
|
||||
NvU32 NV_API_CALL nv_soc_fuse_register_read (NvU32 addr);
|
||||
|
||||
|
||||
/*
|
||||
* ---------------------------------------------------------------------------
|
||||
*
|
||||
@@ -1048,6 +1068,7 @@ static inline const NvU8 *nv_get_cached_uuid(nv_state_t *nv)
|
||||
return nv->nv_uuid_cache.valid ? nv->nv_uuid_cache.uuid : NULL;
|
||||
}
|
||||
|
||||
|
||||
/* nano second resolution timer callback structure */
|
||||
typedef struct nv_nano_timer nv_nano_timer_t;
|
||||
|
||||
@@ -1058,6 +1079,7 @@ NV_STATUS NV_API_CALL rm_run_nano_timer_callback(nvidia_stack_t *, nv_state_t
|
||||
void NV_API_CALL nv_cancel_nano_timer(nv_state_t *, nv_nano_timer_t *);
|
||||
void NV_API_CALL nv_destroy_nano_timer(nv_state_t *nv, nv_nano_timer_t *);
|
||||
|
||||
|
||||
#if defined(NVCPU_X86_64)
|
||||
|
||||
static inline NvU64 nv_rdtsc(void)
|
||||
@@ -5470,6 +5470,22 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_PLATFORM_IRQ_COUNT_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
acpi_bus_get_device)
|
||||
#
|
||||
# Determine if the acpi_bus_get_device() function is present
|
||||
#
|
||||
# acpi_bus_get_device() was removed by commit ac2a3feefad5
|
||||
# ("ACPI: bus: Eliminate acpi_bus_get_device()") in
|
||||
# v5.18-rc2 (2022-04-05).
|
||||
#
|
||||
CODE="
|
||||
#include <linux/acpi.h>
|
||||
int conftest_acpi_bus_get_device(void) {
|
||||
return acpi_bus_get_device();
|
||||
}"
|
||||
compile_check_conftest "$CODE" "NV_ACPI_BUS_GET_DEVICE_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
devm_clk_bulk_get_all)
|
||||
#
|
||||
# Determine if devm_clk_bulk_get_all() function is present
|
||||
@@ -5512,106 +5528,6 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_MMGET_NOT_ZERO_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
dma_resv_add_fence)
|
||||
#
|
||||
# Determine if the dma_resv_add_fence() function is present.
|
||||
#
|
||||
# dma_resv_add_excl_fence() and dma_resv_add_shared_fence() were
|
||||
# removed and replaced with dma_resv_add_fence() by commit
|
||||
# 73511edf8b19 ("dma-buf: specify usage while adding fences to
|
||||
# dma_resv obj v7") in linux-next, expected in v5.19-rc1.
|
||||
#
|
||||
CODE="
|
||||
#if defined(NV_LINUX_DMA_RESV_H_PRESENT)
|
||||
#include <linux/dma-resv.h>
|
||||
#endif
|
||||
void conftest_dma_resv_add_fence(void) {
|
||||
dma_resv_add_fence();
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_DMA_RESV_ADD_FENCE_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
dma_resv_reserve_fences)
|
||||
#
|
||||
# Determine if the dma_resv_reserve_fences() function is present.
|
||||
#
|
||||
# dma_resv_reserve_shared() was removed and replaced with
|
||||
# dma_resv_reserve_fences() by commit c8d4c18bfbc4
|
||||
# ("dma-buf/drivers: make reserving a shared slot mandatory v4") in
|
||||
# linux-next, expected in v5.19-rc1.
|
||||
#
|
||||
CODE="
|
||||
#if defined(NV_LINUX_DMA_RESV_H_PRESENT)
|
||||
#include <linux/dma-resv.h>
|
||||
#endif
|
||||
void conftest_dma_resv_reserve_fences(void) {
|
||||
dma_resv_reserve_fences();
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_DMA_RESV_RESERVE_FENCES_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
reservation_object_reserve_shared_has_num_fences_arg)
|
||||
#
|
||||
# Determine if reservation_object_reserve_shared() has 'num_fences'
|
||||
# argument.
|
||||
#
|
||||
# reservation_object_reserve_shared() function prototype was updated
|
||||
# to take 'num_fences' argument by commit ca05359f1e64 ("dma-buf:
|
||||
# allow reserving more than one shared fence slot") in v4.21-rc1
|
||||
# (2018-12-14).
|
||||
#
|
||||
CODE="
|
||||
#include <linux/reservation.h>
|
||||
void conftest_reservation_object_reserve_shared_has_num_fences_arg(
|
||||
struct reservation_object *obj,
|
||||
unsigned int num_fences) {
|
||||
(void) reservation_object_reserve_shared(obj, num_fences);
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_RESERVATION_OBJECT_RESERVE_SHARED_HAS_NUM_FENCES_ARG" "" "types"
|
||||
;;
|
||||
|
||||
num_registered_fb)
|
||||
#
|
||||
# Determine if 'num_registered_fb' variable is present.
|
||||
#
|
||||
# 'num_registered_fb' was removed by commit 5727dcfd8486
|
||||
# ("fbdev: Make registered_fb[] private to fbmem.c) for
|
||||
# v5.20 linux-next (2022-07-27).
|
||||
#
|
||||
CODE="
|
||||
#include <linux/fb.h>
|
||||
int conftest_num_registered_fb(void) {
|
||||
return num_registered_fb;
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_NUM_REGISTERED_FB_PRESENT" "" "types"
|
||||
;;
|
||||
|
||||
drm_connector_has_override_edid)
|
||||
#
|
||||
# Determine if 'struct drm_connector' has an 'override_edid' member.
|
||||
#
|
||||
# Removed by commit 90b575f52c6ab ("drm/edid: detach debugfs EDID
|
||||
# override from EDID property update") in linux-next, expected in
|
||||
# v6.2-rc1.
|
||||
#
|
||||
CODE="
|
||||
#if defined(NV_DRM_DRM_CRTC_H_PRESENT)
|
||||
#include <drm/drm_crtc.h>
|
||||
#endif
|
||||
#if defined(NV_DRM_DRM_CONNECTOR_H_PRESENT)
|
||||
#include <drm/drm_connector.h>
|
||||
#endif
|
||||
int conftest_drm_connector_has_override_edid(void) {
|
||||
return offsetof(struct drm_connector, override_edid);
|
||||
}"
|
||||
|
||||
compile_check_conftest "$CODE" "NV_DRM_CONNECTOR_HAS_OVERRIDE_EDID" "" "types"
|
||||
;;
|
||||
|
||||
# When adding a new conftest entry, please use the correct format for
|
||||
# specifying the relevant upstream Linux kernel commit.
|
||||
#
|
||||
@@ -65,57 +65,11 @@ static inline void nv_dma_resv_fini(nv_dma_resv_t *obj)
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void nv_dma_resv_lock(nv_dma_resv_t *obj,
|
||||
struct ww_acquire_ctx *ctx)
|
||||
{
|
||||
#if defined(NV_LINUX_DMA_RESV_H_PRESENT)
|
||||
dma_resv_lock(obj, ctx);
|
||||
#else
|
||||
ww_mutex_lock(&obj->lock, ctx);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void nv_dma_resv_unlock(nv_dma_resv_t *obj)
|
||||
{
|
||||
#if defined(NV_LINUX_DMA_RESV_H_PRESENT)
|
||||
dma_resv_unlock(obj);
|
||||
#else
|
||||
ww_mutex_unlock(&obj->lock);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int nv_dma_resv_reserve_fences(nv_dma_resv_t *obj,
|
||||
unsigned int num_fences,
|
||||
NvBool shared)
|
||||
{
|
||||
#if defined(NV_DMA_RESV_RESERVE_FENCES_PRESENT)
|
||||
return dma_resv_reserve_fences(obj, num_fences);
|
||||
#else
|
||||
if (shared) {
|
||||
#if defined(NV_LINUX_DMA_RESV_H_PRESENT)
|
||||
return dma_resv_reserve_shared(obj, num_fences);
|
||||
#elif defined(NV_RESERVATION_OBJECT_RESERVE_SHARED_HAS_NUM_FENCES_ARG)
|
||||
return reservation_object_reserve_shared(obj, num_fences);
|
||||
#else
|
||||
unsigned int i;
|
||||
for (i = 0; i < num_fences; i++) {
|
||||
reservation_object_reserve_shared(obj);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline void nv_dma_resv_add_excl_fence(nv_dma_resv_t *obj,
|
||||
nv_dma_fence_t *fence)
|
||||
{
|
||||
#if defined(NV_LINUX_DMA_RESV_H_PRESENT)
|
||||
#if defined(NV_DMA_RESV_ADD_FENCE_PRESENT)
|
||||
dma_resv_add_fence(obj, fence, DMA_RESV_USAGE_WRITE);
|
||||
#else
|
||||
dma_resv_add_excl_fence(obj, fence);
|
||||
#endif
|
||||
#else
|
||||
reservation_object_add_excl_fence(obj, fence);
|
||||
#endif
|
||||
@@ -42,7 +42,6 @@
|
||||
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
#include <drm/drm_edid.h>
|
||||
|
||||
static void nv_drm_connector_destroy(struct drm_connector *connector)
|
||||
{
|
||||
@@ -99,11 +98,7 @@ __nv_drm_detect_encoder(struct NvKmsKapiDynamicDisplayParams *pDetectParams,
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(NV_DRM_CONNECTOR_HAS_OVERRIDE_EDID)
|
||||
if (connector->override_edid) {
|
||||
#else
|
||||
if (drm_edid_override_connector_update(connector) > 0) {
|
||||
#endif
|
||||
const struct drm_property_blob *edid = connector->edid_blob_ptr;
|
||||
|
||||
if (edid->length <= sizeof(pDetectParams->edid.buffer)) {
|
||||
@@ -44,8 +44,6 @@
|
||||
|
||||
#if defined(NV_LINUX_NVHOST_H_PRESENT) && defined(CONFIG_TEGRA_GRHOST)
|
||||
#include <linux/nvhost.h>
|
||||
#elif defined(NV_LINUX_HOST1X_NEXT_H_PRESENT)
|
||||
#include <linux/host1x-next.h>
|
||||
#endif
|
||||
|
||||
#if defined(NV_DRM_HAS_HDR_OUTPUT_METADATA)
|
||||
@@ -382,21 +380,6 @@ plane_req_config_update(struct drm_plane *plane,
|
||||
}
|
||||
#endif
|
||||
|
||||
if (nv_drm_plane_state->fd_user_ptr) {
|
||||
req_config->config.syncptParams.postSyncptRequested = true;
|
||||
}
|
||||
#elif defined(NV_LINUX_HOST1X_NEXT_H_PRESENT)
|
||||
if (plane_state->fence != NULL) {
|
||||
ret = host1x_fence_extract(
|
||||
plane_state->fence,
|
||||
&req_config->config.syncptParams.preSyncptId,
|
||||
&req_config->config.syncptParams.preSyncptValue);
|
||||
if (ret != 0) {
|
||||
return ret;
|
||||
}
|
||||
req_config->config.syncptParams.preSyncptSpecified = true;
|
||||
}
|
||||
|
||||
if (nv_drm_plane_state->fd_user_ptr) {
|
||||
req_config->config.syncptParams.postSyncptRequested = true;
|
||||
}
|
||||
@@ -257,6 +257,10 @@ nv_drm_init_mode_config(struct nv_drm_device *nv_dev,
|
||||
dev->mode_config.preferred_depth = 24;
|
||||
dev->mode_config.prefer_shadow = 1;
|
||||
|
||||
/* Currently unused. Update when needed. */
|
||||
|
||||
dev->mode_config.fb_base = 0;
|
||||
|
||||
#if defined(NV_DRM_CRTC_STATE_HAS_ASYNC_FLIP) || \
|
||||
defined(NV_DRM_CRTC_STATE_HAS_PAGEFLIP_FLAGS)
|
||||
dev->mode_config.async_page_flip = true;
|
||||
@@ -41,19 +41,6 @@
|
||||
#include <drm/drm_atomic_uapi.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The inclusion of drm_framebuffer.h was removed from drm_crtc.h by commit
|
||||
* 720cf96d8fecde29b72e1101f8a567a0ce99594f ("drm: Drop drm_framebuffer.h from
|
||||
* drm_crtc.h") in linux-next, expected in v5.19-rc7.
|
||||
*
|
||||
* We only need drm_framebuffer.h for drm_framebuffer_put(), and it is always
|
||||
* present (v4.9+) when drm_framebuffer_{put,get}() is present (v4.12+), so it
|
||||
* is safe to unconditionally include it when drm_framebuffer_get() is present.
|
||||
*/
|
||||
#if defined(NV_DRM_FRAMEBUFFER_GET_PRESENT)
|
||||
#include <drm/drm_framebuffer.h>
|
||||
#endif
|
||||
|
||||
static void __nv_drm_framebuffer_put(struct drm_framebuffer *fb)
|
||||
{
|
||||
#if defined(NV_DRM_FRAMEBUFFER_GET_PRESENT)
|
||||
@@ -499,18 +499,9 @@ int nv_drm_gem_fence_attach_ioctl(struct drm_device *dev,
|
||||
goto fence_context_create_fence_failed;
|
||||
}
|
||||
|
||||
nv_dma_resv_lock(&nv_gem->resv, NULL);
|
||||
nv_dma_resv_add_excl_fence(&nv_gem->resv, fence);
|
||||
|
||||
ret = nv_dma_resv_reserve_fences(&nv_gem->resv, 1, false);
|
||||
if (ret == 0) {
|
||||
nv_dma_resv_add_excl_fence(&nv_gem->resv, fence);
|
||||
} else {
|
||||
NV_DRM_DEV_LOG_ERR(
|
||||
nv_dev,
|
||||
"Failed to reserve fence. Error code: %d", ret);
|
||||
}
|
||||
|
||||
nv_dma_resv_unlock(&nv_gem->resv);
|
||||
ret = 0;
|
||||
|
||||
fence_context_create_fence_failed:
|
||||
nv_drm_gem_object_unreference_unlocked(&nv_gem_fence_context->base);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user