Skip to contentSkip to conversation

gma500: Fix leak of uncached page

PATCH New Alan Cox 1 participant 2 messages Feb 2, 2012

Subsystems (3)
lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/7 gma500: Fix leak of uncached page

From: Alan Cox <[email protected]>

This was reported a long time ago (and I apologize to whoever it was that reported it as I've lost the original report).

---

 drivers/gpu/drm/gma500/psb_drv.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
drivers/gpu/drm/gma500/psb_drv.c +1 -0
index f14768f..653f439 100644
@@ -239,6 +239,7 @@ static int psb_driver_unload(struct drm_device *dev)
 		}
 		psb_gtt_takedown(dev);
 		if (dev_priv->scratch_page) {
+			set_pages_wb(dev_priv->scratch_page, 1);
 			__free_page(dev_priv->scratch_page);
 			dev_priv->scratch_page = NULL;
 		}
author
#1 lore raw

PATCH 2/7 gma500: plug in more of the gamma functionality

From: Alan Cox <[email protected]>

---

 drivers/gpu/drm/gma500/framebuffer.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
drivers/gpu/drm/gma500/framebuffer.c +10 -0
index 791c0ef..97d5b80 100644
@@ -560,11 +560,21 @@ static struct drm_framebuffer *psb_user_framebuffer_create
 static void psbfb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
 							u16 blue, int regno)
 {
+	struct psb_intel_crtc *intel_crtc = to_psb_intel_crtc(crtc);
+
+	intel_crtc->lut_r[regno] = red >> 8;
+	intel_crtc->lut_g[regno] = green >> 8;
+	intel_crtc->lut_b[regno] = blue >> 8;
 }
 
 static void psbfb_gamma_get(struct drm_crtc *crtc, u16 *red,
 					u16 *green, u16 *blue, int regno)
 {
+	struct psb_intel_crtc *intel_crtc = to_psb_intel_crtc(crtc);
+
+	*red = intel_crtc->lut_r[regno] << 8;
+	*green = intel_crtc->lut_g[regno] << 8;
+	*blue = intel_crtc->lut_b[regno] << 8;
 }
 
 static int psbfb_probe(struct drm_fb_helper *helper,