mirror of
https://github.com/torvalds/linux.git
synced 2026-07-28 10:09:10 +02:00
drm/i915/mchbar: Provide intel_mchbar_read*() abstraction
MCHBAR registers are a bit special in that:
- we access them through the mirror
- the mirror is read only on HSW+
- the mirror requires the actual MCHBAR to be enabled in device 0:0.0
- the mirror is gone on MTL+
So I'd prefer to treat MCHBAR registers as a bit special in
the code as well, and do all accesses to them via dedicated
functions. Prodive such functions in the form of
intel_mchbar_read*().
v2: Put the function arguments on one line
No intel_uncore_read64() on xe, use intel_uncore_read64_2x32()
Name the new function intel_mchbar_read64_2x32() as well
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patch.msgid.link/20260331154259.24600-3-ville.syrjala@linux.intel.com
This commit is contained in:
parent
bf64bcf4ba
commit
81dbca7188
|
|
@ -295,6 +295,7 @@ i915-y += \
|
|||
display/intel_link_bw.o \
|
||||
display/intel_load_detect.o \
|
||||
display/intel_lpe_audio.o \
|
||||
display/intel_mchbar.o \
|
||||
display/intel_modeset_lock.o \
|
||||
display/intel_modeset_setup.o \
|
||||
display/intel_modeset_verify.o \
|
||||
|
|
|
|||
30
drivers/gpu/drm/i915/display/intel_mchbar.c
Normal file
30
drivers/gpu/drm/i915/display/intel_mchbar.c
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
// SPDX-License-Identifier: MIT
|
||||
/*
|
||||
* Copyright © 2026 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "intel_display_core.h"
|
||||
#include "intel_mchbar.h"
|
||||
#include "intel_uncore.h"
|
||||
|
||||
u16 intel_mchbar_read16(struct intel_display *display, i915_reg_t reg)
|
||||
{
|
||||
struct intel_uncore *uncore = to_intel_uncore(display->drm);
|
||||
|
||||
return intel_uncore_read16(uncore, reg);
|
||||
}
|
||||
|
||||
u32 intel_mchbar_read(struct intel_display *display, i915_reg_t reg)
|
||||
{
|
||||
struct intel_uncore *uncore = to_intel_uncore(display->drm);
|
||||
|
||||
return intel_uncore_read(uncore, reg);
|
||||
}
|
||||
|
||||
u64 intel_mchbar_read64_2x32(struct intel_display *display, i915_reg_t reg)
|
||||
{
|
||||
struct intel_uncore *uncore = to_intel_uncore(display->drm);
|
||||
i915_reg_t upper_reg = _MMIO(i915_mmio_reg_offset(reg) + 4);
|
||||
|
||||
return intel_uncore_read64_2x32(uncore, reg, upper_reg);
|
||||
}
|
||||
19
drivers/gpu/drm/i915/display/intel_mchbar.h
Normal file
19
drivers/gpu/drm/i915/display/intel_mchbar.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
/* SPDX-License-Identifier: MIT */
|
||||
/*
|
||||
* Copyright © 2026 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef __INTEL_MCHBAR_H__
|
||||
#define __INTEL_MCHBAR_H__
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#include "i915_reg_defs.h"
|
||||
|
||||
struct intel_display;
|
||||
|
||||
u16 intel_mchbar_read16(struct intel_display *display, i915_reg_t reg);
|
||||
u32 intel_mchbar_read(struct intel_display *display, i915_reg_t reg);
|
||||
u64 intel_mchbar_read64_2x32(struct intel_display *display, i915_reg_t reg);
|
||||
|
||||
#endif /* __INTEL_MCHBAR_H__ */
|
||||
|
|
@ -304,6 +304,7 @@ xe-$(CONFIG_DRM_XE_DISPLAY) += \
|
|||
i915-display/intel_link_bw.o \
|
||||
i915-display/intel_lspcon.o \
|
||||
i915-display/intel_lt_phy.o \
|
||||
i915-display/intel_mchbar.o \
|
||||
i915-display/intel_modeset_lock.o \
|
||||
i915-display/intel_modeset_setup.o \
|
||||
i915-display/intel_modeset_verify.o \
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user