Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Oct 2018 21:27:46 +0200
From:      =?UTF-8?B?VMSzbA==?= Coosemans <tijl@FreeBSD.org>
To:        x11@FreeBSD.org
Subject:   [patch] drm-stable-kmod on i386
Message-ID:  <20181020212746.11710efb@kalimero.tijl.coosemans.org>

next in thread | raw e-mail | index | archive | help
--MP_/vwU3LoEXpmqH5K/mng91iP7
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

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.

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 keeps
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 and
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 <sys/sf_buf.h>.

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: <drmn> 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=128M, BAR=128M
[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=11 height=800 width=1280 depth=32
cmsize=16 size=4096000
pbase=0xd0040000 vbase=0x6814000
name=drmn0 flags=0x0 stride=5120 bpp=32
cmap[0]=0 cmap[1]=7f0000 cmap[2]=7f00 cmap[3]=c4a000
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

--MP_/vwU3LoEXpmqH5K/mng91iP7
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=drm-i386-base.patch

Index: sys/compat/linuxkpi/common/include/linux/io.h
===================================================================
--- sys/compat/linuxkpi/common/include/linux/io.h	(revision 338993)
+++ sys/compat/linuxkpi/common/include/linux/io.h	(working copy)
@@ -186,6 +186,13 @@ readl(const volatile void *addr)
 	return *(const volatile uint32_t *)addr;
 }
 
+#undef readq
+static inline uint64_t
+readq(const volatile void *addr)
+{
+	return *(const volatile uint64_t *)addr;
+}
+
 #if defined(__i386__) || defined(__amd64__)
 static inline void
 _outb(u_char data, u_int port)

--MP_/vwU3LoEXpmqH5K/mng91iP7
Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=drm-i386-ports.patch

Index: graphics/drm-stable-kmod/Makefile
===================================================================
--- graphics/drm-stable-kmod/Makefile	(revision 482344)
+++ graphics/drm-stable-kmod/Makefile	(working copy)
@@ -11,8 +11,8 @@ COMMENT=	DRM modules for the linuxkpi-based KMS compon
 LICENSE=	BSD2CLAUSE MIT GPLv2
 LICENSE_COMB=	multi
 
-ONLY_FOR_ARCHS=	amd64
-ONLY_FOR_ARCHS_REASON=	the new KMS components are only supported on amd64
+ONLY_FOR_ARCHS=	amd64 i386
+ONLY_FOR_ARCHS_REASON=	the new KMS components are only supported on amd64 and i386
 
 RUN_DEPENDS=	gpu-firmware-kmod>=g20180319:graphics/gpu-firmware-kmod
 
@@ -37,6 +37,12 @@ IGNORE=		not supported on older CURRENT, no kernel sup
 .endif
 .if ${OPSYS} != FreeBSD
 IGNORE=		not supported on anything but FreeBSD (missing linuxkpi functionality)
+.endif
+
+.if ${ARCH} == amd64
+PLIST_SUB+=	AMDGPU=""
+.else
+PLIST_SUB+=	AMDGPU="@comment "
 .endif
 
 .include <bsd.port.mk>
Index: graphics/drm-stable-kmod/files/patch-drm-drm_bufs.c
===================================================================
--- graphics/drm-stable-kmod/files/patch-drm-drm_bufs.c	(nonexistent)
+++ graphics/drm-stable-kmod/files/patch-drm-drm_bufs.c	(working copy)
@@ -0,0 +1,28 @@
+--- drm/drm_bufs.c.orig	2018-08-22 13:20:50 UTC
++++ drm/drm_bufs.c
+@@ -40,7 +40,6 @@
+ #include <drm/drmP.h>
+ 
+ #include "drm_legacy.h"
+-#define aper_size ai_aperture_size
+ 
+ static struct drm_map_list *drm_find_matching_map(struct drm_device *dev,
+ 						  struct drm_local_map *map)
+@@ -278,7 +277,7 @@ static int drm_addmap_core(struct drm_device * dev, re
+ 		 */
+ 		if (map->offset < dev->agp->base ||
+ 		    map->offset > dev->agp->base +
+-		    dev->agp->agp_info.aper_size * 1024 * 1024 - 1) {
++		    dev->agp->agp_info.ai_aperture_size - 1) {
+ 			map->offset += dev->agp->base;
+ 		}
+ 		map->mtrr = dev->agp->agp_mtrr;	/* for getmap */
+@@ -1451,7 +1450,7 @@ int drm_legacy_mapbufs(struct drm_device *dev, void *d
+ 	struct drm_device_dma *dma = dev->dma;
+ 	int retcode = 0;
+ 	const int zero = 0;
+-	unsigned long virtual;
++	vm_offset_t virtual;
+ 	unsigned long address;
+ 	struct vmspace *vms;
+ 	struct drm_buf_map *request = data;

Property changes on: graphics/drm-stable-kmod/files/patch-drm-drm_bufs.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: graphics/drm-stable-kmod/files/patch-drm-drm_os_config.h
===================================================================
--- graphics/drm-stable-kmod/files/patch-drm-drm_os_config.h	(nonexistent)
+++ graphics/drm-stable-kmod/files/patch-drm-drm_os_config.h	(working copy)
@@ -0,0 +1,12 @@
+--- drm/drm_os_config.h.orig	2018-08-22 13:20:50 UTC
++++ drm/drm_os_config.h
+@@ -2,7 +2,9 @@
+ #define DRM_OS_CONFIG_H_ 
+ 
+ #define CONFIG_DEBUG_FS 1
++#ifdef __amd64__
+ #define COMPAT_FREEBSD32 1
++#endif
+ #ifdef COMPAT_FREEBSD32
+ #define CONFIG_COMPAT 1
+ #endif

Property changes on: graphics/drm-stable-kmod/files/patch-drm-drm_os_config.h
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: graphics/drm-stable-kmod/files/patch-drm-drm_pci.c
===================================================================
--- graphics/drm-stable-kmod/files/patch-drm-drm_pci.c	(nonexistent)
+++ graphics/drm-stable-kmod/files/patch-drm-drm_pci.c	(working copy)
@@ -0,0 +1,41 @@
+--- drm/drm_pci.c.orig	2018-08-22 13:20:50 UTC
++++ drm/drm_pci.c
+@@ -30,9 +30,6 @@
+ #include "drm_internal.h"
+ #include "drm_legacy.h"
+ 
+-#define aper_base ai_aperture_base
+-#define aper_size ai_aperture_size
+-
+ static void
+ drm_pci_busdma_callback(void *arg, bus_dma_segment_t *segs, int nsegs, int error)
+ {
+@@ -217,10 +214,14 @@ static void drm_pci_agp_init(struct drm_device *dev)
+ 		if (drm_pci_device_is_agp(dev))
+ 			dev->agp = drm_agp_init(dev);
+ 		if (dev->agp) {
++			vm_phys_fictitious_reg_range(
++			    dev->agp->agp_info.ai_aperture_base,
++			    dev->agp->agp_info.ai_aperture_base +
++			    dev->agp->agp_info.ai_aperture_size,
++			    VM_MEMATTR_WRITE_COMBINING);
+ 			dev->agp->agp_mtrr = arch_phys_wc_add(
+-				dev->agp->agp_info.aper_base,
+-				dev->agp->agp_info.aper_size *
+-				1024 * 1024);
++				dev->agp->agp_info.ai_aperture_base,
++				dev->agp->agp_info.ai_aperture_size);
+ 		}
+ 	}
+ }
+@@ -229,6 +230,10 @@ void drm_pci_agp_destroy(struct drm_device *dev)
+ {
+ 	if (dev->agp) {
+ 		arch_phys_wc_del(dev->agp->agp_mtrr);
++		vm_phys_fictitious_unreg_range(
++		    dev->agp->agp_info.ai_aperture_base,
++		    dev->agp->agp_info.ai_aperture_base +
++		    dev->agp->agp_info.ai_aperture_size);
+ 		drm_legacy_agp_clear(dev);
+ 		kfree(dev->agp);
+ 		dev->agp = NULL;

Property changes on: graphics/drm-stable-kmod/files/patch-drm-drm_pci.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: graphics/drm-stable-kmod/files/patch-i915-i915_gem.c
===================================================================
--- graphics/drm-stable-kmod/files/patch-i915-i915_gem.c	(nonexistent)
+++ graphics/drm-stable-kmod/files/patch-i915-i915_gem.c	(working copy)
@@ -0,0 +1,20 @@
+--- i915/i915_gem.c.orig	2018-08-22 13:20:50 UTC
++++ i915/i915_gem.c
+@@ -1628,7 +1628,7 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data
+ {
+ 	struct drm_i915_gem_mmap *args = data;
+ 	struct drm_i915_gem_object *obj;
+-	unsigned long addr;
++	vm_offset_t addr;
+ #ifndef __linux__
+ 	vm_object_t vmobj;
+ 	struct proc *p;
+@@ -2219,7 +2219,7 @@ i915_gem_object_invalidate(struct drm_i915_gem_object 
+ #else
+ 	mapping = obj->base.filp->f_mapping,
+ #endif
+-	invalidate_mapping_pages(mapping, 0, (loff_t)-1);
++	invalidate_mapping_pages(mapping, 0, (pgoff_t)-1);
+ }
+ 
+ static void

Property changes on: graphics/drm-stable-kmod/files/patch-i915-i915_gem.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-include-asm-processor.h
===================================================================
--- graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-include-asm-processor.h	(nonexistent)
+++ graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-include-asm-processor.h	(working copy)
@@ -0,0 +1,14 @@
+--- linuxkpi/gplv2/include/asm/processor.h.orig	2018-08-22 13:20:50 UTC
++++ linuxkpi/gplv2/include/asm/processor.h
+@@ -60,9 +60,11 @@ struct cpuinfo_x86 {
+ 	u32			microcode;
+ };
+ 
++#ifdef __linux__
+ #define	mb()	__asm __volatile("mfence;" : : : "memory")
+ #define	wmb()	__asm __volatile("sfence;" : : : "memory")
+ #define	rmb()	__asm __volatile("lfence;" : : : "memory")
++#endif
+ 
+ #define smp_mb() mb()
+ #define smp_wmb() wmb()

Property changes on: graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-include-asm-processor.h
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-src-linux_notifier.c
===================================================================
--- graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-src-linux_notifier.c	(nonexistent)
+++ graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-src-linux_notifier.c	(working copy)
@@ -0,0 +1,11 @@
+--- linuxkpi/gplv2/src/linux_notifier.c.orig	2018-08-22 13:20:50 UTC
++++ linuxkpi/gplv2/src/linux_notifier.c
+@@ -272,7 +272,7 @@ do_shrink_slab(struct shrink_control *shrinkctl, struc
+ 		total_scan -= nr_to_scan;
+ 	}
+ 	if (total_scan > 0)
+-		new_nr = atomic_fetchadd_64(&shrinker->nr_deferred[nid].counter, total_scan);
++		new_nr = atomic_fetchadd_long(&shrinker->nr_deferred[nid].counter, total_scan);
+ 	else
+ 		new_nr = READ_ONCE(shrinker->nr_deferred[nid].counter);
+ 

Property changes on: graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-src-linux_notifier.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-src-linux_page.c
===================================================================
--- graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-src-linux_page.c	(nonexistent)
+++ graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-src-linux_page.c	(working copy)
@@ -0,0 +1,10 @@
+--- linuxkpi/gplv2/src/linux_page.c.orig	2018-08-22 13:20:50 UTC
++++ linuxkpi/gplv2/src/linux_page.c
+@@ -30,6 +30,7 @@
+ 
+ #include <sys/lock.h>
+ #include <sys/rwlock.h>
++#include <sys/sf_buf.h>
+ 
+ #include <machine/atomic.h>
+ 

Property changes on: graphics/drm-stable-kmod/files/patch-linuxkpi-gplv2-src-linux_page.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: graphics/drm-stable-kmod/files/patch-radeon-radeon_agp.c
===================================================================
--- graphics/drm-stable-kmod/files/patch-radeon-radeon_agp.c	(nonexistent)
+++ graphics/drm-stable-kmod/files/patch-radeon-radeon_agp.c	(working copy)
@@ -0,0 +1,37 @@
+--- radeon/radeon_agp.c.orig	2018-08-22 13:20:50 UTC
++++ radeon/radeon_agp.c
+@@ -28,9 +28,6 @@
+ #include "radeon.h"
+ #include <drm/radeon_drm.h>
+ 
+-#define aper_base ai_aperture_base
+-#define aper_size ai_aperture_size
+-
+ #if IS_ENABLED(CONFIG_AGP)
+ 
+ struct radeon_agpmode_quirk {
+@@ -152,11 +149,11 @@ int radeon_agp_init(struct radeon_device *rdev)
+ 		return ret;
+ 	}
+ 
+-	if (rdev->ddev->agp->agp_info.aper_size < 32) {
++	if (rdev->ddev->agp->agp_info.ai_aperture_size < 32 * 1024 * 1024) {
+ 		drm_agp_release(rdev->ddev);
+ 		dev_warn(rdev->dev, "AGP aperture too small (%zuM) "
+ 			"need at least 32M, disabling AGP\n",
+-			rdev->ddev->agp->agp_info.aper_size);
++			rdev->ddev->agp->agp_info.ai_aperture_size >> 20);
+ 		return -EINVAL;
+ 	}
+ 
+@@ -244,8 +241,8 @@ int radeon_agp_init(struct radeon_device *rdev)
+ 		return ret;
+ 	}
+ 
+-	rdev->mc.agp_base = rdev->ddev->agp->agp_info.aper_base;
+-	rdev->mc.gtt_size = rdev->ddev->agp->agp_info.aper_size << 20;
++	rdev->mc.agp_base = rdev->ddev->agp->agp_info.ai_aperture_base;
++	rdev->mc.gtt_size = rdev->ddev->agp->agp_info.ai_aperture_size;
+ 	rdev->mc.gtt_start = rdev->mc.agp_base;
+ 	rdev->mc.gtt_end = rdev->mc.gtt_start + rdev->mc.gtt_size - 1;
+ 	dev_info(rdev->dev, "GTT: %lluM 0x%08llX - 0x%08llX\n",

Property changes on: graphics/drm-stable-kmod/files/patch-radeon-radeon_agp.c
___________________________________________________________________
Added: fbsd:nokeywords
## -0,0 +1 ##
+yes
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Index: graphics/drm-stable-kmod/pkg-plist
===================================================================
--- graphics/drm-stable-kmod/pkg-plist	(revision 482344)
+++ graphics/drm-stable-kmod/pkg-plist	(working copy)
@@ -1,5 +1,5 @@
-/%%KMODDIR%%/amdgpu.ko
-/%%KMODDIR%%/amdkfd.ko
+%%AMDGPU%%/%%KMODDIR%%/amdgpu.ko
+%%AMDGPU%%/%%KMODDIR%%/amdkfd.ko
 /%%KMODDIR%%/debugfs.ko
 /%%KMODDIR%%/drm.ko
 /%%KMODDIR%%/i915kms.ko

--MP_/vwU3LoEXpmqH5K/mng91iP7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20181020212746.11710efb>