Attachment '01-amdgpu_19.10_on_linux_4.19-v4.patch'

Download

   1 diff -Naur amdgpu-19.10-785425.bak/amd/amdgpu/amdgpu_connectors.c amdgpu-19.10-785425/amd/amdgpu/amdgpu_connectors.c
   2 --- amdgpu-19.10-785425.bak/amd/amdgpu/amdgpu_connectors.c	2019-04-17 08:07:59.000000000 +0200
   3 +++ amdgpu-19.10-785425/amd/amdgpu/amdgpu_connectors.c	2019-06-12 10:46:26.893078230 +0200
   4 @@ -365,11 +365,11 @@
   5  	int ret;
   6  
   7  	if (amdgpu_connector->edid) {
   8 -		drm_mode_connector_update_edid_property(connector, amdgpu_connector->edid);
   9 +		drm_connector_update_edid_property(connector, amdgpu_connector->edid);
  10  		ret = drm_add_edid_modes(connector, amdgpu_connector->edid);
  11  		return ret;
  12  	}
  13 -	drm_mode_connector_update_edid_property(connector, NULL);
  14 +	drm_connector_update_edid_property(connector, NULL);
  15  	return 0;
  16  }
  17  
  18 diff -Naur amdgpu-19.10-785425.bak/amd/amdgpu/amdgpu_encoders.c amdgpu-19.10-785425/amd/amdgpu/amdgpu_encoders.c
  19 --- amdgpu-19.10-785425.bak/amd/amdgpu/amdgpu_encoders.c	2019-04-17 08:07:59.000000000 +0200
  20 +++ amdgpu-19.10-785425/amd/amdgpu/amdgpu_encoders.c	2019-06-12 10:46:26.893078230 +0200
  21 @@ -47,7 +47,7 @@
  22  		list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
  23  			amdgpu_encoder = to_amdgpu_encoder(encoder);
  24  			if (amdgpu_encoder->devices & amdgpu_connector->devices) {
  25 -				drm_mode_connector_attach_encoder(connector, encoder);
  26 +				drm_connector_attach_encoder(connector, encoder);
  27  				if (amdgpu_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
  28  					amdgpu_atombios_encoder_init_backlight(amdgpu_encoder, connector);
  29  					adev->mode_info.bl_encoder = amdgpu_encoder;
  30 diff -Naur amdgpu-19.10-785425.bak/amd/amdgpu/amdgpu_mn.c amdgpu-19.10-785425/amd/amdgpu/amdgpu_mn.c
  31 --- amdgpu-19.10-785425.bak/amd/amdgpu/amdgpu_mn.c	2019-04-17 08:07:59.000000000 +0200
  32 +++ amdgpu-19.10-785425/amd/amdgpu/amdgpu_mn.c	2019-06-12 10:50:19.077988774 +0200
  33 @@ -186,12 +186,18 @@
  34   *
  35   * @amn: our notifier
  36   */
  37 -static void amdgpu_mn_read_lock(struct amdgpu_mn *amn)
  38 +static int amdgpu_mn_read_lock(struct amdgpu_mn *amn, bool blockable)
  39  {
  40 -	mutex_lock(&amn->read_lock);
  41 +	if (blockable)
  42 +		mutex_lock(&amn->read_lock);
  43 +	else if (!mutex_trylock(&amn->read_lock))
  44 +		return -EAGAIN;
  45 +
  46  	if (atomic_inc_return(&amn->recursion) == 1)
  47  		down_read_non_owner(&amn->lock);
  48  	mutex_unlock(&amn->read_lock);
  49 +
  50 +	return 0;
  51  }
  52  
  53  /**
  54 @@ -247,10 +253,11 @@
  55   * Block for operations on BOs to finish and mark pages as accessed and
  56   * potentially dirty.
  57   */
  58 -static void amdgpu_mn_invalidate_range_start_gfx(struct mmu_notifier *mn,
  59 +static int amdgpu_mn_invalidate_range_start_gfx(struct mmu_notifier *mn,
  60  						 struct mm_struct *mm,
  61  						 unsigned long start,
  62 -						 unsigned long end)
  63 +						 unsigned long end,
  64 +						 bool blockable)
  65  {
  66  	struct amdgpu_mn *amn = container_of(mn, struct amdgpu_mn, mn);
  67  	struct interval_tree_node *it;
  68 @@ -258,17 +265,28 @@
  69  	/* notification is exclusive, but interval is inclusive */
  70  	end -= 1;
  71  
  72 -	amdgpu_mn_read_lock(amn);
  73 +	/* TODO we should be able to split locking for interval tree and
  74 +	 * amdgpu_mn_invalidate_node
  75 +	 */
  76 +	if (amdgpu_mn_read_lock(amn, blockable))
  77 +		return -EAGAIN;
  78  
  79  	it = interval_tree_iter_first(&amn->objects, start, end);
  80  	while (it) {
  81  		struct amdgpu_mn_node *node;
  82  
  83 +		if (!blockable) {
  84 +			amdgpu_mn_read_unlock(amn);
  85 +			return -EAGAIN;
  86 +		}
  87 +
  88  		node = container_of(it, struct amdgpu_mn_node, it);
  89  		it = interval_tree_iter_next(it, start, end);
  90  
  91  		amdgpu_mn_invalidate_node(node, start, end);
  92  	}
  93 +
  94 +	return 0;
  95  }
  96  
  97  /**
  98 @@ -303,10 +321,11 @@
  99   * necessitates evicting all user-mode queues of the process. The BOs
 100   * are restorted in amdgpu_mn_invalidate_range_end_hsa.
 101   */
 102 -static void amdgpu_mn_invalidate_range_start_hsa(struct mmu_notifier *mn,
 103 +static int amdgpu_mn_invalidate_range_start_hsa(struct mmu_notifier *mn,
 104  						 struct mm_struct *mm,
 105  						 unsigned long start,
 106 -						 unsigned long end)
 107 +						 unsigned long end,
 108 +						 bool blockable)
 109  {
 110  	struct amdgpu_mn *amn = container_of(mn, struct amdgpu_mn, mn);
 111  	struct interval_tree_node *it;
 112 @@ -314,13 +333,19 @@
 113  	/* notification is exclusive, but interval is inclusive */
 114  	end -= 1;
 115  
 116 -	amdgpu_mn_read_lock(amn);
 117 +	if (amdgpu_mn_read_lock(amn, blockable))
 118 +		return -EAGAIN;
 119  
 120  	it = interval_tree_iter_first(&amn->objects, start, end);
 121  	while (it) {
 122  		struct amdgpu_mn_node *node;
 123  		struct amdgpu_bo *bo;
 124  
 125 +		if (!blockable) {
 126 +			amdgpu_mn_read_unlock(amn);
 127 +			return -EAGAIN;
 128 +		}
 129 +
 130  		node = container_of(it, struct amdgpu_mn_node, it);
 131  		it = interval_tree_iter_next(it, start, end);
 132  
 133 @@ -332,6 +357,8 @@
 134  				amdgpu_amdkfd_evict_userptr(mem, mm);
 135  		}
 136  	}
 137 +
 138 +	return 0;
 139  }
 140  
 141  static void amdgpu_mn_invalidate_range_end_hsa(struct mmu_notifier *mn,
 142 diff -Naur amdgpu-19.10-785425.bak/amd/amdgpu/amdgpu_prime.c amdgpu-19.10-785425/amd/amdgpu/amdgpu_prime.c
 143 --- amdgpu-19.10-785425.bak/amd/amdgpu/amdgpu_prime.c	2019-04-17 08:07:59.000000000 +0200
 144 +++ amdgpu-19.10-785425/amd/amdgpu/amdgpu_prime.c	2019-06-12 10:54:18.814896572 +0200
 145 @@ -246,7 +246,6 @@
 146   * 0 on success or a negative error code on failure.
 147   */
 148  static int amdgpu_gem_map_attach(struct dma_buf *dma_buf,
 149 -				 struct device *target_dev,
 150  				 struct dma_buf_attachment *attach)
 151  {
 152  	struct drm_gem_object *obj = dma_buf->priv;
 153 @@ -254,7 +253,7 @@
 154  	struct amdgpu_device *adev = amdgpu_ttm_adev(bo->tbo.bdev);
 155  	long r;
 156  
 157 -	r = drm_gem_map_attach(dma_buf, target_dev, attach);
 158 +	r = drm_gem_map_attach(dma_buf, attach);
 159  	if (r)
 160  		return r;
 161  
 162 @@ -434,9 +433,7 @@
 163  	.release = drm_gem_dmabuf_release,
 164  	.begin_cpu_access = amdgpu_gem_begin_cpu_access,
 165  	.map = drm_gem_dmabuf_kmap,
 166 -	.map_atomic = drm_gem_dmabuf_kmap_atomic,
 167  	.unmap = drm_gem_dmabuf_kunmap,
 168 -	.unmap_atomic = drm_gem_dmabuf_kunmap_atomic,
 169  	.mmap = drm_gem_dmabuf_mmap,
 170  	.vmap = drm_gem_dmabuf_vmap,
 171  	.vunmap = drm_gem_dmabuf_vunmap,
 172 diff -Naur amdgpu-19.10-785425.bak/amd/amdgpu/dce_virtual.c amdgpu-19.10-785425/amd/amdgpu/dce_virtual.c
 173 --- amdgpu-19.10-785425.bak/amd/amdgpu/dce_virtual.c	2019-04-17 08:07:59.000000000 +0200
 174 +++ amdgpu-19.10-785425/amd/amdgpu/dce_virtual.c	2019-06-12 10:46:26.897078177 +0200
 175 @@ -658,7 +658,7 @@
 176  	drm_connector_register(connector);
 177  
 178  	/* link them */
 179 -	drm_mode_connector_attach_encoder(connector, encoder);
 180 +	drm_connector_attach_encoder(connector, encoder);
 181  
 182  	return 0;
 183  }
 184 diff -Naur amdgpu-19.10-785425.bak/amd/display/amdgpu_dm/amdgpu_dm.c amdgpu-19.10-785425/amd/display/amdgpu_dm/amdgpu_dm.c
 185 --- amdgpu-19.10-785425.bak/amd/display/amdgpu_dm/amdgpu_dm.c	2019-04-17 08:07:59.000000000 +0200
 186 +++ amdgpu-19.10-785425/amd/display/amdgpu_dm/amdgpu_dm.c	2019-06-12 10:46:26.897078177 +0200
 187 @@ -1270,14 +1270,14 @@
 188  				(struct edid *) sink->dc_edid.raw_edid;
 189  
 190  
 191 -			drm_mode_connector_update_edid_property(connector,
 192 +			drm_connector_update_edid_property(connector,
 193  					aconnector->edid);
 194  		}
 195  		amdgpu_dm_update_freesync_caps(connector, aconnector->edid);
 196  
 197  	} else {
 198  		amdgpu_dm_update_freesync_caps(connector, NULL);
 199 -		drm_mode_connector_update_edid_property(connector, NULL);
 200 +		drm_connector_update_edid_property(connector, NULL);
 201  		aconnector->num_modes = 0;
 202  		dc_sink_release(aconnector->dc_sink);
 203  		aconnector->dc_sink = NULL;
 204 @@ -4902,7 +4902,7 @@
 205  		link,
 206  		link_index);
 207  
 208 -	drm_mode_connector_attach_encoder(
 209 +	drm_connector_attach_encoder(
 210  		&aconnector->base, &aencoder->base);
 211  
 212  	drm_connector_register(&aconnector->base);
 213 diff -Naur amdgpu-19.10-785425.bak/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c amdgpu-19.10-785425/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
 214 --- amdgpu-19.10-785425.bak/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c	2019-04-17 08:07:59.000000000 +0200
 215 +++ amdgpu-19.10-785425/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c	2019-06-12 10:46:26.897078177 +0200
 216 @@ -172,7 +172,7 @@
 217  		edid = drm_dp_mst_get_edid(connector, &aconnector->mst_port->mst_mgr, aconnector->port);
 218  
 219  		if (!edid) {
 220 -			drm_mode_connector_update_edid_property(
 221 +			drm_connector_update_edid_property(
 222  				&aconnector->base,
 223  				NULL);
 224  			return ret;
 225 @@ -206,7 +206,7 @@
 226  					connector, aconnector->edid);
 227  	}
 228  
 229 -	drm_mode_connector_update_edid_property(
 230 +	drm_connector_update_edid_property(
 231  					&aconnector->base, aconnector->edid);
 232  
 233  	ret = drm_add_edid_modes(connector, aconnector->edid);
 234 @@ -287,7 +287,7 @@
 235  			DRM_INFO("DM_MST: reusing connector: %p [id: %d] [master: %p]\n",
 236  						aconnector, connector->base.id, aconnector->mst_port);
 237  			aconnector->port = port;
 238 -			drm_mode_connector_set_path_property(connector, pathprop);
 239 +			drm_connector_set_path_property(connector, pathprop);
 240  			drm_modeset_unlock(&dev->mode_config.connection_mutex);
 241  			aconnector->mst_connected = true;
 242  			return &aconnector->base;
 243 @@ -322,7 +322,7 @@
 244  		master->connector_id);
 245  
 246  	aconnector->mst_encoder = dm_dp_create_fake_mst_encoder(master);
 247 -	drm_mode_connector_attach_encoder(&aconnector->base,
 248 +	drm_connector_attach_encoder(&aconnector->base,
 249  				     &aconnector->mst_encoder->base);
 250  
 251  	drm_object_attach_property(
 252 @@ -334,7 +334,7 @@
 253  		dev->mode_config.tile_property,
 254  		0);
 255  
 256 -	drm_mode_connector_set_path_property(connector, pathprop);
 257 +	drm_connector_set_path_property(connector, pathprop);
 258  
 259  	/*
 260  	 * Initialize connector state before adding the connectror to drm and
 261 diff -Naur amdgpu-19.10-785425.bak/Makefile amdgpu-19.10-785425/Makefile
 262 --- amdgpu-19.10-785425.bak/Makefile	2019-04-17 08:07:59.000000000 +0200
 263 +++ amdgpu-19.10-785425/Makefile	2019-06-12 10:46:26.897078177 +0200
 264 @@ -33,6 +33,9 @@
 265  DRM_VER=$(shell sed -n 's/^VERSION = \(.*\)/\1/p' $(kdir)/Makefile)
 266  DRM_PATCH=$(shell sed -n 's/^PATCHLEVEL = \(.*\)/\1/p' $(kdir)/Makefile)
 267  endif
 268 +else
 269 +DRM_VER=$(shell make kernelversion | sed -n 's/\(.*\)\.\(.*\)\.\(.*\)/\1/p')
 270 +DRM_PATCH=$(shell make kernelversion | sed -n 's/\(.*\)\.\(.*\)\.\(.*\)/\2/p')
 271  endif
 272  
 273  subdir-ccflags-y += \

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2019-06-12 16:42:32, 9.6 KB) [[attachment:01-amdgpu_19.10_on_linux_4.19-v4.patch]]
  • [get | view] (2019-07-11 07:02:16, 3.4 KB) [[attachment:01-amdgpu_19.20_on_linux_4.19-v1.patch]]
 All files | Selected Files: delete move to page copy to page

You are not allowed to attach a file to this page.