aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/drm_edid.c7
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c4
-rw-r--r--drivers/gpu/drm/i915/intel_tv.c2
-rw-r--r--drivers/gpu/drm/savage/savage_bci.c2
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_resource.c2
5 files changed, 7 insertions, 10 deletions
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index f87bf104df7..9585e531ac6 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -929,13 +929,11 @@ drm_mode_do_interlace_quirk(struct drm_display_mode *mode,
929 { 1440, 576 }, 929 { 1440, 576 },
930 { 2880, 576 }, 930 { 2880, 576 },
931 }; 931 };
932 static const int n_sizes =
933 sizeof(cea_interlaced)/sizeof(cea_interlaced[0]);
934 932
935 if (!(pt->misc & DRM_EDID_PT_INTERLACED)) 933 if (!(pt->misc & DRM_EDID_PT_INTERLACED))
936 return; 934 return;
937 935
938 for (i = 0; i < n_sizes; i++) { 936 for (i = 0; i < ARRAY_SIZE(cea_interlaced); i++) {
939 if ((mode->hdisplay == cea_interlaced[i].w) && 937 if ((mode->hdisplay == cea_interlaced[i].w) &&
940 (mode->vdisplay == cea_interlaced[i].h / 2)) { 938 (mode->vdisplay == cea_interlaced[i].h / 2)) {
941 mode->vdisplay *= 2; 939 mode->vdisplay *= 2;
@@ -1375,7 +1373,6 @@ static const struct {
1375 { 1920, 1440, 60, 0 }, 1373 { 1920, 1440, 60, 0 },
1376 { 1920, 1440, 75, 0 }, 1374 { 1920, 1440, 75, 0 },
1377}; 1375};
1378static const int num_est3_modes = sizeof(est3_modes) / sizeof(est3_modes[0]);
1379 1376
1380static int 1377static int
1381drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing) 1378drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing)
@@ -1387,7 +1384,7 @@ drm_est3_modes(struct drm_connector *connector, struct detailed_timing *timing)
1387 for (i = 0; i < 6; i++) { 1384 for (i = 0; i < 6; i++) {
1388 for (j = 7; j > 0; j--) { 1385 for (j = 7; j > 0; j--) {
1389 m = (i * 8) + (7 - j); 1386 m = (i * 8) + (7 - j);
1390 if (m >= num_est3_modes) 1387 if (m >= ARRAY_SIZE(est3_modes))
1391 break; 1388 break;
1392 if (est[i] & (1 << j)) { 1389 if (est[i] & (1 << j)) {
1393 mode = drm_mode_find_dmt(connector->dev, 1390 mode = drm_mode_find_dmt(connector->dev,
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 76993ac16cc..03c231be227 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -392,13 +392,13 @@ static void intel_sdvo_debug_write(struct intel_encoder *intel_encoder, u8 cmd,
392 DRM_LOG_KMS("%02X ", ((u8 *)args)[i]); 392 DRM_LOG_KMS("%02X ", ((u8 *)args)[i]);
393 for (; i < 8; i++) 393 for (; i < 8; i++)
394 DRM_LOG_KMS(" "); 394 DRM_LOG_KMS(" ");
395 for (i = 0; i < sizeof(sdvo_cmd_names) / sizeof(sdvo_cmd_names[0]); i++) { 395 for (i = 0; i < ARRAY_SIZE(sdvo_cmd_names); i++) {
396 if (cmd == sdvo_cmd_names[i].cmd) { 396 if (cmd == sdvo_cmd_names[i].cmd) {
397 DRM_LOG_KMS("(%s)", sdvo_cmd_names[i].name); 397 DRM_LOG_KMS("(%s)", sdvo_cmd_names[i].name);
398 break; 398 break;
399 } 399 }
400 } 400 }
401 if (i == sizeof(sdvo_cmd_names)/ sizeof(sdvo_cmd_names[0])) 401 if (i == ARRAY_SIZE(sdvo_cmd_names))
402 DRM_LOG_KMS("(%02X)", cmd); 402 DRM_LOG_KMS("(%02X)", cmd);
403 DRM_LOG_KMS("\n"); 403 DRM_LOG_KMS("\n");
404} 404}
diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
index 6d553c29d10..d2d4e4045ca 100644
--- a/drivers/gpu/drm/i915/intel_tv.c
+++ b/drivers/gpu/drm/i915/intel_tv.c
@@ -1424,7 +1424,7 @@ intel_tv_get_modes(struct drm_connector *connector)
1424 int j, count = 0; 1424 int j, count = 0;
1425 u64 tmp; 1425 u64 tmp;
1426 1426
1427 for (j = 0; j < sizeof(input_res_table) / sizeof(input_res_table[0]); 1427 for (j = 0; j < ARRAY_SIZE(input_res_table);
1428 j++) { 1428 j++) {
1429 struct input_res *input = &input_res_table[j]; 1429 struct input_res *input = &input_res_table[j];
1430 unsigned int hactive_s = input->w; 1430 unsigned int hactive_s = input->w;
diff --git a/drivers/gpu/drm/savage/savage_bci.c b/drivers/gpu/drm/savage/savage_bci.c
index 2d0c9ca484c..fa05cda8c98 100644
--- a/drivers/gpu/drm/savage/savage_bci.c
+++ b/drivers/gpu/drm/savage/savage_bci.c
@@ -552,7 +552,7 @@ int savage_driver_load(struct drm_device *dev, unsigned long chipset)
552 552
553 553
554/* 554/*
555 * Initalize mappings. On Savage4 and SavageIX the alignment 555 * Initialize mappings. On Savage4 and SavageIX the alignment
556 * and size of the aperture is not suitable for automatic MTRR setup 556 * and size of the aperture is not suitable for automatic MTRR setup
557 * in drm_addmap. Therefore we add them manually before the maps are 557 * in drm_addmap. Therefore we add them manually before the maps are
558 * initialized, and tear them down on last close. 558 * initialized, and tear them down on last close.
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
index 8612378b131..5f2d5df01e5 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c
@@ -1017,7 +1017,7 @@ int vmw_gmr_id_alloc(struct vmw_private *dev_priv, uint32_t *p_id)
1017} 1017}
1018 1018
1019/* 1019/*
1020 * Stream managment 1020 * Stream management
1021 */ 1021 */
1022 1022
1023static void vmw_stream_destroy(struct vmw_resource *res) 1023static void vmw_stream_destroy(struct vmw_resource *res)