[PATCH 1/2] drm/ttm: add lru notify to bo driver

Michel Dänzer michel at daenzer.net
Thu Jan 10 15:10:48 UTC 2019


On 2019-01-10 3:52 p.m., Chunming Zhou wrote:
> allow driver do somethings when lru changed.
> 
> Change-Id: Ie82053da49272881d4b52b1c406f7c221a3fcadf
> Signed-off-by: Chunming Zhou <david1.zhou at amd.com>
> 
> [...]
>  
>  void ttm_bo_del_sub_from_lru(struct ttm_buffer_object *bo)
> diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
> index 1021106438b2..85a9b97e1c9d 100644
> --- a/include/drm/ttm/ttm_bo_driver.h
> +++ b/include/drm/ttm/ttm_bo_driver.h
> @@ -381,6 +381,15 @@ struct ttm_bo_driver {
>  	 */
>  	int (*access_memory)(struct ttm_buffer_object *bo, unsigned long offset,
>  			     void *buf, int len, int write);
> +
> +	/**
> +	 * struct ttm_bo_driver member lru_notify
> +	 *
> +	 * @bo: the buffer object to be add

If I understand the code changes correctly, this should rather say
something like "the buffer object which was deleted from LRU"...


> +	 * send lru changed event to driver.

... this should say something like "notify driver that a BO was deleted
from LRU"...


> +	void (*lru_notify)(struct ttm_buffer_object *bo);

... and this should be named something like del_from_lru_notify, for
clarity.


-- 
Earthling Michel Dänzer               |               http://www.amd.com
Libre software enthusiast             |             Mesa and X developer


More information about the dri-devel mailing list