All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: dri-devel@lists.freedesktop.org,
	Haneen Mohammed <hamohammed.sa@gmail.com>
Subject: Re: [PATCH V3 2/4] drm/vkms: Add framebuffer and plane helpers
Date: Thu, 12 Jul 2018 08:45:13 +0200	[thread overview]
Message-ID: <20180712064513.GC3008@phenom.ffwll.local> (raw)
In-Reply-To: <fa1de05a6398e958a84b45397255b2af6fc23f28.1531359228.git.rodrigosiqueiramelo@gmail.com>

On Wed, Jul 11, 2018 at 11:02:01PM -0300, Rodrigo Siqueira wrote:
> This patch appends the minimum helpers related to framebuffer and plane
> to make vkms minimally usable.
> 
> Changes since V1:
> - None
> Changes since V2:
> - Squash "Add plane helper struct" and "Add helper for framebuffer
>   create"
> 
> Signed-off-by: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> ---
>  drivers/gpu/drm/vkms/vkms_drv.c   |  3 +++
>  drivers/gpu/drm/vkms/vkms_plane.c | 18 ++++++++++++++++++
>  2 files changed, 21 insertions(+)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_drv.c b/drivers/gpu/drm/vkms/vkms_drv.c
> index 6ea2fd97bef9..b5d597a42f20 100644
> --- a/drivers/gpu/drm/vkms/vkms_drv.c
> +++ b/drivers/gpu/drm/vkms/vkms_drv.c
> @@ -9,6 +9,8 @@
>  #include <drm/drm_gem.h>
>  #include <drm/drm_crtc_helper.h>
>  #include <drm/drm_atomic_helper.h>
> +#include <drm/drm_gem_framebuffer_helper.h>
> +#include <drm/drm_fb_helper.h>
>  #include "vkms_drv.h"
>  
>  #define DRIVER_NAME	"vkms"
> @@ -69,6 +71,7 @@ static struct drm_driver vkms_driver = {
>  };
>  
>  static const struct drm_mode_config_funcs vkms_mode_funcs = {
> +	.fb_create = drm_gem_fb_create,
>  	.atomic_check = drm_atomic_helper_check,
>  	.atomic_commit = drm_atomic_helper_commit,
>  };
> diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> index 2c25b1d6ab5b..f7f63143f6d0 100644
> --- a/drivers/gpu/drm/vkms/vkms_plane.c
> +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> @@ -19,6 +19,22 @@ static const struct drm_plane_funcs vkms_plane_funcs = {
>  	.atomic_destroy_state	= drm_atomic_helper_plane_destroy_state,
>  };
>  
> +static int vkms_plane_atomic_check(struct drm_plane *plane,
> +				   struct drm_plane_state *state)
> +{
> +	return 0;
> +}
> +
> +static void vkms_primary_plane_update(struct drm_plane *plane,
> +				      struct drm_plane_state *old_state)
> +{
> +}

I guess I've forgotten to mention this, but the above two functions
implement the default behaviour. Please remove until we're using them. Yes
that means we're just adding an empty function table for now, but I guess
that's required until more of this is filled out.
-Daniel

> +
> +static const struct drm_plane_helper_funcs vkms_primary_helper_funcs = {
> +	.atomic_check		= vkms_plane_atomic_check,
> +	.atomic_update		= vkms_primary_plane_update,
> +};
> +
>  struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev)
>  {
>  	struct drm_device *dev = &vkmsdev->drm;
> @@ -42,5 +58,7 @@ struct drm_plane *vkms_plane_init(struct vkms_device *vkmsdev)
>  		return ERR_PTR(ret);
>  	}
>  
> +	drm_plane_helper_add(plane, &vkms_primary_helper_funcs);
> +
>  	return plane;
>  }
> -- 
> 2.18.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-07-12  6:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-12  2:01 [PATCH V3 0/4] Add infrastructure for vblank and page flip events in vkms Rodrigo Siqueira
2018-07-12  2:01 ` [PATCH V3 1/4] drm/vkms: Add dumb operations Rodrigo Siqueira
2018-07-12  2:02 ` [PATCH V3 2/4] drm/vkms: Add framebuffer and plane helpers Rodrigo Siqueira
2018-07-12  6:45   ` Daniel Vetter [this message]
2018-07-12  2:02 ` [PATCH V3 3/4] drm/vkms: Add connectors helpers Rodrigo Siqueira
2018-07-12  2:02 ` [PATCH V3 4/4] drm/vkms: Add vblank events simulated by hrtimers Rodrigo Siqueira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180712064513.GC3008@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hamohammed.sa@gmail.com \
    --cc=rodrigosiqueiramelo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.