]> git.baikalelectronics.ru Git - kernel.git/commitdiff
Revert "drm/i915: Remove i915_gem_object_get_dirty_page()"
authorDave Airlie <airlied@redhat.com>
Tue, 8 Sep 2020 05:40:43 +0000 (15:40 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 8 Sep 2020 05:44:07 +0000 (15:44 +1000)
These commits caused a regression on Lenovo t520 sandybridge
machine belonging to reporter. We are reverting them for 5.10
for other reasons, so just do it for 5.9 as well.

This reverts commit f62f07c2a046969016a5206af2082e61839ffd91.

Reported-by: Harald Arnesen <harald@skogtun.org>
Signed-off-by: Dave Airlie <airied@redhat.com>
drivers/gpu/drm/i915/gem/i915_gem_object.h
drivers/gpu/drm/i915/gem/i915_gem_pages.c

index e5b9276d254c01d054c5c94ea9acdeb2b578c72a..9cf4ad78ece6ef6e926aabd01d9155e06b2bb9c4 100644 (file)
@@ -258,6 +258,10 @@ struct page *
 i915_gem_object_get_page(struct drm_i915_gem_object *obj,
                         unsigned int n);
 
+struct page *
+i915_gem_object_get_dirty_page(struct drm_i915_gem_object *obj,
+                              unsigned int n);
+
 dma_addr_t
 i915_gem_object_get_dma_address_len(struct drm_i915_gem_object *obj,
                                    unsigned long n,
index d15ff6748a50b46b6d57822e45e353653bf24500..e8a083743e09276920a009dab4a6eeea79138cc9 100644 (file)
@@ -548,6 +548,20 @@ i915_gem_object_get_page(struct drm_i915_gem_object *obj, unsigned int n)
        return nth_page(sg_page(sg), offset);
 }
 
+/* Like i915_gem_object_get_page(), but mark the returned page dirty */
+struct page *
+i915_gem_object_get_dirty_page(struct drm_i915_gem_object *obj,
+                              unsigned int n)
+{
+       struct page *page;
+
+       page = i915_gem_object_get_page(obj, n);
+       if (!obj->mm.dirty)
+               set_page_dirty(page);
+
+       return page;
+}
+
 dma_addr_t
 i915_gem_object_get_dma_address_len(struct drm_i915_gem_object *obj,
                                    unsigned long n,