[PATCH RFC 09/11] drm/tilcdc: Set DRIVER_ATOMIC and use atomic crtc helpers
Jyri Sarha
jsarha at ti.com
Tue Apr 12 07:41:23 UTC 2016
On 04/11/16 19:46, Jyri Sarha wrote:
> Set DRIVER_ATOMIC and use atomic helpers and rename commit and prepare
> crtc helpers to enable and disable. This makes the final jump to mode
> setting, but there is lot of obsolete code to clean up.
>
> Signed-off-by: Jyri Sarha <jsarha at ti.com>
> ---
> drivers/gpu/drm/tilcdc/tilcdc_crtc.c | 16 +++++++++++-----
> drivers/gpu/drm/tilcdc/tilcdc_drv.c | 2 +-
> 2 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> index 69045d8..e8e309e 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_crtc.c
> @@ -17,6 +17,7 @@
>
> #include "drm_flip_work.h"
> #include <drm/drm_plane_helper.h>
> +#include <drm/drm_atomic_helper.h>
>
> #include "tilcdc_drv.h"
> #include "tilcdc_regs.h"
> @@ -300,12 +301,12 @@ static bool tilcdc_crtc_mode_fixup(struct drm_crtc *crtc,
> return true;
> }
>
> -static void tilcdc_crtc_prepare(struct drm_crtc *crtc)
> +static void tilcdc_crtc_disable(struct drm_crtc *crtc)
> {
> tilcdc_crtc_dpms(crtc, DRM_MODE_DPMS_OFF);
> }
>
> -static void tilcdc_crtc_commit(struct drm_crtc *crtc)
> +static void tilcdc_crtc_enable(struct drm_crtc *crtc)
> {
> tilcdc_crtc_dpms(crtc, DRM_MODE_DPMS_ON);
> }
> @@ -713,9 +714,12 @@ static int tilcdc_crtc_mode_set_base(struct drm_crtc *crtc, int x, int y,
> }
>
> static const struct drm_crtc_funcs tilcdc_crtc_funcs = {
> - .destroy = tilcdc_crtc_destroy,
> - .set_config = drm_crtc_helper_set_config,
> - .page_flip = tilcdc_crtc_page_flip,
> + .destroy = tilcdc_crtc_destroy,
> + .set_config = drm_atomic_helper_set_config,
> + .page_flip = drm_atomic_helper_page_flip,
> + .reset = drm_atomic_helper_crtc_reset,
> + .atomic_duplicate_state = drm_atomic_helper_crtc_duplicate_state,
> + .atomic_destroy_state = drm_atomic_helper_crtc_destroy_state,
> };
>
> static const struct drm_crtc_helper_funcs tilcdc_crtc_helper_funcs = {
> @@ -725,6 +729,8 @@ static const struct drm_crtc_helper_funcs tilcdc_crtc_helper_funcs = {
> .commit = tilcdc_crtc_commit,
Oops, I made a compile breakage here in the last phase. The
tilcdc_crtc_commit () and tilcdc_crtc_preapre() above were renamed to
*enable() and *disable(). I'll fix that in the next round.
> .mode_set = tilcdc_crtc_mode_set,
> .mode_set_base = tilcdc_crtc_mode_set_base,
> + .enable = tilcdc_crtc_enable,
> + .disable = tilcdc_crtc_disable,
> .atomic_check = tilcdc_crtc_atomic_check,
> .mode_set_nofb = tilcdc_crtc_mode_set_nofb,
> };
> diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> index dc0d1e9..6569d3a 100644
> --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c
> @@ -587,7 +587,7 @@ static const struct file_operations fops = {
>
> static struct drm_driver tilcdc_driver = {
> .driver_features = (DRIVER_HAVE_IRQ | DRIVER_GEM | DRIVER_MODESET |
> - DRIVER_PRIME),
> + DRIVER_PRIME | DRIVER_ATOMIC),
> .load = tilcdc_load,
> .unload = tilcdc_unload,
> .lastclose = tilcdc_lastclose,
>
More information about the dri-devel
mailing list