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/i915 Fix little C issues in i...
details: https://anonhg.NetBSD.org/src/rev/80f63d3d58a4
branches: trunk
changeset: 333512:80f63d3d58a4
user: riastradh <riastradh%NetBSD.org@localhost>
date: Thu Nov 06 12:47:48 2014 +0000
description:
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.
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 ++++
5 files changed, 29 insertions(+), 24 deletions(-)
diffs (179 lines):
diff -r e75ee1ef6236 -r 80f63d3d58a4 sys/external/bsd/drm2/dist/drm/i915/i915_gem_tiling.c
--- a/sys/external/bsd/drm2/dist/drm/i915/i915_gem_tiling.c Thu Nov 06 12:05:44 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/i915_gem_tiling.c Thu Nov 06 12:47:48 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 e75ee1ef6236 -r 80f63d3d58a4 sys/external/bsd/drm2/dist/drm/i915/intel_display.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_display.c Thu Nov 06 12:05:44 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_display.c Thu Nov 06 12:47:48 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 e75ee1ef6236 -r 80f63d3d58a4 sys/external/bsd/drm2/dist/drm/i915/intel_dp.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c Thu Nov 06 12:05:44 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_dp.c Thu Nov 06 12:47:48 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 e75ee1ef6236 -r 80f63d3d58a4 sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c Thu Nov 06 12:05:44 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_overlay.c Thu Nov 06 12:47:48 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 e75ee1ef6236 -r 80f63d3d58a4 sys/external/bsd/drm2/dist/drm/i915/intel_tv.c
--- a/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c Thu Nov 06 12:05:44 2014 +0000
+++ b/sys/external/bsd/drm2/dist/drm/i915/intel_tv.c Thu Nov 06 12:47:48 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,
Home |
Main Index |
Thread Index |
Old Index