From owner-freebsd-x11@freebsd.org Mon Oct 29 14:16:59 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 A894810DB07A for ; Mon, 29 Oct 2018 14:16:58 +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 40BE572ECB for ; Mon, 29 Oct 2018 14:16:58 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 00CD010DB079; Mon, 29 Oct 2018 14:16:58 +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 C0D6F10DB078 for ; Mon, 29 Oct 2018 14:16:57 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) (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 3C7D972EC9; Mon, 29 Oct 2018 14:16:57 +0000 (UTC) (envelope-from johalun0@gmail.com) Received: by mail-wr1-x42a.google.com with SMTP id g9-v6so8888270wrq.4; Mon, 29 Oct 2018 07:16:57 -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=cKK6gvFXsEMS1xH7cCL3iUi8T/5GpiUFI3D5BxV0NAk=; b=ug8niEa4fhfLApTvM5sN+FUYlGWhtYJCuJFyv//kYwshu9yvcn0LVg1I5F+Iust/kw aVrJTV7+b63tIJbHFahOaINXPCu6BuwUQwBYQ8l3CmVcPeHthHxQx2L+y5kE5nhSPeER uPtDxuYpeobzAreU1QtauHKYecHFNY2mBlKCatSbJJ6etobfAitroXoNHr8s+JFaBunl Tmg0svvzBPCZd2TfGdTx60rgM3nEHvqhzqVYN9CmKJGtYhgrqn8/YsAYvXDyAnCnBYed GAu4zrdYWKy+ZQVGLlaS/Bxdz2wMHC7U4rEg/0wPvwQYK6OHLUx2ePXr6pFYT59zjJhH 7QuA== 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=cKK6gvFXsEMS1xH7cCL3iUi8T/5GpiUFI3D5BxV0NAk=; b=RU1NAVpdrUv08wQj5Nl5UbIuOGgTndMUNphV0WKf+LC/t3zW0bLW9Enek5pPU7RjRf YkCM23qDrUotB2wHcuOufYba7Vxp1TnWj96xgTRwEVRg3ZRCJE3F8NY9hKMlROy5uYQS mSDr95P95/gQ7sfAETqTCh9yLrW118t4hNVC0zIj6jrSzpeyJRKR49zoG6pnY47pQGe9 yE9PZxS31alqFu9QX793YS56WVfdpco0Fsn3t6sEpoIisCuEVJOzt0BmUmqU3+gWqsDb 9/aI15AK1dQeC51EtGeubFzhJCsn7t8Gsk/a1q6it5I6Q1Uh+ggfOc46JnoeSSGZ3cGN /7Gg== X-Gm-Message-State: AGRZ1gJvZ7BR8UYMlf8fmNx7zJRGZy8CR0pOaDanPlzVod4oEmclw+rV OksDU8xFf38oHLUBe3N8v3QRaN7z/2ift0WxwagbaTGa X-Google-Smtp-Source: AJdET5d3GyiWshZ8Q8Q9pm10hj9UywL4NxiajbxsdzfQnbv32OFpC2V5mZLN1hpbAo8YgRweSy87Gsy5dHaiKdd0K40= X-Received: by 2002:adf:93e6:: with SMTP id 93-v6mr6480823wrp.311.1540822615631; Mon, 29 Oct 2018 07:16:55 -0700 (PDT) MIME-Version: 1.0 References: <20181020212746.11710efb@kalimero.tijl.coosemans.org> In-Reply-To: From: Johannes Lundberg Date: Mon, 29 Oct 2018 14:16:18 +0000 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: Mon, 29 Oct 2018 14:16:59 -0000 Hi With regards to any drm kmod changes, can you make pull requests to our github repo? https://github.com/FreeBSDDesktop/kms-drm/tree/drm-v4.9 (for -stable) On Wed, Oct 24, 2018 at 6:56 PM Johannes Lundberg wrote: > > > 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 mm= io > 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 kee= ps >> 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 a= nd >> similar functions). This function is used in the i915 driver. The amd6= 4 >> 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 ar= e >> 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 bu= t >> 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 i= t >> 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, whil= e >> the FreeBSD AGP ai_aperture_size is in bytes, so one can't simply replac= e >> 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) >> 0mm 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 >> addr 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" >> >