drm: Don't assign fbs for universal cursor support to files
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 25 Feb 2015 13:45:26 +0000 (13:45 +0000)
committerSasha Levin <sasha.levin@oracle.com>
Sat, 28 Mar 2015 13:53:25 +0000 (09:53 -0400)
commitaf6887e2100a5f053b2e07a0cc48f8dc6224653c
tree70445de7a94ac75e7bfffdff754cfb94e6648724
parent2c7f0370166faf409e67c9bbcb098ed02c78d182
drm: Don't assign fbs for universal cursor support to files

[ Upstream commit 9a6f5130143c17b91e0a3cbf5cc2d8c1e5a80a63 ]

The internal framebuffers we create to remap legacy cursor ioctls to
plane operations for the universal plane support shouldn't be linke to
the file like normal userspace framebuffers. This bug goes back to the
original universal cursor plane support introduced in

commit 161d0dc1dccb17ff7a38f462c7c0d4ef8bcc5662
Author: Matt Roper <matthew.d.roper@intel.com>
Date:   Tue Jun 10 08:28:10 2014 -0700

    drm: Support legacy cursor ioctls via universal planes when possible (v4)

The isn't too disastrous since fbs are small, we only create one when the
cursor bo gets changed and ultimately they'll be reaped when the window
server restarts.

Conceptually we'd want to just pass NULL for file_priv when creating it,
but the driver needs the file to lookup the underlying buffer object for
cursor id. Instead let's move the file_priv linking out of
add_framebuffer_internal() into the addfb ioctl implementation, which is
the only place it is needed. And also rename the function for a more
accurate since it only creates the fb, but doesn't add it anywhere.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> (fix & commit msg)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> (provider of lipstick)
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Rob Clark <robdclark@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/gpu/drm/drm_crtc.c