drm: Pass the user drm_mode_fb_cmd2 as const to .fb_create()
Drivers shouldn't clobber the passed in addfb ioctl parameters. i915 was doing just that. To prevent it from happening again, pass the struct around as const, starting all the way from internal_framebuffer_create(). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:

committed by
Daniel Vetter

parent
cc344980c7
commit
1eb83451ba
@@ -308,7 +308,7 @@ extern void ast_mode_fini(struct drm_device *dev);
|
||||
|
||||
int ast_framebuffer_init(struct drm_device *dev,
|
||||
struct ast_framebuffer *ast_fb,
|
||||
struct drm_mode_fb_cmd2 *mode_cmd,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd,
|
||||
struct drm_gem_object *obj);
|
||||
|
||||
int ast_fbdev_init(struct drm_device *dev);
|
||||
|
@@ -163,7 +163,7 @@ static struct fb_ops astfb_ops = {
|
||||
};
|
||||
|
||||
static int astfb_create_object(struct ast_fbdev *afbdev,
|
||||
struct drm_mode_fb_cmd2 *mode_cmd,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd,
|
||||
struct drm_gem_object **gobj_p)
|
||||
{
|
||||
struct drm_device *dev = afbdev->helper.dev;
|
||||
|
@@ -309,7 +309,7 @@ static const struct drm_framebuffer_funcs ast_fb_funcs = {
|
||||
|
||||
int ast_framebuffer_init(struct drm_device *dev,
|
||||
struct ast_framebuffer *ast_fb,
|
||||
struct drm_mode_fb_cmd2 *mode_cmd,
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd,
|
||||
struct drm_gem_object *obj)
|
||||
{
|
||||
int ret;
|
||||
@@ -327,7 +327,7 @@ int ast_framebuffer_init(struct drm_device *dev,
|
||||
static struct drm_framebuffer *
|
||||
ast_user_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_file *filp,
|
||||
struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
const struct drm_mode_fb_cmd2 *mode_cmd)
|
||||
{
|
||||
struct drm_gem_object *obj;
|
||||
struct ast_framebuffer *ast_fb;
|
||||
|
Reference in New Issue
Block a user