From: Tom Zanussi <tom.zanussi@intel.com>
To: bruce.ashfield@windriver.com,poky@yoctoproject.org
Subject: [PATCH 1/1][KERNEL] emgd: add fb_info
Date: Thu, 03 Mar 2011 10:45:01 -0600 [thread overview]
Message-ID: <b9dded$i4g29s@orsmga002.jf.intel.com> (raw)
From: Tom Zanussi <tom.zanussi@intel.com>
Add fb_info along with a new way to store and access it.
Signed-off-by: Tom Zanussi <tom.zanussi@intel.com>
---
drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
diff --git a/drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c b/drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c
index 5dc331e..4d668c8 100644
--- a/drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c
+++ b/drivers/gpu/drm/emgd/emgd/drm/emgd_fb.c
@@ -38,10 +38,13 @@
*/
typedef struct _emgd_framebuffer {
struct drm_framebuffer base;
+ struct fb_info *info;
unsigned long size;
unsigned long offset;
} emgd_framebuffer_t;
+#define to_emgd_framebuffer(x) container_of(x, struct _emgd_framebuffer, base)
+
typedef struct _emgdfb_par {
struct drm_device *dev;
emgd_framebuffer_t *emgd_fb;
@@ -298,7 +301,8 @@ EXPORT_SYMBOL(emgd_fb_probe);
*/
int emgd_fb_remove(struct drm_device *dev, struct drm_framebuffer *fb)
{
- struct fb_info *info = NULL;
+ emgd_framebuffer_t *emgd_fb = to_emgd_framebuffer(fb);
+ struct fb_info *info= emgd_fb->info;
if (info) {
unregister_framebuffer(info);
@@ -444,6 +448,7 @@ static struct drm_framebuffer *emgd_fb_create(struct drm_device *dev,
register_framebuffer(info);
+ emgd_fb->info = info;
par->emgd_fb = emgd_fb;
par->dev = dev;
@@ -459,10 +464,15 @@ static struct drm_framebuffer *emgd_fb_create(struct drm_device *dev,
*/
static void emgd_fb_destroy (struct drm_framebuffer *fb)
{
+ emgd_framebuffer_t *emgd_fb = to_emgd_framebuffer(fb);
struct drm_device *dev = fb->dev;
/* TODO: Unmap any pages mapped to the GTT */
+ if (emgd_fb->info) {
+ emgd_fb_remove(dev, fb);
+ }
+
drm_framebuffer_cleanup(fb);
kfree(fb);
--
1.7.0.4
reply other threads:[~2011-03-03 16:45 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='b9dded$i4g29s@orsmga002.jf.intel.com' \
--to=tom.zanussi@intel.com \
--cc=bruce.ashfield@windriver.com \
--cc=poky@yoctoproject.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