> [drm:pid0:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder
> is 130
as the checksum error seems more straight-forward, following up on this myself..
but first, though somewhat separately, poking around sys/dev/pci/drm/drm_edid.c
i made a small change:
--- drm_edid.c.orig Sat Jul 12 20:42:44 2014
+++ drm_edid.c Thu Oct 9 21:03:21 2014
@@ -291,8 +291,8 @@ static bool drm_edid_is_zero(u8 *in_edid, int length)
int i;
u32 *raw_edid = (u32 *)in_edid;
- for (i = 0; i < length / 4; i++)
- if (*(raw_edid + i) != 0)
+ for (i = 0; i < length / sizeof(u32); i++)
+ if (raw_edid[i] != 0)
return false;
return true;
}
now, as to the edid issue:
On Tue, 07 Oct 2014 17:22:48 -0400 [email protected] wrote:
> thanks. that fixed the vblank_timestamp errors, and x seems to work fine.
>
> i am still getting the other error message though:
> [drm:pid0:drm_edid_block_valid] *ERROR* EDID checksum is invalid, remainder
> is 130
>
> new dmesg attached at below.
>
> On Tue, 7 Oct 2014 22:37:05 +1100
> Tue Oct 8 11:16:59 2013 +0100 Jonathan Gray <[email protected]> wrote:
> > On Tue, Oct 07, 2014 at 08:13:53AM -0400, [email protected] wrote:
> > > >Synopsis: drm giving errors, startx freezes machine
> > > >Category: kernel
> > > >Environment:
> > > System : OpenBSD 5.6
> > > Details : OpenBSD 5.6-current (GENERIC) #0: Sat Oct 4 22:36:11 EDT
> > > 2014
> > > root@node02:/usr/src/sys/arch/i386/compile/GENERIC
> > >
> > > Architecture: OpenBSD.i386
> > > Machine : i386
> > > >Description:
> > > drm giving 2 error messages (multiple times, see dmesg below):
> > > error: [drm:pid0:drm_edid_block_valid] *ERROR* EDID checksum is
> > > invalid, remainder is 130
> > > error: [drm:pid0:i915_get_vblank_timestamp] *ERROR* Invalid crtc 1
> > > these seem to have started around 5.4. 5.2 didn't give any errors, and
> > > i checked a 5.3 kernel (the last with no errors, dmesg at end)
> > >
this is essentially an empty edid:
> drm0 at inteldrm0
> error: [drm:pid0:drm_edid_block_valid] *ERROR* EDID checksum is invalid,
> remainder is 130
> Raw EDID:
>
> 00 ff ff ff ff ff ff 00 ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
> ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
the first few bytes are a valid head for a edid:
00 ff ff ff ff ff ff 00
and from what i can find, 0xff is used to fill in empty space (some edids found
online had other data at the beginning, but were all padded with 0xff)
for certain types of monitors (crt) this is always going to be reported, so:
/usr/src/sys/dev/pci/drm/drm_edid.c:
--- drm_edid.c.orig Sat Jul 12 20:42:44 2014
+++ drm_edid.c Thu Oct 9 23:35:42 2014
@@ -183,6 +183,15 @@ bool drm_edid_block_valid(u8 *raw_edid, int block, boo
}
}
+ /* before doing checksum, see if block is empty (all 0xff) */
+ for (i = 8; i < EDID_LENGTH && raw_edid[i] == 0xff; i++);
+ if (i == EDID_LENGTH) {
+ if (print_bad_edid) {
+ DRM_ERROR("EDID is empty\n");
+ }
+ return 0;
+ }
+
for (i = 0; i < EDID_LENGTH; i++)
csum += raw_edid[i];
if (csum) {
@@ -286,13 +295,27 @@ i2c_err:
return (ret);
}
+static bool drm_edid_is_empty(u8 *in_edid, int length)
+{
+ int i;
+ int *raw_edid = (int *)in_edid;
+
+ if (drm_edid_header_is_valid(in_edid) != 8)
+ return false;
+
+ for (i = 2; i < length / sizeof(int); i++)
+ if (raw_edid[i] != -1)
+ return false;
+ return true;
+}
+
static bool drm_edid_is_zero(u8 *in_edid, int length)
{
int i;
u32 *raw_edid = (u32 *)in_edid;
- for (i = 0; i < length / 4; i++)
- if (*(raw_edid + i) != 0)
+ for (i = 0; i < length / sizeof(u32); i++)
+ if (raw_edid[i] != 0)
return false;
return true;
}
@@ -313,6 +336,8 @@ drm_do_get_edid(struct drm_connector *connector, struc
goto out;
if (drm_edid_block_valid(block, 0, print_bad_edid))
break;
+ if (i == 0 && drm_edid_is_empty(block, EDID_LENGTH))
+ goto carp;
if (i == 0 && drm_edid_is_zero(block, EDID_LENGTH)) {
connector->null_edid_counter++;
goto carp;
i have this currently running and it seems to work.
when booting, instead of giving the checksum error and then printing the edid,
it just gives this (see dmesg below):
error: [drm:pid0:drm_edid_block_valid] *ERROR* EDID is empty
i was thinking of making a DRM_WARN that is a copy of DRM_ERROR to handle this
as this shouldn't really be an error, since many (old) monitors will not be
giving this data. or maybe just a printf("drm: warn: EDID is empty\n"). for
now i just want some feedback as to correctness.
the new dmesg is:
OpenBSD 5.6-current (GENERIC) #0: Thu Oct 9 23:27:40 EDT 2014
root@node02:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: Intel(R) Celeron(R) CPU 2.80GHz ("GenuineIntel" 686-class) 2.81 GHz
cpu0:
FPU,V86,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,CNXT-ID,xTPR,PERF
real mem = 527921152 (503MB)
avail mem = 506916864 (483MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 02/25/04, BIOS32 rev. 0 @ 0xfb940, SMBIOS
rev. 2.3 @ 0xf0000 (40 entries)
bios0: vendor Phoenix Technologies, LTD version "3.08" date 02/25/2004
bios0: Compaq Presario 061 DW263A-ABA S7300CL NA510
acpi at bios0 function 0x0 not configured
mpbios0 at bios0: Intel MP Specification 1.4
cpu0 at mainbus0: apid 0 (boot processor)
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 100MHz
mpbios0: bus 0 is type PCI
mpbios0: bus 1 is type PCI
mpbios0: bus 2 is type ISA
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xdbb4
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdae0/192 (10 entries)
pcibios0: PCI Exclusive IRQs: 3 5 9 10 11
pcibios0: PCI Interrupt Router at 000:31:0 ("Intel 82371SB ISA" rev 0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0xb400 0xcc000/0x8000!
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82845G Host" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82845G Video" rev 0x03
intagp0 at vga1
agp0 at intagp0: aperture at 0xd0000000, size 0x8000000
inteldrm0 at vga1
drm0 at inteldrm0
error: [drm:pid0:drm_edid_block_valid] *ERROR* EDID is empty
VGA-1: EDID block 0 invalid.
inteldrm0: 1024x768
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
uhci0 at pci0 dev 29 function 0 "Intel 82801DB USB" rev 0x02: apic 2 int 16
uhci1 at pci0 dev 29 function 1 "Intel 82801DB USB" rev 0x02: apic 2 int 19
uhci2 at pci0 dev 29 function 2 "Intel 82801DB USB" rev 0x02: apic 2 int 18
ehci0 at pci0 dev 29 function 7 "Intel 82801DB USB" rev 0x02: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb0 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0x82
pci_intr_map: bus 0 dev 30 func 0 pin 1; line 5
pci_intr_map: no MP mapping found
pci_intr_map: bus 0 dev 30 func 0 pin 2; line 3
pci_intr_map: no MP mapping found
pci_intr_map: bus 0 dev 30 func 0 pin 3; line 9
pci_intr_map: no MP mapping found
pci_intr_map: bus 0 dev 30 func 0 pin 4; line 11
pci_intr_map: no MP mapping found
pci1 at ppb0 bus 1
fxp0 at pci1 dev 9 function 0 "Intel 8255x" rev 0x05, i82558: apic 2 int 21,
address 00:90:27:1a:2b:80
inphy0 at fxp0 phy 1: i82555 10/100 PHY, rev. 0
rl0 at pci1 dev 12 function 0 "Realtek 8139" rev 0x10: apic 2 int 23, address
00:0c:76:e0:e9:bd
rlphy0 at rl0 phy 0: RTL internal PHY
ichpcib0 at pci0 dev 31 function 0 "Intel 82801DB LPC" rev 0x02: 24-bit timer
at 3579545Hz
pciide0 at pci0 dev 31 function 1 "Intel 82801DB IDE" rev 0x02: DMA, channel 0
configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 0:
wd0: 16-sector PIO, LBA48,
wd1 at pciide0 channel 0 drive 1:
wd1: 16-sector PIO, LBA,
wd0(pciide0:0:0): using PIO mode 4, Ultra-DMA mode 5
wd1(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 5
wd2 at pciide0 channel 1 drive 0:
wd2: 16-sector PIO, LBA,
atapiscsi0 at pciide0 channel 1 drive 1
scsibus1 at atapiscsi0: 2 targets
cd0 at scsibus1 targ 0 lun 0: <HP, DVD Writer 630c, AH26> ATAPI 5/cdrom
removable
wd2(pciide0:1:0): using PIO mode 0, DMA mode 1
cd0(pciide0:1:1): using PIO mode 4, Ultra-DMA mode 2
ichiic0 at pci0 dev 31 function 3 "Intel 82801DB SMBus" rev 0x02: apic 2 int 17
iic0 at ichiic0
iic0: addr 0x2f 00=01 01=07 02=01 03=00 04=07 05=00 06=08 07=00 14=14 15=62
16=03 17=02 words 00=01ff 01=07ff 02=01ff 03=00ff 04=07ff 05=00ff 06=08ff
07=00ff
spdmem0 at iic0 addr 0x50: 512MB DDR SDRAM non-parity PC2700CL2.5
auich0 at pci0 dev 31 function 5 "Intel 82801DB AC97" rev 0x02: apic 2 int 17,
ICH4 AC97
ac97: codec id 0x414c4780 (Avance Logic ALC658 rev 0)
ac97: codec features 20 bit DAC, 18 bit ADC, No 3D Stereo
audio0 at auich0
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
wbsio0 at isa0 port 0x2e/2: W83627THF rev 0x83
lm1 at wbsio0 port 0x290/8: W83627THF
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 2.88MB 80 cyl, 2 head, 36 sec
vscsi0 at root
scsibus3 at vscsi0: 256 targets
softraid0 at root
scsibus4 at softraid0: 256 targets
sd1 at scsibus4 targ 1 lun 0: <OPENBSD, SR CRYPTO, 005> SCSI2 0/direct fixed
sd1: 38161MB, 512 bytes/sector, 78155633 sectors
root on sd1a (516e5d9810b12925.a) swap on sd1b dump on sd1b
does anyone see any issues?