From patchwork Tue Apr 23 23:20:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 162761 Delivered-To: patches@linaro.org Received: by 2002:a02:c6d8:0:0:0:0:0 with SMTP id r24csp4355038jan; Tue, 23 Apr 2019 16:21:35 -0700 (PDT) X-Received: by 2002:a65:6110:: with SMTP id z16mr18721158pgu.131.1556061695275; Tue, 23 Apr 2019 16:21:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556061695; cv=none; d=google.com; s=arc-20160816; b=dHcODI39owpBEfv2BmaPhMwXwhB/OO08RGKTaiEHLjGa+aoMaToiT84ezyoFAmf/xe pMPeR7pNn5jCv46cFIxjTEh2VAID2EYasdTcs0CPV5/j4MOf8Vy6Ba6TZ5cWuZcgLa78 hw1J3jxTIKOqhtKnPBlK42RfRR1H6idrHPrU+QqSdItYQQGNSxKL1/s/fU8tKyoBGLEo BwYgyJWEMyR95O5ckh7uG9zN0eULAJgOG5iWyj0o2cATQ5VWUwM0tUAGeTQALwkJM56A o5qs5k681P5oCEFuO29wAiR4YmkCW5LOO+5misKd8BLzSw6lg6XtlB+BE1y1eJrVgq2X K0HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BvIii0rpBLgX+wwqwL/0OsyeoCyTJ/LguEAz+P3IFTk=; b=KPK2dBIUEQZIWGLOZx4wbhOsGVfQMvqu6rkPq/R+WhxVRj/wWC57W3qjB73N5qGB8P kYdpUH9w0BjsXuq3yTgfK5Sm6BwAJ7aZVdtUSQ7Rr3s5PCoan1YI3+yYJ2fRcCtWUT6A bJgzLlmK2OPox9/N8P/9DnY/wEFQ4gSxI7IwZGuGLE6g0zDR5W4YBumIWb+hAnkYjv2V BgYsSuOYxWFdf1hGygAIvqxD7I79M83xXMGI//HL7a/QELsVZEVxD6XfCHztfPgMCw0i XrBb+DJ5BEZWiLe0EPLAFXsqt/n+ZC+S8TolSiUodNewZVkkYck4fpDg9jZMFYrqO3tO 0J+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CYwdS5Pe; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id u23sor19541870pfh.51.2019.04.23.16.21.35 for (Google Transport Security); Tue, 23 Apr 2019 16:21:35 -0700 (PDT) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CYwdS5Pe; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BvIii0rpBLgX+wwqwL/0OsyeoCyTJ/LguEAz+P3IFTk=; b=CYwdS5PeelmfD2irWAn0bYe3ptymOpnIEYyoFy+PvmAdcp+pAwgymZkAQxtFyKifQH VJZFG0qu8dTg34cxK+/TKJab5K3exR9lc9UijG3AgKAJ4T9c2dVrCkM2aZOQVqtAzlQ3 4ATCqPMlOvg44oJytrIRmcN6l/9Q3my5KBAjYeGrPBmWytTR/jVY9UGPdQORQdiY2WIV AmLrzYyd9gM6VrbwfcBqMrVzcKNpntVbYA8SLgpR6JUg0KvesAWeUq1ROXtSp7oM747U eW12liqDNdINlMAtvaRQBGMIF1KtlgbLjE+wMC54nHO8sH4wk90qdR94gBeET3LDHQ2F fkrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BvIii0rpBLgX+wwqwL/0OsyeoCyTJ/LguEAz+P3IFTk=; b=ISHEDQOKnGYkTJwmXIrn4fBqQ/B0PNnwS0B+QV/JpUruHH3wWs5Xlw/wVAsrDhTo44 wyP2z7XcJEeIKfuvfyXO/fEk7by2W9YAT4btQM1vfefh6pznBw6uK2uetCeJtyg4JiNV EuosFyPT2++l0kr2USIBNDI6YFYxsZoHr15RRLi1fMKK+i8M8qmLd0uYtOz2LeWQEvc6 CalsCWD+0SxRyfQ6XhGQuMT63RiSPKVscJ6mgMxOPiIitT66O24MLqqM8T+NfF35rygy S7mZyWp839t91vhUPO/3Fg21Iu2dSBIc8Wnh8oZuccPgYs36edkT+ei1kKRZQhXVKztG dnDA== X-Gm-Message-State: APjAAAUw8ijlX0n/XYyajh5xtcHuzWWclYBKWsfayThKHzN3d/nMeZDV As+yMSGOYN6rcrWR7eM5UJTMZruU X-Google-Smtp-Source: APXvYqzw+pUXyclfRXDV1TZekbBMMDVlL0SOVff5oY0DiBlSQhsq3d+eMnwM3635pkNkObZAkNmSbw== X-Received: by 2002:a62:aa01:: with SMTP id e1mr29934003pff.43.1556061694850; Tue, 23 Apr 2019 16:21:34 -0700 (PDT) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id c28sm6984235pgm.42.2019.04.23.16.21.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Apr 2019 16:21:33 -0700 (PDT) From: John Stultz To: lkml Cc: Xu YiPing , Xinliang Liu , Rongrong Zou , Xinwei Kong , Chen Feng , David Airlie , Daniel Vetter , dri-devel , John Stultz Subject: [PATCH 24/25] drm: kirin: Pass driver data to crtc init and plane init Date: Tue, 23 Apr 2019 16:20:55 -0700 Message-Id: <1556061656-1733-25-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556061656-1733-1-git-send-email-john.stultz@linaro.org> References: <1556061656-1733-1-git-send-email-john.stultz@linaro.org> From: Xu YiPing As part of refactoring the kirin driver to better support different hardware revisions, this patch changes funcitons to pass the kirin_driver_data as a prameter. This will allow those funcitons to be later moved to the generic kirin_drm_drv.c Cc: Xinliang Liu Cc: Rongrong Zou Cc: Xinwei Kong Cc: Chen Feng Cc: David Airlie Cc: Daniel Vetter Cc: dri-devel Signed-off-by: Xu YiPing [jstultz: Reworded commit message] Signed-off-by: John Stultz --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c index 71671f8..876e25b 100644 --- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c +++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c @@ -572,7 +572,8 @@ static const struct drm_crtc_funcs ade_crtc_funcs = { }; static int kirin_drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, - struct drm_plane *plane) + struct drm_plane *plane, + const struct kirin_drm_data *driver_data) { struct device_node *port; int ret; @@ -589,13 +590,13 @@ static int kirin_drm_crtc_init(struct drm_device *dev, struct drm_crtc *crtc, crtc->port = port; ret = drm_crtc_init_with_planes(dev, crtc, plane, NULL, - ade_driver_data.crtc_funcs, NULL); + driver_data->crtc_funcs, NULL); if (ret) { DRM_ERROR("failed to init crtc.\n"); return ret; } - drm_crtc_helper_add(crtc, ade_driver_data.crtc_helper_funcs); + drm_crtc_helper_add(crtc, driver_data->crtc_helper_funcs); return 0; } @@ -894,21 +895,22 @@ static struct drm_plane_funcs ade_plane_funcs = { static int kirin_drm_plane_init(struct drm_device *dev, struct kirin_plane *kplane, - enum drm_plane_type type) + enum drm_plane_type type, + const struct kirin_drm_data *driver_data) { int ret = 0; ret = drm_universal_plane_init(dev, &kplane->base, 1, - ade_driver_data.plane_funcs, - ade_driver_data.channel_formats, - ade_driver_data.channel_formats_cnt, - NULL, type, NULL); + driver_data->plane_funcs, + driver_data->channel_formats, + driver_data->channel_formats_cnt, + NULL, type, NULL); if (ret) { DRM_ERROR("fail to init plane, ch=%d\n", kplane->ch); return ret; } - drm_plane_helper_add(&kplane->base, ade_driver_data.plane_helper_funcs); + drm_plane_helper_add(&kplane->base, driver_data->plane_helper_funcs); return 0; } @@ -1024,14 +1026,15 @@ static int ade_drm_init(struct platform_device *pdev) else type = DRM_PLANE_TYPE_OVERLAY; - ret = kirin_drm_plane_init(dev, kplane, type); + ret = kirin_drm_plane_init(dev, kplane, type, &ade_driver_data); if (ret) return ret; } /* crtc init */ ret = kirin_drm_crtc_init(dev, &kcrtc->base, - &ade->planes[ade_driver_data.prim_plane].base); + &ade->planes[ade_driver_data.prim_plane].base, + &ade_driver_data); if (ret) return ret;