Skip to content

Commit

Permalink
gma500: Don't try and take a GEM handle of a non GEM fb
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alan Cox authored and Greg Kroah-Hartman committed May 17, 2011
1 parent 3a229fd commit 4f0c8f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/staging/gma500/psb_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 4f0c8f4

Please sign in to comment.