xref: /openbmc/linux/include/drm/drm_cache.h (revision 4b0e4e4a)
1c9c97b8cSDave Airlie /**************************************************************************
2c9c97b8cSDave Airlie  *
3c9c97b8cSDave Airlie  * Copyright 2009 Red Hat Inc.
4c9c97b8cSDave Airlie  * All Rights Reserved.
5c9c97b8cSDave Airlie  *
6c9c97b8cSDave Airlie  * Permission is hereby granted, free of charge, to any person obtaining a
7c9c97b8cSDave Airlie  * copy of this software and associated documentation files (the
8c9c97b8cSDave Airlie  * "Software"), to deal in the Software without restriction, including
9c9c97b8cSDave Airlie  * without limitation the rights to use, copy, modify, merge, publish,
10c9c97b8cSDave Airlie  * distribute, sub license, and/or sell copies of the Software, and to
11c9c97b8cSDave Airlie  * permit persons to whom the Software is furnished to do so, subject to
12c9c97b8cSDave Airlie  * the following conditions:
13c9c97b8cSDave Airlie  *
14c9c97b8cSDave Airlie  * The above copyright notice and this permission notice (including the
15c9c97b8cSDave Airlie  * next paragraph) shall be included in all copies or substantial portions
16c9c97b8cSDave Airlie  * of the Software.
17c9c97b8cSDave Airlie  *
18c9c97b8cSDave Airlie  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19c9c97b8cSDave Airlie  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20c9c97b8cSDave Airlie  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
21c9c97b8cSDave Airlie  * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
22c9c97b8cSDave Airlie  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
23c9c97b8cSDave Airlie  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
24c9c97b8cSDave Airlie  * USE OR OTHER DEALINGS IN THE SOFTWARE.
25c9c97b8cSDave Airlie  *
26c9c97b8cSDave Airlie  *
27c9c97b8cSDave Airlie  **************************************************************************/
28c9c97b8cSDave Airlie /*
29c9c97b8cSDave Airlie  * Authors:
30c9c97b8cSDave Airlie  * Dave Airlie <airlied@redhat.com>
31c9c97b8cSDave Airlie  */
32c9c97b8cSDave Airlie 
33c9c97b8cSDave Airlie #ifndef _DRM_CACHE_H_
34c9c97b8cSDave Airlie #define _DRM_CACHE_H_
35c9c97b8cSDave Airlie 
36c9c97b8cSDave Airlie void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
37c9c97b8cSDave Airlie 
384b0e4e4aSDave Airlie static inline bool drm_arch_can_wc_memory(void)
394b0e4e4aSDave Airlie {
404b0e4e4aSDave Airlie #if defined(CONFIG_PPC) && !defined(CONFIG_NOT_COHERENT_CACHE)
414b0e4e4aSDave Airlie 	return false;
424b0e4e4aSDave Airlie #else
434b0e4e4aSDave Airlie 	return true;
444b0e4e4aSDave Airlie #endif
454b0e4e4aSDave Airlie }
464b0e4e4aSDave Airlie 
47c9c97b8cSDave Airlie #endif
48