From owner-freebsd-x11@freebsd.org Wed Oct 24 17:56:51 2018 Return-Path: Delivered-To: freebsd-x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F6B4FFF403 for ; Wed, 24 Oct 2018 17:56:51 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id D5636718AD for ; Wed, 24 Oct 2018 17:56:50 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 97131FFF3F6; Wed, 24 Oct 2018 17:56:50 +0000 (UTC) Delivered-To: x11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3BE09FFF3EF for ; Wed, 24 Oct 2018 17:56:50 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4972718A1; Wed, 24 Oct 2018 17:56:49 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-wr1-x435.google.com with SMTP id r10-v6so5667430wrv.6; Wed, 24 Oct 2018 10:56:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CJix3qOT6yR87R4YfvQ93MbWHprIODM84TuAX36OOOY=; b=cIMapPP7lguJEVwZgp+pJrBllCsV1P+G9x/W2JanVWIgdhnxAxsXUFac7mKgqqJIfN 42uqehsEOv1PXTwcEFgI+9GVkvVBL7Vu20BrfNYekA0PSQ3DTSLOalmJc6dgpOEO0I0J gTVl6SWbXz1RbwCFuyy6F1artRyty8hbQwfKOStkOsZ7cIKgkd9Uaxl6nEJQK5tqQKZJ SA3pDNk4mb0J8SdEW+wQ0KNyOGGdRIopjDkvmlxvrtv+KJ446eRRnUWv1ToXkfThjmgB CJ0Nc0GeMRG58nxLq3ajuF1TwJYsRJp/NOfdeFQGy3DMsrnAHI5bgcXKtkRHs1qO0Aaz /riw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CJix3qOT6yR87R4YfvQ93MbWHprIODM84TuAX36OOOY=; b=tHpPVpH5HThwwjL8cjkhOsNM/PBIC1V27sBYpdg68sWqKEaj0r9b2QTVOIpU8MYwCp 0Q1Nmcq61iH2uBUxHjEddNy+dCM/LNzmWkgozxkdLhJuvEdCcM4+57O+fFkK5i0mSOef 6ixs0vBKcLmtD4/vIUBlxxuw182UVVPP/QP+7qnXi3otl8kcjOUQ9pm/f+oLtOBG6Inr lzLwrAicne/iUK0nJKWBo3a+Dn2E43ukgSlMHoxVlwBHp/nvk+hzCQwEBGdXoaj2mvcK vax5akU2HREawnUiY/P3DwqWYc+SNe1j9NwTAHL1Z0DQ8JaBsbdLdnVRiuxsr0anZTHp 4e2Q== X-Gm-Message-State: AGRZ1gK6OgOM9djPBvJL8XDLi6vCktWPuBfLyfA8BSKT+SW8SxLEO6SC dNEmrPdlnirlwOHbd03G9N+kKLjOVFETbDZRAurkrQ== X-Google-Smtp-Source: AJdET5cuI9chsonA1t2vSU2F4PbahNwgxCKrIQGKB2n+2i6xVek5v/K45Hdt8zBBYIVFf1VXTQxj7MU1Bf8zDjwau3U= X-Received: by 2002:a5d:620b:: with SMTP id y11-v6mr775472wru.105.1540403808218; Wed, 24 Oct 2018 10:56:48 -0700 (PDT) MIME-Version: 1.0 References: <20181020212746.11710efb@kalimero.tijl.coosemans.org> In-Reply-To: <20181020212746.11710efb@kalimero.tijl.coosemans.org> From: Johannes Lundberg Date: Wed, 24 Oct 2018 18:56:37 +0100 Message-ID: Subject: Re: [patch] drm-stable-kmod on i386 To: =?UTF-8?Q?T=C4=B3l_Coosemans?= Cc: x11@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2018 17:56:51 -0000 On Sat, Oct 20, 2018 at 20:29 T=C4=B3l Coosemans wrote: > Hi, > > Attached are two patches, one for base and one for ports, that make > graphics/drm-stable-kmod mostly working on i386. I tested on an old > laptop from 2004 with ATI Radeon 9600 AGP (RV350) (dmesg below). Two > issues remain: > > 1) [drm:radeon_device_init] Unable to find PCI I/O BAR > > In the base system radeon_device_init allocates this BAR. In > drm-stable-kmod this code is missing. The linux code is there but > ifdef'ed out. This doesn't seem to affect my device, but looking at > the code it may be needed by slightly less older hardware. Hi The driver falls back to using MMIO which is clarified in logs in newer drm driver version. ioread/iowrite functions in linuxkpi only supports mmio at this time. > > 2) [drm:radeon_vga_detect] VGA-1: probed a monitor but no|invalid EDID > > The driver seems to think a monitor is connected to the VGA port and keep= s > probing it. Sometimes this causes the lcd (LVDS) to flicker. Another > side effect appears to be that X creates a wide virtual screen with size > 2304x800 according to xrandr while the lcd size is 1280x800. > > > drm-i386-base.patch: > > Add readq to sys/compat/linuxkpi/common/include/linux/io.h (like readl an= d > similar functions). This function is used in the i915 driver. The amd64 > build currently picks up the definition in sys/amd64/include/cpufunc.h. > On i386 cpufunc.h doesn't define readq because there's no 64 bit load > instruction. Linux doesn't define readq on i386 either and if readq > isn't defined drm_os_linux.h defines it as (readl(addr)|read(addr+4)<<32)= . > This isn't atomic of course and I think the order in which both words are > read by the cpu isn't guaranteed either. A comment in the i915 code > indicates the developers are aware of that. > > So, I defined it as (*(volatile uint64_t *)addr). This is ok for drm but > this is a generic linuxkpi header so I'm not sure this patch is correct. > I think it would be better to define readq in this header only for amd64 > (and as a macro instead of a function), and then, if undefined, define it > in drm_os_freebsd.h as (*(volatile uint64_t *)addr). > > It would be nice to sort this out before the 12.0 release. > > > drm-i386-ports.patch: > > port Makefile: > Allow building on i386 but comment out the amdgpu driver which is only > built on amd64. > > patch-drm-drm_bufs.c: > Use ai_aperture_size correctly. The Linux AGP aper_size is in MiB, while > the FreeBSD AGP ai_aperture_size is in bytes, so one can't simply replace > aper_size with ai_aperture_size. > Also fix a compiler error about incompatible pointer types. > > patch-drm-drm_os_config.h: > Only define COMPAT_FREEBSD32 on amd64. > > patch-drm-drm_pci.c: > Use ai_aperture_size correctly. > Tell the VM system that addresses in the AGP aperture are valid. The > base system drm2 code does this in radeon_device_init, but > drm_pci_agp_init looks like a better place. > > patch-i915-i915_gem.c: > Incompatible pointer type fixes. > > patch-linuxkpi-gplv2-include-asm-processor.h: > Hide redefinitions of mb, wmb and rmb. The compiler didn't complain on > amd64 because these definitions are exactly the same as the ones in > machine/atomic.h, but that's not the case on i386. > > patch-linuxkpi-gplv2-src-linux_notifier.c: > Incompatible pointer type fix. > > patch-linuxkpi-gplv2-src-linux_page.c: > The i386 code in this file needs . > > patch-radeon-radeon_agp.c: > Use ai_aperture_size correctly. > > > xrandr: > Screen 0: minimum 320 x 200, current 2304 x 800, maximum 4096 x 4096 > LVDS connected 1280x800+0+0 (normal left inverted right x axis y axis) 0m= m > x 0mm > 1280x800 59.97*+ > 1280x720 59.86 > 1152x768 59.78 > 1024x768 59.92 > 800x600 59.86 > 848x480 59.66 > 720x480 59.71 > 640x480 59.38 > VGA-0 disconnected 1024x768+1280+0 (normal left inverted right x axis y > axis) 0mm x 0mm > S-video disconnected (normal left inverted right x axis y axis) > 1024x768 (0x5d) 65.000MHz -HSync -VSync > h: width 1024 start 1048 end 1184 total 1344 skew 0 clock > 48.36KHz > v: height 768 start 771 end 777 total 806 clock > 60.00Hz > > > dmesg: > [drm] Initialized > [drm] radeon kernel modesetting enabled. > drmn0: on vgapci0 > vgapci0: child drmn0 requested pci_enable_io > vgapci0: child drmn0 requested pci_enable_io > [drm] initializing kernel modesetting (RV350 0x1002:0x4E50 0x1043:0x1772 > 0x00). > [drm] register mmio base: 0xFF8F0000 > [drm] register mmio size: 65536 > [drm:radeon_device_init] Unable to find PCI I/O BAR > drmn0: GTT: 256M 0xE0000000 - 0xEFFFFFFF > [drm] Generation 2 PCI interface, using max accessible memory > drmn0: VRAM: 128M 0x00000000D0000000 - 0x00000000D7FFFFFF (64M used) > [drm] Detected VRAM RAM=3D128M, BAR=3D128M > [drm] RAM width 128bits DDR > Zone kernel: Available graphics memory: 517482 kiB > [TTM] Initializing pool allocator > [drm] radeon: 64M of VRAM memory ready > [drm] radeon: 256M of GTT memory ready. > [drm] radeon: 1 quad pipes, 1 Z pipes initialized. > drmn0: WB disabled > drmn0: fence driver on ring 0 use gpu addr 0x00000000e0000000 and cpu add= r > 0x0x13d96000 > [drm] Supports vblank timestamp caching Rev 2 (21.10.2013). > [drm] Driver supports precise vblank timestamp query. > [drm] radeon: irq initialized. > [drm] Loading R300 Microcode > radeon/R300_cp.bin: could not load firmware image, error 2 > radeon/R300_cp.bin: could not load firmware image, error 2 > [drm] radeon: ring at 0x00000000E0001000 > [drm] ring test succeeded in 1 usecs > [drm] ib test succeeded in 0 usecs > [drm] hw_i2c forced on, you may experience display detection problems! > [drm] Connector VGA-1: get mode from tunables: > [drm] - kern.vt.fb.modes.VGA-1 > [drm] - kern.vt.fb.default_mode > [drm] Panel ID String: Samsung LTN154X1 WXGA > [drm] Panel Size 1280x800 > [drm] Connector LVDS-1: get mode from tunables: > [drm] - kern.vt.fb.modes.LVDS-1 > [drm] - kern.vt.fb.default_mode > [drm] Connector SVIDEO-1: get mode from tunables: > [drm] - kern.vt.fb.modes.SVIDEO-1 > [drm] - kern.vt.fb.default_mode > [drm] Radeon Display Connectors > [drm] Connector 0: > [drm] VGA-1 > [drm] DDC: 0x60 0x60 0x60 0x60 0x60 0x60 0x60 0x60 > [drm] Encoders: > [drm] CRT1: INTERNAL_DAC1 > [drm] Connector 1: > [drm] LVDS-1 > [drm] Encoders: > [drm] LCD1: INTERNAL_LVDS > [drm] Connector 2: > [drm] SVIDEO-1 > [drm] Encoders: > [drm] TV1: INTERNAL_DAC2 > [drm] fb mappable at 0xD0040000 > [drm] vram apper at 0xD0000000 > [drm] size 4096000 > [drm] fb depth is 24 > [drm] pitch is 5120 > VT: Replacing driver "vga" with new "fb". > start FB_INFO: > type=3D11 height=3D800 width=3D1280 depth=3D32 > cmsize=3D16 size=3D4096000 > pbase=3D0xd0040000 vbase=3D0x6814000 > name=3Ddrmn0 flags=3D0x0 stride=3D5120 bpp=3D32 > cmap[0]=3D0 cmap[1]=3D7f0000 cmap[2]=3D7f00 cmap[3]=3Dc4a000 > end FB_INFO > drmn0: fb0: radeondrmfb frame buffer device > [drm] Initialized radeon 2.48.0 20080528 for drmn on minor 0 > Raw EDID: > ff ff ff bf ff ff ff fd ff ff ff ff ff ef ff ff > ff ff ff ff ff ff ff fd ff ff ff ff ff ff ff ff > ff ff ff ff ff ff ff fb ff ff ff ff ff df 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 bf > 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 > bf ff ff ff ff ff ff ff ff ff ef ff ff ff ff ff > [drm:drm_edid_block_valid] EDID checksum is invalid, remainder is 189 > Raw EDID: > 00 ff ff ff ff ff ff 00 ff ff ff ff ff ff ff fd > ff ff ff ff ff ff ff ff fe ff ff ff ff ff f7 ff > ff ff ff ff bf ff ff ff ff ff ff ff ff ff ff ff > ff ff ff ff ff ff ff f7 ff ff ff ff ff bf ff ff > ff fd ff ff ff ff ff ff ff ff ff ff ff ff ff ff > ff ff ff ff ff ff bf ff ff ff ff ff ff ff ff ff > ff ff ff ff ff ff ff ff a1 ff ff 7f ff ef ff ff > ff ff ff ff ff ff ff ff fd ff ff ff ff ff ff ff > Raw EDID: > ff ff 7f ff ff ff fb ff ff ff ff ff ff ff ff ff > ff ff ff ff ff ff ff ff ff ff ff 7f ff ff ff fb > ff ff ff ff ff df ff ff ff ff ff ff ff ff ff ff > ff ff ff ff 7f ff ff ff ff ff ff ff ff ff ff ff > ff ff ff ff ff ff df ff ff ff fe ff ff ff ff a1 > ff ff 7f ff ff ff ff ff ff ff ff ff df ff ff ff > fe ff ff ff ff ff f7 ff ff ff ff ff ff ff ff fb > ff ff ff ff ff ff ff ff ff fe ff ff ff ff ff ff > [drm:drm_edid_block_valid] EDID checksum is invalid, remainder is 15 > Raw EDID: > 00 ff ff ff ff ff ff 00 ff ff ff ff ff ff ff ff > fe ff ff ff ff ff ff ff ff ff ff ff bf ff ff ff > ff ff ff ff ff df ff ff ff ff ff ff ff ff ff ff > ff ff ff ff 7f ff ff ff a1 ff ff ff ff ff ff ff > ff ff ff ff ff ff ff ff ff ff 7f ff ff ff fb ff > ff ff ff ff ff ff ff ff ff ff ff ff ff ef ff ff > ff ff ff ff ff ff ff ff ff ff ff ff ff df ff ff > ff ff ff ff ff ff ff ff ff ff ff ff 7f ff ff ff > drmn0: VGA-1: EDID block 0 invalid. > [drm:radeon_vga_detect] VGA-1: probed a monitor but no|invalid EDID > [drm:radeon_vga_detect] VGA-1: probed a monitor but no|invalid EDID > [drm:radeon_vga_detect] VGA-1: probed a monitor but no|invalid EDID > _______________________________________________ > freebsd-x11@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-x11 > To unsubscribe, send any mail to "freebsd-x11-unsubscribe@freebsd.org" >