[PATCH 08/39] drm: remove redundant clears from drm_setup

David Herrmann dh.herrmann at gmail.com
Wed Jul 10 06:28:50 PDT 2013


Hi

On Wed, Jul 10, 2013 at 2:11 PM, Daniel Vetter <daniel.vetter at ffwll.ch> wrote:
> We kzalloc the driver node at init time, so no need to do this again.
>
> Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
> ---
>  drivers/gpu/drm/drm_fops.c | 9 ---------
>  1 file changed, 9 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c
> index 57e3014..9610997 100644
> --- a/drivers/gpu/drm/drm_fops.c
> +++ b/drivers/gpu/drm/drm_fops.c
> @@ -73,15 +73,6 @@ static int drm_setup(struct drm_device * dev)
>         for (i = 0; i < ARRAY_SIZE(dev->counts); i++)
>                 atomic_set(&dev->counts[i], 0);
>
> -       dev->sigdata.lock = NULL;
> -
> -       dev->context_flag = 0;
> -       dev->last_context = 0;
> -       dev->last_checked = 0;
> -       dev->if_version = 0;
> -
> -       dev->buf_async = NULL;
> -

drm_setup() is called on every first open. I digged through core DRM
and noticed that we have a lot of code that cleans up on lastclose and
reinitializes on firstopen which is skipped for non-UMS drivers to
preserve KMS state if no user keeps DRM node open. I would like to
hear a comment in the commit-message which explains why we don't reset
"if_version", anymore. Are you sure UMS user-space does not depend on
this logic?

I have no idea of UMS, but if that reinitialization on
lastclose+firstopen is not relied on, I guess we can remove a lot more
code. Just wanted to make sure that this is right.

Cheers
David

>         DRM_DEBUG("\n");
>
>         /*
> --
> 1.8.3.2
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list