Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/dist/drm Fix unused variable warnings ...



details:   https://anonhg.NetBSD.org/src/rev/2efff285f1c9
branches:  trunk
changeset: 327853:2efff285f1c9
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Mar 18 21:36:52 2014 +0000

description:
Fix unused variable warnings in drm2.

diffstat:

 sys/external/bsd/drm2/dist/drm/drm_fb_helper.c      |   7 +------
 sys/external/bsd/drm2/dist/drm/drm_global.c         |   2 --
 sys/external/bsd/drm2/dist/drm/drm_modes.c          |   8 ++++----
 sys/external/bsd/drm2/dist/drm/i915/i915_dma.c      |   4 +++-
 sys/external/bsd/drm2/dist/drm/i915/i915_irq.c      |   7 ++++---
 sys/external/bsd/drm2/dist/drm/i915/intel_display.c |  11 ++---------
 sys/external/bsd/drm2/dist/drm/i915/intel_dp.c      |   5 -----
 sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c    |   2 --
 8 files changed, 14 insertions(+), 32 deletions(-)

diffs (300 lines):

diff -r f69c34a660af -r 2efff285f1c9 sys/external/bsd/drm2/dist/drm/drm_fb_helper.c
--- a/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Tue Mar 18 20:39:55 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_fb_helper.c    Tue Mar 18 21:36:52 2014 +0000
@@ -1216,7 +1216,6 @@
        struct drm_connector *connector;
        struct drm_connector_helper_funcs *connector_funcs;
        struct drm_encoder *encoder;
-       struct drm_fb_helper_crtc *best_crtc;
        int my_score, best_score, score;
        struct drm_fb_helper_crtc **crtcs, *crtc;
        struct drm_fb_helper_connector *fb_helper_conn;
@@ -1228,7 +1227,6 @@
        connector = fb_helper_conn->connector;
 
        best_crtcs[n] = NULL;
-       best_crtc = NULL;
        best_score = drm_pick_crtcs(fb_helper, best_crtcs, modes, n+1, width, height);
        if (modes[n] == NULL)
                return best_score;
@@ -1277,7 +1275,6 @@
                score = my_score + drm_pick_crtcs(fb_helper, crtcs, modes, n + 1,
                                                  width, height);
                if (score > best_score) {
-                       best_crtc = crtc;
                        best_score = score;
                        memcpy(best_crtcs, crtcs,
                               dev->mode_config.num_connector *
@@ -1419,7 +1416,6 @@
 int drm_fb_helper_hotplug_event(struct drm_fb_helper *fb_helper)
 {
        struct drm_device *dev = fb_helper->dev;
-       int count = 0;
        u32 max_width, max_height, bpp_sel;
        int bound = 0, crtcs_bound = 0;
        struct drm_crtc *crtc;
@@ -1446,8 +1442,7 @@
        max_height = fb_helper->fb->height;
        bpp_sel = fb_helper->fb->bits_per_pixel;
 
-       count = drm_fb_helper_probe_connector_modes(fb_helper, max_width,
-                                                   max_height);
+       drm_fb_helper_probe_connector_modes(fb_helper, max_width, max_height);
        drm_setup_crtcs(fb_helper);
        mutex_unlock(&dev->mode_config.mutex);
 
diff -r f69c34a660af -r 2efff285f1c9 sys/external/bsd/drm2/dist/drm/drm_global.c
--- a/sys/external/bsd/drm2/dist/drm/drm_global.c       Tue Mar 18 20:39:55 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_global.c       Tue Mar 18 21:36:52 2014 +0000
@@ -75,7 +75,6 @@
 {
        int ret;
        struct drm_global_item *item = &glob[ref->global_type];
-       void *object;
 
        mutex_lock(&item->mutex);
        if (item->refcount == 0) {
@@ -93,7 +92,6 @@
        }
        ++item->refcount;
        ref->object = item->object;
-       object = item->object;
        mutex_unlock(&item->mutex);
        return 0;
 out_err:
diff -r f69c34a660af -r 2efff285f1c9 sys/external/bsd/drm2/dist/drm/drm_modes.c
--- a/sys/external/bsd/drm2/dist/drm/drm_modes.c        Tue Mar 18 20:39:55 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/drm_modes.c        Tue Mar 18 21:36:52 2014 +0000
@@ -173,7 +173,7 @@
                /* 3) Nominal HSync width (% of line period) - default 8 */
 #define CVT_HSYNC_PERCENTAGE   8
                unsigned int hblank_percentage;
-               int vsyncandback_porch, vback_porch, hblank;
+               int vsyncandback_porch, vback_porch __unused, hblank;
 
                /* estimated the horizontal period */
                tmp1 = HV_FACTOR * 1000000  -
@@ -321,9 +321,9 @@
        int top_margin, bottom_margin;
        int interlace;
        unsigned int hfreq_est;
-       int vsync_plus_bp, vback_porch;
-       unsigned int vtotal_lines, vfieldrate_est, hperiod;
-       unsigned int vfield_rate, vframe_rate;
+       int vsync_plus_bp, vback_porch __unused;
+       unsigned int vtotal_lines, vfieldrate_est __unused, hperiod __unused;
+       unsigned int vfield_rate, vframe_rate __unused;
        int left_margin, right_margin;
        unsigned int total_active_pixels, ideal_duty_cycle;
        unsigned int hblank, total_pixels, pixel_freq;
diff -r f69c34a660af -r 2efff285f1c9 sys/external/bsd/drm2/dist/drm/i915/i915_dma.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c    Tue Mar 18 20:39:55 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_dma.c    Tue Mar 18 21:36:52 2014 +0000
@@ -1170,17 +1170,19 @@
 {
        drm_i915_private_t *dev_priv = dev->dev_private;
        int reg = INTEL_INFO(dev)->gen >= 4 ? MCHBAR_I965 : MCHBAR_I915;
+#ifdef CONFIG_PNP
        u32 temp_lo, temp_hi = 0;
        u64 mchbar_addr;
+#endif
        int ret;
 
+#ifdef CONFIG_PNP
        if (INTEL_INFO(dev)->gen >= 4)
                pci_read_config_dword(dev_priv->bridge_dev, reg + 4, &temp_hi);
        pci_read_config_dword(dev_priv->bridge_dev, reg, &temp_lo);
        mchbar_addr = ((u64)temp_hi << 32) | temp_lo;
 
        /* If ACPI doesn't have it, assume we need to allocate it ourselves */
-#ifdef CONFIG_PNP
        if (mchbar_addr &&
            pnp_range_reserved(mchbar_addr, mchbar_addr + MCHBAR_SIZE))
                return 0;
diff -r f69c34a660af -r 2efff285f1c9 sys/external/bsd/drm2/dist/drm/i915/i915_irq.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c    Tue Mar 18 20:39:55 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_irq.c    Tue Mar 18 21:36:52 2014 +0000
@@ -384,6 +384,7 @@
        pm_imr = I915_READ(GEN6_PMIMR);
        I915_WRITE(GEN6_PMIMR, 0);
        spin_unlock_irq(&dev_priv->rps.lock);
+       __USE(pm_imr);          /* XXX reduce merge conflicts */
 
        if ((pm_iir & GEN6_PM_DEFERRED_EVENTS) == 0)
                return;
@@ -464,10 +465,12 @@
 
        kobject_uevent_env(&dev_priv->dev->primary->kdev.kobj,
                           KOBJ_CHANGE, parity_event);
+#endif
 
        DRM_DEBUG("Parity error: Row = %d, Bank = %d, Sub bank = %d.\n",
                  row, bank, subbank);
 
+#ifndef __NetBSD__             /* XXX kobject uevent...? */
        kfree(parity_event[3]);
        kfree(parity_event[2]);
        kfree(parity_event[1]);
@@ -547,7 +550,7 @@
        unsigned long irqflags;
        int pipe;
        u32 pipe_stats[I915_MAX_PIPES];
-       bool blc_event;
+       bool blc_event __unused;
 
        atomic_inc(&dev_priv->irq_received);
 
@@ -2211,7 +2214,6 @@
        u16 iir, new_iir;
        u32 pipe_stats[2];
        unsigned long irqflags;
-       int irq_received;
        int pipe;
        u16 flip_mask =
                I915_DISPLAY_PLANE_A_FLIP_PENDING_INTERRUPT |
@@ -2245,7 +2247,6 @@
                                        DRM_DEBUG_DRIVER("pipe %c underrun\n",
                                                         pipe_name(pipe));
                                I915_WRITE(reg, pipe_stats[pipe]);
-                               irq_received = 1;
                        }
                }
                spin_unlock_irqrestore(&dev_priv->irq_lock, irqflags);
diff -r f69c34a660af -r 2efff285f1c9 sys/external/bsd/drm2/dist/drm/i915/intel_display.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_display.c       Tue Mar 18 20:39:55 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_display.c       Tue Mar 18 21:36:52 2014 +0000
@@ -879,7 +879,7 @@
 {
        u32 p1, p2, m1, m2, vco, bestn, bestm1, bestm2, bestp1, bestp2;
        u32 m, n, fastclk;
-       u32 updrate, minupdate, fracbits, p;
+       u32 updrate, minupdate, p;
        unsigned long bestppm, ppm, absppm;
        int dotclk, flag;
 
@@ -890,7 +890,6 @@
        fastclk = dotclk / (2*100);
        updrate = 0;
        minupdate = 19200;
-       fracbits = 1;
        n = p = p1 = p2 = m = m1 = m2 = vco = bestn = 0;
        bestm1 = bestm2 = bestp1 = bestp2 = 0;
 
@@ -5167,7 +5166,6 @@
        struct drm_device *dev = crtc->dev;
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct intel_encoder *encoder;
-       struct intel_encoder *edp_encoder = NULL;
        int num_connectors = 0;
        bool is_lvds = false;
 
@@ -5177,7 +5175,6 @@
                        is_lvds = true;
                        break;
                case INTEL_OUTPUT_EDP:
-                       edp_encoder = encoder;
                        break;
                }
                num_connectors++;
@@ -8155,14 +8152,13 @@
        struct drm_crtc *new_crtc;
        struct intel_connector *connector;
        struct intel_encoder *encoder;
-       int count, ro;
+       int ro;
 
        /* The upper layers ensure that we either disabl a crtc or have a list
         * of connectors. For paranoia, double-check this. */
        WARN_ON(!set->fb && (set->num_connectors != 0));
        WARN_ON(set->fb && (set->num_connectors == 0));
 
-       count = 0;
        list_for_each_entry(connector, &dev->mode_config.connector_list,
                            base.head) {
                /* Otherwise traverse passed in connector list and get encoders
@@ -8196,7 +8192,6 @@
        /* connector->new_encoder is now updated for all connectors. */
 
        /* Update crtc of enabled connectors. */
-       count = 0;
        list_for_each_entry(connector, &dev->mode_config.connector_list,
                            base.head) {
                if (!connector->new_encoder)
@@ -9402,7 +9397,6 @@
 {
        struct drm_i915_private *dev_priv = dev->dev_private;
        struct drm_crtc *crtc;
-       struct intel_crtc *intel_crtc;
 
        drm_kms_helper_poll_fini(dev);
        mutex_lock(&dev->struct_mutex);
@@ -9415,7 +9409,6 @@
                if (!crtc->fb)
                        continue;
 
-               intel_crtc = to_intel_crtc(crtc);
                intel_increase_pllclock(crtc);
        }
 
diff -r f69c34a660af -r 2efff285f1c9 sys/external/bsd/drm2/dist/drm/i915/intel_dp.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c    Tue Mar 18 20:39:55 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c    Tue Mar 18 21:36:52 2014 +0000
@@ -1790,7 +1790,6 @@
        struct drm_device *dev = encoder->dev;
        int i;
        uint8_t voltage;
-       bool clock_recovery = false;
        int voltage_tries, loop_tries;
        uint32_t DP = intel_dp->DP;
 
@@ -1808,7 +1807,6 @@
        voltage = 0xff;
        voltage_tries = 0;
        loop_tries = 0;
-       clock_recovery = false;
        for (;;) {
                /* Use intel_dp->train_set[0] to set the voltage and pre emphasis values */
                uint8_t     link_status[DP_LINK_STATUS_SIZE];
@@ -1845,7 +1843,6 @@
 
                if (drm_dp_clock_recovery_ok(link_status, intel_dp->lane_count)) {
                        DRM_DEBUG_KMS("clock recovery OK\n");
-                       clock_recovery = true;
                        break;
                }
 
@@ -2878,7 +2875,6 @@
 {
        struct intel_digital_port *intel_dig_port;
        struct intel_encoder *intel_encoder;
-       struct drm_encoder *encoder;
        struct intel_connector *intel_connector;
 
        intel_dig_port = kzalloc(sizeof(struct intel_digital_port), GFP_KERNEL);
@@ -2892,7 +2888,6 @@
        }
 
        intel_encoder = &intel_dig_port->base;
-       encoder = &intel_encoder->base;
 
        drm_encoder_init(dev, &intel_encoder->base, &intel_dp_enc_funcs,
                         DRM_MODE_ENCODER_TMDS);
diff -r f69c34a660af -r 2efff285f1c9 sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c  Tue Mar 18 20:39:55 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_hdmi.c  Tue Mar 18 21:36:52 2014 +0000
@@ -1037,7 +1037,6 @@
 {
        struct intel_digital_port *intel_dig_port;
        struct intel_encoder *intel_encoder;
-       struct drm_encoder *encoder;
        struct intel_connector *intel_connector;
 
        intel_dig_port = kzalloc(sizeof(struct intel_digital_port), GFP_KERNEL);
@@ -1051,7 +1050,6 @@
        }
 
        intel_encoder = &intel_dig_port->base;
-       encoder = &intel_encoder->base;
 
        drm_encoder_init(dev, &intel_encoder->base, &intel_hdmi_enc_funcs,
                         DRM_MODE_ENCODER_TMDS);



Home | Main Index | Thread Index | Old Index