From 61598093bbdd283a7edc367d900f223070ead8d2 Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 10 May 2024 07:43:03 +0000 Subject: [PATCH] add ax88772C AX88772C_eeprom_tools --- kernel/drivers/gpu/drm/zte/zx_plane.c | 19 ++++++------------- 1 files changed, 6 insertions(+), 13 deletions(-) diff --git a/kernel/drivers/gpu/drm/zte/zx_plane.c b/kernel/drivers/gpu/drm/zte/zx_plane.c index ae8c53b..c8f7b21 100644 --- a/kernel/drivers/gpu/drm/zte/zx_plane.c +++ b/kernel/drivers/gpu/drm/zte/zx_plane.c @@ -1,20 +1,16 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Copyright 2016 Linaro Ltd. * Copyright 2016 ZTE Corporation. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * */ #include <drm/drm_atomic.h> #include <drm/drm_atomic_helper.h> #include <drm/drm_fb_cma_helper.h> +#include <drm/drm_fourcc.h> #include <drm/drm_gem_cma_helper.h> #include <drm/drm_modeset_helper_vtables.h> #include <drm/drm_plane_helper.h> -#include <drm/drmP.h> #include "zx_common_regs.h" #include "zx_drm_drv.h" @@ -58,7 +54,7 @@ int min_scale = FRAC_16_16(1, 8); int max_scale = FRAC_16_16(8, 1); - if (!crtc || !fb) + if (!crtc || WARN_ON(!fb)) return 0; crtc_state = drm_atomic_get_existing_crtc_state(plane_state->state, @@ -199,7 +195,6 @@ u32 dst_x, dst_y, dst_w, dst_h; uint32_t format; int fmt; - int num_planes; int i; if (!fb) @@ -218,13 +213,12 @@ dst_h = drm_rect_height(dst); /* Set up data address registers for Y, Cb and Cr planes */ - num_planes = drm_format_num_planes(format); paddr_reg = layer + VL_Y; - for (i = 0; i < num_planes; i++) { + for (i = 0; i < fb->format->num_planes; i++) { cma_obj = drm_fb_cma_get_gem_obj(fb, i); paddr = cma_obj->paddr + fb->offsets[i]; paddr += src_y * fb->pitches[i]; - paddr += src_x * drm_format_plane_cpp(format, i); + paddr += src_x * fb->format->cpp[i]; zx_writel(paddr_reg, paddr); paddr_reg += 4; } @@ -287,7 +281,7 @@ struct drm_crtc *crtc = plane_state->crtc; struct drm_crtc_state *crtc_state; - if (!crtc || !fb) + if (!crtc || WARN_ON(!fb)) return 0; crtc_state = drm_atomic_get_existing_crtc_state(plane_state->state, @@ -446,7 +440,6 @@ static void zx_plane_destroy(struct drm_plane *plane) { - drm_plane_helper_disable(plane, NULL); drm_plane_cleanup(plane); } -- Gitblit v1.6.2