Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-7]: src/sys/external/bsd/drm2 Pull up following revision(s) (requ...
details: https://anonhg.NetBSD.org/src/rev/d6e2aa057161
branches: netbsd-7
changeset: 798573:d6e2aa057161
user: martin <martin%NetBSD.org@localhost>
date: Fri Nov 14 14:22:41 2014 +0000
description:
Pull up following revision(s) (requested by snj in ticket #224):
sys/external/bsd/drm2/dist/drm/radeon/radeon_drv.c: revision 1.5
sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c: revision 1.6
sys/external/bsd/drm2/dist/drm/radeon/sumo_dpm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/atombios_dp.c: revision 1.4
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c: revision 1.9
sys/external/bsd/drm2/dist/drm/radeon/trinity_dpm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/r100.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/rv770_dpm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c: revision 1.3
sys/external/bsd/drm2/dist/drm/i915/i915_gem_tiling.c: revision 1.4
sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c: revision 1.4
sys/external/bsd/drm2/dist/drm/i915/intel_display.c: revision 1.13
sys/external/bsd/drm2/dist/drm/radeon/si_dpm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/kv_dpm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/kv_dpm.c: revision 1.4
sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c: revision 1.3
sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c: revision 1.4
sys/external/bsd/drm2/dist/drm/i915/intel_tv.c: revision 1.6
sys/external/bsd/drm2/ttm/ttm_bo_vm.c: revision 1.8
test some pointers and return EINVAL instead of blindly assuming
they're valid. converts kernel crashes in to app failures.
GL is still not working on evergreen for me.
Use %hhx for uint8_t, not %hx.
Mark some unused variables as such to shut up Clang.
Ifdef out nonsensical comparison until we update from upstream.
We don't use radeon_(un)register_atpx_handler at the moment.
Ifdef out another nonsensical comparison.
fix uninitialized
fix shadowing for min() and max() from libkern
Fix little C issues in i915drmkms hindering the Clang build.
- Test `x == NULL', not `&container_of(x, t, base)->base == NULL'.
- Fix format strings in intel_dp_probe_oui to use %hhx for uint8_t.
- Omit needless ioread32 in intel_overlay.c.
- Ifdef out unused definitions in intel_tv.c.
Update comment to reflect recent change to.
diffstat:
sys/external/bsd/drm2/dist/drm/i915/i915_gem_tiling.c | 12 ++++--
sys/external/bsd/drm2/dist/drm/i915/intel_display.c | 16 +++++---
sys/external/bsd/drm2/dist/drm/i915/intel_dp.c | 4 +-
sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c | 17 ++------
sys/external/bsd/drm2/dist/drm/i915/intel_tv.c | 4 ++
sys/external/bsd/drm2/dist/drm/radeon/atombios_dp.c | 4 +-
sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c | 38 +++++++++---------
sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c | 28 ++++++++++++--
sys/external/bsd/drm2/dist/drm/radeon/kv_dpm.c | 4 ++
sys/external/bsd/drm2/dist/drm/radeon/r100.c | 2 +
sys/external/bsd/drm2/dist/drm/radeon/radeon_drv.c | 2 +
sys/external/bsd/drm2/dist/drm/radeon/rv770_dpm.c | 10 ++--
sys/external/bsd/drm2/dist/drm/radeon/si_dpm.c | 28 +++++++-------
sys/external/bsd/drm2/dist/drm/radeon/sumo_dpm.c | 6 +-
sys/external/bsd/drm2/dist/drm/radeon/trinity_dpm.c | 6 +-
sys/external/bsd/drm2/ttm/ttm_bo_vm.c | 9 ++--
16 files changed, 111 insertions(+), 79 deletions(-)
diffs (truncated from 590 to 300 lines):
diff -r a5d11d99d156 -r d6e2aa057161 sys/external/bsd/drm2/dist/drm/i915/i915_gem_tiling.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_tiling.c Fri Nov 14 14:17:12 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_tiling.c Fri Nov 14 14:22:41 2014 +0000
@@ -295,12 +295,14 @@
{
struct drm_i915_gem_set_tiling *args = data;
struct drm_i915_private *dev_priv = dev->dev_private;
+ struct drm_gem_object *gobj;
struct drm_i915_gem_object *obj;
int ret = 0;
- obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
- if (&obj->base == NULL)
+ gobj = drm_gem_object_lookup(dev, file, args->handle);
+ if (gobj == NULL)
return -ENOENT;
+ obj = to_intel_bo(gobj);
if (!i915_tiling_ok(dev,
args->stride, obj->base.size, args->tiling_mode)) {
@@ -416,11 +418,13 @@
{
struct drm_i915_gem_get_tiling *args = data;
struct drm_i915_private *dev_priv = dev->dev_private;
+ struct drm_gem_object *gobj;
struct drm_i915_gem_object *obj;
- obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->handle));
- if (&obj->base == NULL)
+ gobj = drm_gem_object_lookup(dev, file, args->handle);
+ if (gobj == NULL)
return -ENOENT;
+ obj = to_intel_bo(gobj);
mutex_lock(&dev->struct_mutex);
diff -r a5d11d99d156 -r d6e2aa057161 sys/external/bsd/drm2/dist/drm/i915/intel_display.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_display.c Fri Nov 14 14:17:12 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_display.c Fri Nov 14 14:22:41 2014 +0000
@@ -2082,7 +2082,8 @@
{
struct drm_device *dev = crtc->base.dev;
struct drm_i915_gem_object *obj = NULL;
- struct drm_mode_fb_cmd2 mode_cmd = { .fb_id = 0 };
+ static const struct drm_mode_fb_cmd2 zero_mode_cmd;
+ struct drm_mode_fb_cmd2 mode_cmd = zero_mode_cmd;
u32 base = plane_config->base;
if (plane_config->size == 0)
@@ -7799,6 +7800,7 @@
struct drm_device *dev = crtc->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+ struct drm_gem_object *gobj;
struct drm_i915_gem_object *obj;
unsigned old_width;
uint32_t addr;
@@ -7821,9 +7823,10 @@
return -EINVAL;
}
- obj = to_intel_bo(drm_gem_object_lookup(dev, file, handle));
- if (&obj->base == NULL)
+ gobj = drm_gem_object_lookup(dev, file, handle);
+ if (gobj == NULL)
return -ENOENT;
+ obj = to_intel_bo(gobj);
if (obj->base.size < width * height * 4) {
DRM_DEBUG_KMS("buffer is to small\n");
@@ -11031,12 +11034,13 @@
struct drm_file *filp,
struct drm_mode_fb_cmd2 *mode_cmd)
{
+ struct drm_gem_object *gobj;
struct drm_i915_gem_object *obj;
- obj = to_intel_bo(drm_gem_object_lookup(dev, filp,
- mode_cmd->handles[0]));
- if (&obj->base == NULL)
+ gobj = drm_gem_object_lookup(dev, filp, mode_cmd->handles[0]);
+ if (gobj == NULL)
return ERR_PTR(-ENOENT);
+ obj = to_intel_bo(gobj);
return intel_framebuffer_create(dev, mode_cmd, obj);
}
diff -r a5d11d99d156 -r d6e2aa057161 sys/external/bsd/drm2/dist/drm/i915/intel_dp.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c Fri Nov 14 14:17:12 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c Fri Nov 14 14:22:41 2014 +0000
@@ -2907,11 +2907,11 @@
intel_edp_panel_vdd_on(intel_dp);
if (intel_dp_dpcd_read_wake(&intel_dp->aux, DP_SINK_OUI, buf, 3) == 3)
- DRM_DEBUG_KMS("Sink OUI: %02hx%02hx%02hx\n",
+ DRM_DEBUG_KMS("Sink OUI: %02hhx%02hhx%02hhx\n",
buf[0], buf[1], buf[2]);
if (intel_dp_dpcd_read_wake(&intel_dp->aux, DP_BRANCH_OUI, buf, 3) == 3)
- DRM_DEBUG_KMS("Branch OUI: %02hx%02hx%02hx\n",
+ DRM_DEBUG_KMS("Branch OUI: %02hhx%02hhx%02hhx\n",
buf[0], buf[1], buf[2]);
edp_panel_vdd_off(intel_dp, false);
diff -r a5d11d99d156 -r d6e2aa057161 sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c Fri Nov 14 14:17:12 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c Fri Nov 14 14:22:41 2014 +0000
@@ -173,15 +173,6 @@
# define __intel_overlay_iomem
# define __iomem __intel_overlay_iomem
-static inline uint32_t
-ioread32(const uint32_t __intel_overlay_iomem *ptr)
-{
- const uint32_t value = *ptr;
-
- __insn_barrier();
- return value;
-}
-
static inline void
iowrite32(uint32_t value, uint32_t __intel_overlay_iomem *ptr)
{
@@ -1061,6 +1052,7 @@
struct intel_overlay *overlay;
struct drm_mode_object *drmmode_obj;
struct intel_crtc *crtc;
+ struct drm_gem_object *new_gbo;
struct drm_i915_gem_object *new_bo;
struct put_image_params *params;
int ret;
@@ -1096,12 +1088,13 @@
}
crtc = to_intel_crtc(obj_to_crtc(drmmode_obj));
- new_bo = to_intel_bo(drm_gem_object_lookup(dev, file_priv,
- put_image_rec->bo_handle));
- if (&new_bo->base == NULL) {
+ new_gbo = drm_gem_object_lookup(dev, file_priv,
+ put_image_rec->bo_handle);
+ if (new_gbo == NULL) {
ret = -ENOENT;
goto out_free;
}
+ new_bo = to_intel_bo(new_gbo);
drm_modeset_lock_all(dev);
mutex_lock(&dev->struct_mutex);
diff -r a5d11d99d156 -r d6e2aa057161 sys/external/bsd/drm2/dist/drm/i915/intel_tv.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c Fri Nov 14 14:17:12 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c Fri Nov 14 14:22:41 2014 +0000
@@ -326,11 +326,13 @@
.rv = 0x0100, .gv = 0x03ad, .bv = 0x074d, .av = 0x0200,
};
+#ifndef __NetBSD__ /* XXX unused? */
static const struct color_conversion sdtv_csc_rgb = {
.ry = 0x0000, .gy = 0x0f00, .by = 0x0000, .ay = 0x0166,
.ru = 0x0000, .gu = 0x0000, .bu = 0x0f00, .au = 0x0166,
.rv = 0x0f00, .gv = 0x0000, .bv = 0x0000, .av = 0x0166,
};
+#endif
static const struct color_conversion hdtv_csc_yprpb = {
.ry = 0x05b3, .gy = 0x016e, .by = 0x0728, .ay = 0x0145,
@@ -338,11 +340,13 @@
.rv = 0x0100, .gv = 0x03d1, .bv = 0x06bc, .av = 0x0200,
};
+#ifndef __NetBSD__ /* XXX unused? */
static const struct color_conversion hdtv_csc_rgb = {
.ry = 0x0000, .gy = 0x0f00, .by = 0x0000, .ay = 0x0166,
.ru = 0x0000, .gu = 0x0000, .bu = 0x0f00, .au = 0x0166,
.rv = 0x0f00, .gv = 0x0000, .bv = 0x0000, .av = 0x0166,
};
+#endif
static const struct video_levels component_levels = {
.blank = 279, .black = 279, .burst = 0,
diff -r a5d11d99d156 -r d6e2aa057161 sys/external/bsd/drm2/dist/drm/radeon/atombios_dp.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/atombios_dp.c Fri Nov 14 14:17:12 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/atombios_dp.c Fri Nov 14 14:22:41 2014 +0000
@@ -371,11 +371,11 @@
return;
if (drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_SINK_OUI, buf, 3) == 3)
- DRM_DEBUG_KMS("Sink OUI: %02hx%02hx%02hx\n",
+ DRM_DEBUG_KMS("Sink OUI: %02hhx%02hhx%02hhx\n",
buf[0], buf[1], buf[2]);
if (drm_dp_dpcd_read(&radeon_connector->ddc_bus->aux, DP_BRANCH_OUI, buf, 3) == 3)
- DRM_DEBUG_KMS("Branch OUI: %02hx%02hx%02hx\n",
+ DRM_DEBUG_KMS("Branch OUI: %02hhx%02hhx%02hhx\n",
buf[0], buf[1], buf[2]);
}
diff -r a5d11d99d156 -r d6e2aa057161 sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c Fri Nov 14 14:17:12 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/ci_dpm.c Fri Nov 14 14:22:41 2014 +0000
@@ -64,7 +64,7 @@
{ 0x17C, 0x172, 0x180, 0x1BC, 0x1B3, 0x1BD, 0x206, 0x200, 0x203, 0x25D, 0x25A, 0x255, 0x2C3, 0x2C5, 0x2B4 }
};
-static const struct ci_pt_defaults defaults_bonaire_pro =
+static const struct ci_pt_defaults defaults_bonaire_pro __unused =
{
1, 0xF, 0xFD, 0x19, 5, 45, 0, 0x65062,
{ 0x8C, 0x23F, 0x244, 0xA6, 0x83, 0x85, 0x86, 0x86, 0x83, 0xDB, 0xDB, 0xDA, 0x67, 0x60, 0x5F },
@@ -78,7 +78,7 @@
{ 0x187, 0x187, 0x187, 0x1C7, 0x1C7, 0x1C7, 0x210, 0x210, 0x210, 0x266, 0x266, 0x266, 0x2C9, 0x2C9, 0x2C9 }
};
-static const struct ci_pt_defaults defaults_saturn_pro =
+static const struct ci_pt_defaults defaults_saturn_pro __unused =
{
1, 0xF, 0xFD, 0x19, 5, 55, 0, 0x30000,
{ 0x96, 0x21D, 0x23B, 0xA1, 0x85, 0x87, 0x83, 0x84, 0x81, 0xE6, 0xE6, 0xE6, 0x71, 0x6A, 0x6A },
@@ -361,29 +361,29 @@
struct ci_power_info *pi = ci_get_pi(rdev);
u8 *hi_vid = pi->smc_powertune_table.BapmVddCVidHiSidd;
u8 *lo_vid = pi->smc_powertune_table.BapmVddCVidLoSidd;
- int i, min, max;
-
- min = max = hi_vid[0];
+ int i, vmin, vmax;
+
+ vmin = vmax = hi_vid[0];
for (i = 0; i < 8; i++) {
if (0 != hi_vid[i]) {
- if (min > hi_vid[i])
- min = hi_vid[i];
- if (max < hi_vid[i])
- max = hi_vid[i];
+ if (vmin > hi_vid[i])
+ vmin = hi_vid[i];
+ if (vmax < hi_vid[i])
+ vmax = hi_vid[i];
}
if (0 != lo_vid[i]) {
- if (min > lo_vid[i])
- min = lo_vid[i];
- if (max < lo_vid[i])
- max = lo_vid[i];
+ if (vmin > lo_vid[i])
+ vmin = lo_vid[i];
+ if (vmax < lo_vid[i])
+ vmax = lo_vid[i];
}
}
- if ((min == 0) || (max == 0))
+ if ((vmin == 0) || (vmax == 0))
return -EINVAL;
- pi->smc_powertune_table.GnbLPMLMaxVid = (u8)max;
- pi->smc_powertune_table.GnbLPMLMinVid = (u8)min;
+ pi->smc_powertune_table.GnbLPMLMaxVid = (u8)vmax;
+ pi->smc_powertune_table.GnbLPMLMinVid = (u8)vmin;
return 0;
}
@@ -2028,15 +2028,15 @@
{
u32 i;
u32 tmp;
- u32 min = (min_sclk_in_sr > CISLAND_MINIMUM_ENGINE_CLOCK) ?
+ u32 vmin = (min_sclk_in_sr > CISLAND_MINIMUM_ENGINE_CLOCK) ?
min_sclk_in_sr : CISLAND_MINIMUM_ENGINE_CLOCK;
- if (sclk < min)
+ if (sclk < vmin)
return 0;
for (i = CISLAND_MAX_DEEPSLEEP_DIVIDER_ID; ; i--) {
tmp = sclk / (1 << i);
- if (tmp >= min || i == 0)
+ if (tmp >= vmin || i == 0)
break;
}
diff -r a5d11d99d156 -r d6e2aa057161 sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c
--- a/sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c Fri Nov 14 14:17:12 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/radeon/evergreen_cs.c Fri Nov 14 14:22:41 2014 +0000
@@ -446,21 +446,21 @@
*/
if (!surf.mode) {
volatile u32 *ib = p->ib.ptr;
- unsigned long tmp, nby, bsize, size, min = 0;
+ unsigned long tmp, nby, bsize, size, vmin = 0;
/* find the height the ddx wants */
if (surf.nby > 8) {
- min = surf.nby - 8;
+ vmin = surf.nby - 8;
}
bsize = radeon_bo_size(track->cb_color_bo[id]);
tmp = track->cb_color_bo_offset[id] << 8;
- for (nby = surf.nby; nby > min; nby--) {
+ for (nby = surf.nby; nby > vmin; nby--) {
size = nby * surf.nbx * surf.bpe * surf.nsamples;
Home |
Main Index |
Thread Index |
Old Index