summaryrefslogtreecommitdiffstats
path: root/drivers/staging/gma500
diff options
context:
space:
mode:
authorAlan Cox2011-05-13 12:08:26 +0200
committerGreg Kroah-Hartman2011-05-17 20:37:56 +0200
commit4f0c8f43ee5e9e12ed36a5950e19cfe513669ae7 (patch)
treef2657d266415973cb4f8ddd22f9647f65e0ee653 /drivers/staging/gma500
parentcomedi vmk80xx: Style improvements (diff)
downloadkernel-qcow2-linux-4f0c8f43ee5e9e12ed36a5950e19cfe513669ae7.tar.gz
kernel-qcow2-linux-4f0c8f43ee5e9e12ed36a5950e19cfe513669ae7.tar.xz
kernel-qcow2-linux-4f0c8f43ee5e9e12ed36a5950e19cfe513669ae7.zip
gma500: Don't try and take a GEM handle of a non GEM fb
The initial GMA500 framebuffer is not GEM but stolen memory. We can't therefore take a GEM handle of it. Stop anyone trying to do this and causing a crash. Ideally we need a way to have GEM handles to non GEM objects but it's not clear how and if GEM and the modesetting/fb interfaces it provides are supposed to or indeed if they can handle it. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/gma500')
-rw-r--r--drivers/staging/gma500/psb_fb.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/gma500/psb_fb.c b/drivers/staging/gma500/psb_fb.c
index ae097cd883f5..99c03a2e06bd 100644
--- a/drivers/staging/gma500/psb_fb.c
+++ b/drivers/staging/gma500/psb_fb.c
@@ -648,6 +648,8 @@ static int psb_user_framebuffer_create_handle(struct drm_framebuffer *fb,
{
struct psb_framebuffer *psbfb = to_psb_fb(fb);
struct gtt_range *r = psbfb->gtt;
+ if (r->stolen)
+ return -EOPNOTSUPP;
return drm_gem_handle_create(file_priv, &r->gem, handle);
}