forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/gpu/drm/msm/disp/mdp5/mdp5_ctl.c
....@@ -1,14 +1,6 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (c) 2014-2015 The Linux Foundation. All rights reserved.
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 and
6
- * only version 2 as published by the Free Software Foundation.
7
- *
8
- * This program is distributed in the hope that it will be useful,
9
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- * GNU General Public License for more details.
124 */
135
146 #include "mdp5_kms.h"
....@@ -261,14 +253,14 @@
261253 u32 blend_cfg;
262254 struct mdp5_hw_mixer *mixer = pipeline->mixer;
263255
264
- if (unlikely(WARN_ON(!mixer))) {
265
- dev_err(ctl_mgr->dev->dev, "CTL %d cannot find LM",
256
+ if (WARN_ON(!mixer)) {
257
+ DRM_DEV_ERROR(ctl_mgr->dev->dev, "CTL %d cannot find LM",
266258 ctl->id);
267259 return -EINVAL;
268260 }
269261
270262 if (pipeline->r_mixer) {
271
- dev_err(ctl_mgr->dev->dev, "unsupported configuration");
263
+ DRM_DEV_ERROR(ctl_mgr->dev->dev, "unsupported configuration");
272264 return -EINVAL;
273265 }
274266
....@@ -604,10 +596,10 @@
604596 mdp5_write(mdp5_kms, REG_MDP5_SPARE_0, 0);
605597 return 0;
606598 } else if ((ctlx->pair != NULL) || (ctly->pair != NULL)) {
607
- dev_err(ctl_mgr->dev->dev, "CTLs already paired\n");
599
+ DRM_DEV_ERROR(ctl_mgr->dev->dev, "CTLs already paired\n");
608600 return -EINVAL;
609601 } else if (!(ctlx->status & ctly->status & CTL_STAT_BOOKED)) {
610
- dev_err(ctl_mgr->dev->dev, "Only pair booked CTLs\n");
602
+ DRM_DEV_ERROR(ctl_mgr->dev->dev, "Only pair booked CTLs\n");
611603 return -EINVAL;
612604 }
613605
....@@ -652,7 +644,7 @@
652644 if ((ctl_mgr->ctls[c].status & checkm) == match)
653645 goto found;
654646
655
- dev_err(ctl_mgr->dev->dev, "No more CTL available!");
647
+ DRM_DEV_ERROR(ctl_mgr->dev->dev, "No more CTL available!");
656648 goto unlock;
657649
658650 found:
....@@ -698,13 +690,13 @@
698690
699691 ctl_mgr = kzalloc(sizeof(*ctl_mgr), GFP_KERNEL);
700692 if (!ctl_mgr) {
701
- dev_err(dev->dev, "failed to allocate CTL manager\n");
693
+ DRM_DEV_ERROR(dev->dev, "failed to allocate CTL manager\n");
702694 ret = -ENOMEM;
703695 goto fail;
704696 }
705697
706
- if (unlikely(WARN_ON(ctl_cfg->count > MAX_CTL))) {
707
- dev_err(dev->dev, "Increase static pool size to at least %d\n",
698
+ if (WARN_ON(ctl_cfg->count > MAX_CTL)) {
699
+ DRM_DEV_ERROR(dev->dev, "Increase static pool size to at least %d\n",
708700 ctl_cfg->count);
709701 ret = -ENOSPC;
710702 goto fail;
....@@ -723,7 +715,7 @@
723715 struct mdp5_ctl *ctl = &ctl_mgr->ctls[c];
724716
725717 if (WARN_ON(!ctl_cfg->base[c])) {
726
- dev_err(dev->dev, "CTL_%d: base is null!\n", c);
718
+ DRM_DEV_ERROR(dev->dev, "CTL_%d: base is null!\n", c);
727719 ret = -EINVAL;
728720 spin_unlock_irqrestore(&ctl_mgr->pool_lock, flags);
729721 goto fail;