About this... I have been able to build amdgpu-pro with 4.9 but it does
not work!

I had to restart in safe mode and undo the mess, well I'm using btrfs
and so the going back to the previous snapshot was easy.

Anyway I want to trace here the procedure + patches if someone else
want to try out...

First, get the latest amdgpr-pro version from AMD. Version 16.60 for
Ubuntu from this page:

http://support.amd.com/en-us/kb-articles/Pages/AMDGPU-PRO-Driver-for-Linux-Release-Notes.aspx

Then:

$ tar xf amdgpu-pro-16.60-379184.tar.xz
$ patch < amdgpu-pro-install.patch
$ sudo ./amdgpu-pro-16.60-379184/amdgpu-pro-install

The dkms build will fail because incompatibility with 4.9 headers. Just
apply my patch on the source tree (as root):

# cd /usr/src/amdgpu-pro-16.60-379184
# patch < amdgpu-49.patch

Then finalize the build:

# cd /var/lib/dkms/amdgpu-pro/16.60-379184/build
# dkms build amdgpu-pro/16.60-379184
# dkms install amdgpu-pro/16.60-379184

At least we may try this later when a new amdgpu-pro driver is out.

-- 
  Pascal Obry /  Magny Les Hameaux (78)

  The best way to travel is by means of imagination

  http://www.obry.net

  gpg --keyserver keys.gnupg.net --recv-key F949BD3B
___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org
*** amdgpu-pro-16.60-379184/amdgpu-pro-install~	2017-01-23 03:00:25.000000000 +0100
--- amdgpu-pro-16.60-379184/amdgpu-pro-install	2017-03-04 15:57:22.189054001 +0100
***************
*** 46,53 ****
  	[[ -r  /etc/os-release ]] && . /etc/os-release
  
  	case "$ID" in
! 	ubuntu)
! 		PACKAGES="amdgpu-pro amdgpu-pro-lib32 amdgpu-pro-dkms"
  		;;
  	steamos)
  		PACKAGES="amdgpu-pro-driver amdgpu-pro-lib32 "`
--- 46,54 ----
  	[[ -r  /etc/os-release ]] && . /etc/os-release
  
  	case "$ID" in
! 	debian)
! #		PACKAGES="amdgpu-pro amdgpu-pro-lib32 amdgpu-pro-dkms"
! 		PACKAGES="amdgpu-pro"
  		;;
  	steamos)
  		PACKAGES="amdgpu-pro-driver amdgpu-pro-lib32 "`
***************
*** 83,88 ****
--- 84,90 ----
  		echo "deb [ trusted=yes ] file:$REPOSITORY/ ./" | \
  			$SUDO tee $(source_list)
  		$SUDO apt-get update ||:
+                 echo apt-get $@ install $PACKAGES
  		$SUDO apt-get $@ install $PACKAGES
  	fi
  }
***************
*** 130,136 ****
  		shift
  		;;
  	--compute)
! 		PACKAGES="clinfo-amdgpu-pro opencl-amdgpu-pro-icd \
  			amdgpu-pro-dkms libdrm2-amdgpu-pro \
  			libdrm-amdgpu-pro-amdgpu1"
  		shift
--- 132,138 ----
  		shift
  		;;
  	--compute)
! 		PACKAGES="opencl-amdgpu-pro-icd \
  			amdgpu-pro-dkms libdrm2-amdgpu-pro \
  			libdrm-amdgpu-pro-amdgpu1"
  		shift
*** ./amd/amdgpu/amdgpu_connectors.c~	2017-01-23 03:01:42.000000000 +0100
--- ./amd/amdgpu/amdgpu_connectors.c	2017-03-04 18:12:41.716426066 +0100
***************
*** 168,179 ****
  		}

  		/* Any defined maximum tmds clock limit we must not exceed? */
! 		if (connector->max_tmds_clock > 0) {
  			/* mode_clock is clock in kHz for mode to be modeset on this connector */
  			mode_clock = amdgpu_connector->pixelclock_for_modeset;

  			/* Maximum allowable input clock in kHz */
! 			max_tmds_clock = connector->max_tmds_clock * 1000;

  			DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
  				  connector->name, mode_clock, max_tmds_clock);
--- 168,179 ----
  		}

  		/* Any defined maximum tmds clock limit we must not exceed? */
! 		if (connector->display_info.max_tmds_clock > 0) {
  			/* mode_clock is clock in kHz for mode to be modeset on this connector */
  			mode_clock = amdgpu_connector->pixelclock_for_modeset;

  			/* Maximum allowable input clock in kHz */
! 			max_tmds_clock = connector->display_info.max_tmds_clock * 1000;

  			DRM_DEBUG("%s: hdmi mode dotclock %d kHz, max tmds input clock %d kHz.\n",
  				  connector->name, mode_clock, max_tmds_clock);
*** ./amd/amdgpu/amdgpu_ttm.c~	2017-01-23 03:01:42.000000000 +0100
--- ./amd/amdgpu/amdgpu_ttm.c	2017-03-04 18:13:45.776204388 +0100
***************
*** 255,261 ****

  	if (amdgpu_ttm_tt_get_usermm(bo->ttm))
  		return -EPERM;
! 	return drm_vma_node_verify_access(&abo->gem_base.vma_node, filp);
  }

  static void amdgpu_move_null(struct ttm_buffer_object *bo,
--- 255,261 ----

  	if (amdgpu_ttm_tt_get_usermm(bo->ttm))
  		return -EPERM;
! 	return drm_vma_node_verify_access(&abo->gem_base.vma_node, filp->private_data);
  }

  static void amdgpu_move_null(struct ttm_buffer_object *bo,
*** ./amd/display/amdgpu_dm/amdgpu_dm_types.c~	2017-01-23 03:01:42.000000000 +0100
--- ./amd/display/amdgpu_dm/amdgpu_dm_types.c	2017-03-04 18:15:46.571723561 +0100
***************
*** 1692,1701 ****
  	struct drm_plane *plane,
  	struct drm_framebuffer *fb,
  	const struct drm_plane_state *new_state)
! #else
  static int dm_plane_helper_prepare_fb(
  	struct drm_plane *plane,
  	const struct drm_plane_state *new_state)
  #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) */
  {
  	struct amdgpu_framebuffer *afb;
--- 1692,1705 ----
  	struct drm_plane *plane,
  	struct drm_framebuffer *fb,
  	const struct drm_plane_state *new_state)
! #elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
  static int dm_plane_helper_prepare_fb(
  	struct drm_plane *plane,
  	const struct drm_plane_state *new_state)
+ #else
+ static int dm_plane_helper_prepare_fb(
+ 	struct drm_plane *plane,
+ 	struct drm_plane_state *new_state)
  #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) */
  {
  	struct amdgpu_framebuffer *afb;
***************
*** 1735,1744 ****
  	struct drm_plane *plane,
  	struct drm_framebuffer *fb,
  	const struct drm_plane_state *old_state)
! #else
  static void dm_plane_helper_cleanup_fb(
  	struct drm_plane *plane,
  	const struct drm_plane_state *old_state)
  #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) */
  {
  	struct amdgpu_bo *rbo;
--- 1739,1752 ----
  	struct drm_plane *plane,
  	struct drm_framebuffer *fb,
  	const struct drm_plane_state *old_state)
! #elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 8, 0)
  static void dm_plane_helper_cleanup_fb(
  	struct drm_plane *plane,
  	const struct drm_plane_state *old_state)
+ #else
+ static void dm_plane_helper_cleanup_fb(
+ 	struct drm_plane *plane,
+ 	struct drm_plane_state *old_state)
  #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 4, 0) */
  {
  	struct amdgpu_bo *rbo;
*** ./include/kcl/kcl_mm.h~	2017-01-23 03:01:48.000000000 +0100
--- ./include/kcl/kcl_mm.h	2017-03-04 18:10:55.456789612 +0100
***************
*** 8,14 ****
                                       int write, int force, struct page **pages,
                                       struct vm_area_struct **vmas)
  {
! #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
          return get_user_pages(start, nr_pages, write, force, pages, vmas);
  #else
          return get_user_pages(tsk, mm, start, nr_pages,
--- 8,23 ----
                                       int write, int force, struct page **pages,
                                       struct vm_area_struct **vmas)
  {
! #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 8, 0)
!   unsigned int gup_flags = 0;
!
!   if (write)
!     gup_flags |= FOLL_WRITE;
!   if (force)
!     gup_flags |= FOLL_FORCE;
!
!         return get_user_pages(start, nr_pages, gup_flags, pages, vmas);
! #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 6, 0)
          return get_user_pages(start, nr_pages, write, force, pages, vmas);
  #else
          return get_user_pages(tsk, mm, start, nr_pages,

Reply via email to