[Intel-gfx] [PATCH 4/7] drm/i915: Added an identifier for User frame buffers to Gem obj structure

akash.goel at intel.com akash.goel at intel.com
Thu Jan 9 06:30:52 CET 2014


From: Akash Goel <akash.goel at intel.com>

In order to uniquely identify the GEM objects representing the User
created frame buffers, a new bit-field 'user_fb' is added to the
GEM obj structure. The User created frame buffers are suitable for
allocation from stolen area. This bit field will be used when
allocating the backing physical space for the GEM objects, so
if the physical space is being allocated for a User frame buffer
the driver could use the free space from the stolen area instead
of shmem.

Signed-off-by: Akash Goel <akash.goel at intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h      | 5 +++++
 drivers/gpu/drm/i915/intel_display.c | 2 ++
 2 files changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index cc8afff..1bcc543 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1682,6 +1682,11 @@ struct drm_i915_gem_object {
 	unsigned int has_global_gtt_mapping:1;
 	unsigned int has_dma_mapping:1;
 
+	/*
+	 * Is the object associated with user created FB
+	 */
+	unsigned int user_fb:1;
+
 	struct sg_table *pages;
 	int pages_pin_count;
 
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 4d1357a..25fb061 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -10385,6 +10385,7 @@ static void intel_user_framebuffer_destroy(struct drm_framebuffer *fb)
 {
 	struct intel_framebuffer *intel_fb = to_intel_framebuffer(fb);
 
+	intel_fb->obj->user_fb = 0;
 	intel_framebuffer_fini(intel_fb);
 	kfree(intel_fb);
 }
@@ -10535,6 +10536,7 @@ intel_user_framebuffer_create(struct drm_device *dev,
 	if (&obj->base == NULL)
 		return ERR_PTR(-ENOENT);
 
+	obj->user_fb = 1;
 	return intel_framebuffer_create(dev, mode_cmd, obj);
 }
 
-- 
1.8.5.2




More information about the Intel-gfx mailing list