Re: Force Probing Intel GPU

2023-09-28 Thread Jonathan Gray
On Thu, Sep 28, 2023 at 11:23:03AM +, Gökhan Özdemir wrote:
> Hello,
> 
> I have an Intel Arc A770 which requires force probe kernel parameter 
> (i915.force_probe=56a0) on linux 6.1. Since current drm stack on OpenBSD is 
> 6.1, I am looking for a way to find OpenBSD equivalent of force probe.
> 
> I am running -current and manually installed inteldrm firmware via fw_update

Matching isn't the whole problem.

The dg2 cards take paths that are not fully implemented:
https://marc.info/?l=openbsd-tech=2=1=dg2=b



Force Probing Intel GPU

2023-09-28 Thread Gökhan Özdemir
Hello,

I have an Intel Arc A770 which requires force probe kernel parameter 
(i915.force_probe=56a0) on linux 6.1. Since current drm stack on OpenBSD is 
6.1, I am looking for a way to find OpenBSD equivalent of force probe.

I am running -current and manually installed inteldrm firmware via fw_update

Methods i have tried so far:

Index: autoconf.h
===
RCS file: /cvs/src/sys/dev/pci/drm/include/generated/autoconf.h,v
retrieving revision 1.10
diff -u -p -r1.10 autoconf.h
--- autoconf.h 3 Oct 2022 10:07:01 - 1.10
+++ autoconf.h 28 Sep 2023 12:14:45 -
@@ -27,7 +27,7 @@
 #define CONFIG_DRM_I915_STOP_TIMEOUT 100 /* ms */
 #define CONFIG_DRM_I915_FENCE_TIMEOUT 1 /* ms */
 #define CONFIG_DRM_I915_USERFAULT_AUTOSUSPEND 250 /* ms */
-#define CONFIG_DRM_I915_FORCE_PROBE ""
+#define CONFIG_DRM_I915_FORCE_PROBE "*,56a0"
 #ifdef __HAVE_ACPI
 #include "acpi.h"

also tried different combinations like "*" , "56a0", "56a0,56a1,56a5,56a6" and 
built kernel but no luck.

modified functions where it checks if device is forced or blocked.

Index: i915_pci.c
===
RCS file: /cvs/src/sys/dev/pci/drm/i915/i915_pci.c,v
retrieving revision 1.19
diff -u -p -r1.19 i915_pci.c
--- i915_pci.c 15 Jun 2023 02:46:22 - 1.19
+++ i915_pci.c 28 Sep 2023 12:13:37 -
@@ -1293,12 +1293,12 @@ static bool device_id_in_list(u16 device
 static bool id_forced(u16 device_id)
 {
- return device_id_in_list(device_id, i915_modparams.force_probe, false);
+ return true;
 }
 static bool id_blocked(u16 device_id)
 {
- return device_id_in_list(device_id, i915_modparams.force_probe, true);
+ return false;
 }
 bool i915_pci_resource_valid(struct pci_dev *pdev, int bar)
still, no luck.

As last resort, removed require_force_probe definition on dg2_info

Index: i915_pci.c
===
RCS file: /cvs/src/sys/dev/pci/drm/i915/i915_pci.c,v
retrieving revision 1.19
diff -u -p -r1.19 i915_pci.c
--- i915_pci.c 15 Jun 2023 02:46:22 - 1.19
+++ i915_pci.c 28 Sep 2023 12:22:00 -
@@ -1078,7 +1078,6 @@ static const struct intel_device_info dg
 XE_LPD_FEATURES,
 .__runtime.cpu_transcoder_mask = BIT(TRANSCODER_A) | BIT(TRANSCODER_B) |
 BIT(TRANSCODER_C) | BIT(TRANSCODER_D),
- .require_force_probe = 1,
 };
 static const struct intel_device_info ats_m_info = {

with this change, gpu gets registered as inteldrm but falls back to efifb with 
error

pci3 at ppb2 bus 3
inteldrm0 at pci3 dev 0 function 0 "Intel Arc A770" rev 0x08
drm0 at inteldrm0
inteldrm0: msi, DG2, gen 12
xehp_load_dss_mask: stub
xehp_load_dss_mask: stub
intel_slicemask_from_xehp_dssmask: stub
intel_slicemask_from_xehp_dssmask: stub
init_stolen_lmem: stub
drm:pid0:intel_memory_regions_hw_probe *ERROR* [drm] *ERROR* Failed to setup 
region(-78) type=3
Device initialization failed (-78)
efifb0 at mainbus0: 1920x1080, 32bpp

dmesgs for both unmodified kernel and modified kernel are in attachment

Thanks for any help!

- Gökhan
real mem = 34122215424 (32541MB)
avail mem = 33068335104 (31536MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 3.4 @ 0x79d2a000 (118 entries)
bios0: vendor American Megatrends Inc. version "2611" date 08/11/2023
bios0: ASUS PRIME Z690-P D4
efi0 at bios0: UEFI 2.8
efi0: American Megatrends rev 0x5001b
acpi0 at bios0: ACPI 6.4
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP MCFG FIDT SSDT SSDT SSDT SSDT HPET APIC MCFG SSDT NHLT 
LPIT SSDT SSDT DBGP DBG2 SSDT DMAR FPDT SSDT SSDT SSDT BGRT WPBT TPM2 PHAT WSMT
acpi0: wakeup devices PEG1(S4) PEGP(S4) PEGP(S4) PEG0(S4) PEGP(S4) RP09(S4) 
PXSX(S4) RP10(S4) PXSX(S4) RP11(S4) PXSX(S4) RP12(S4) PXSX(S4) RP13(S4) 
PXSX(S4) RP14(S4) [...]
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimcfg0 at acpi0
acpimcfg0: addr 0xc000, bus 0-255
acpihpet0 at acpi0: 1920 Hz
acpimadt0 at acpi0 addr 0xfee0: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: 12th Gen Intel(R) Core(TM) i5-12600KF, 5002.58 MHz, 06-97-02, patch 
002e
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,PCLMUL,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,SDBG,FMA3,CX16,xTPR,PDCM,PCID,SSE4.1,SSE4.2,x2APIC,MOVBE,POPCNT,DEADLINE,AES,XSAVE,AVX,F16C,RDRAND,NXE,PAGE1GB,RDTSCP,LONG,LAHF,ABM,3DNOWP,PERF,ITSC,FSGSBASE,TSC_ADJUST,BMI1,AVX2,SMEP,BMI2,ERMS,INVPCID,RDSEED,ADX,SMAP,CLFLUSHOPT,CLWB,PT,SHA,UMIP,PKU,WAITPKG,PKS,MD_CLEAR,IBT,IBRS,IBPB,STIBP,L1DF,SSBD,SENSOR,ARAT,IBRS_ALL,SKIP_L1DFL,MDS_NO,IF_PSCHANGE,TAA_NO,MISC_PKG_CT,ENERGY_FILT,DOITM,SBDR_SSDP_N,FBSDP_NO,PSDP_NO,RRSBA,OVERCLOCK,XSAVEOPT,XSAVEC,XGETBV1,XSAVES
cpu0: 48KB 64b/line 12-way D-cache, 32KB 64b/line 8-way I-cache, 1MB 64b/line 
10-way L2 cache, 20MB 64b/line 10-way L3 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 10 var