forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/gpu/drm/nouveau/dispnv04/tvnv17.c
....@@ -24,8 +24,8 @@
2424 *
2525 */
2626
27
-#include <drm/drmP.h>
2827 #include <drm/drm_crtc_helper.h>
28
+#include <drm/drm_probe_helper.h>
2929 #include "nouveau_drv.h"
3030 #include "nouveau_reg.h"
3131 #include "nouveau_encoder.h"
....@@ -599,7 +599,7 @@
599599 helper->dpms(encoder, DRM_MODE_DPMS_ON);
600600
601601 NV_INFO(drm, "Output %s is running on CRTC %d using output %c\n",
602
- nouveau_encoder_connector_get(nv_encoder)->base.name,
602
+ nv04_encoder_get_connector(nv_encoder)->base.name,
603603 nv_crtc->index, '@' + ffs(nv_encoder->dcb->or));
604604 }
605605
....@@ -644,16 +644,13 @@
644644 int i;
645645
646646 if (nouveau_tv_norm) {
647
- for (i = 0; i < num_tv_norms; i++) {
648
- if (!strcmp(nv17_tv_norm_names[i], nouveau_tv_norm)) {
649
- tv_enc->tv_norm = i;
650
- break;
651
- }
652
- }
653
-
654
- if (i == num_tv_norms)
647
+ i = match_string(nv17_tv_norm_names, num_tv_norms,
648
+ nouveau_tv_norm);
649
+ if (i < 0)
655650 NV_WARN(drm, "Invalid TV norm setting \"%s\"\n",
656651 nouveau_tv_norm);
652
+ else
653
+ tv_enc->tv_norm = i;
657654 }
658655
659656 drm_mode_create_tv_properties(dev, num_tv_norms, nv17_tv_norm_names);