dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Cc: Huang Rui <ray.huang@amd.com>
Subject: [PATCH 2/3] drm/ttm: Add ttm_set_pages_wc and ttm_set_pages_uc helper
Date: Wed, 1 Aug 2018 13:49:32 +0800	[thread overview]
Message-ID: <1533102573-15365-2-git-send-email-ray.huang@amd.com> (raw)
In-Reply-To: <1533102573-15365-1-git-send-email-ray.huang@amd.com>

These two helpers will be used on set page caching.

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 include/drm/ttm/ttm_set_memory.h | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/include/drm/ttm/ttm_set_memory.h b/include/drm/ttm/ttm_set_memory.h
index a70723c..7c492b4 100644
--- a/include/drm/ttm/ttm_set_memory.h
+++ b/include/drm/ttm/ttm_set_memory.h
@@ -57,6 +57,18 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages)
 	return set_pages_wb(page, numpages);
 }
 
+static inline int ttm_set_pages_wc(struct page *page, int numpages)
+{
+	unsigned long addr = (unsigned long)page_address(page);
+
+	return set_memory_wc(addr, numpages);
+}
+
+static inline int ttm_set_pages_uc(struct page *page, int numpages)
+{
+	return set_pages_uc(page, numpages);
+}
+
 #else /* for CONFIG_X86 */
 
 #if IS_ENABLED(CONFIG_AGP)
@@ -123,6 +135,16 @@ static inline int ttm_set_pages_wb(struct page *page, int numpages)
 
 #endif /* for CONFIG_AGP */
 
+static inline int ttm_set_pages_wc(struct page *page, int numpages)
+{
+	return 0;
+}
+
+static inline int ttm_set_pages_uc(struct page *page, int numpages)
+{
+	return 0;
+}
+
 #endif /* for CONFIG_X86 */
 
 #endif
-- 
2.7.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-08-01  5:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-01  5:49 [PATCH 1/3] drm/ttm: fix missed conversion of set_pages_array_uc Huang Rui
2018-08-01  5:49 ` Huang Rui [this message]
     [not found] ` <1533102573-15365-1-git-send-email-ray.huang-5C7GfCeVMHo@public.gmane.org>
2018-08-01  5:49   ` [PATCH 3/3] drm/ttm: clean up non-x86 definitions on ttm_tt Huang Rui
2018-08-01  6:45   ` [PATCH 1/3] drm/ttm: fix missed conversion of set_pages_array_uc Christian König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1533102573-15365-2-git-send-email-ray.huang@amd.com \
    --to=ray.huang@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox