diff options
Diffstat (limited to 'usr/src/uts')
-rw-r--r-- | usr/src/uts/Makefile | 1 | ||||
-rw-r--r-- | usr/src/uts/common/drm/Makefile | 44 | ||||
-rw-r--r-- | usr/src/uts/common/io/drm/Makefile.mod | 66 | ||||
-rw-r--r-- | usr/src/uts/common/io/drm/drm_agpsupport.c | 41 | ||||
-rw-r--r-- | usr/src/uts/common/io/drm/drm_edid.c | 1 | ||||
-rw-r--r-- | usr/src/uts/common/io/drm/drm_gem.c | 2 | ||||
-rw-r--r-- | usr/src/uts/common/io/drm/drm_stub.c | 1 | ||||
-rw-r--r-- | usr/src/uts/common/io/drm/drm_sunmod.c | 6 | ||||
-rw-r--r-- | usr/src/uts/common/sys/gfx_private.h | 66 | ||||
-rw-r--r-- | usr/src/uts/intel/Makefile.files | 2 | ||||
-rw-r--r-- | usr/src/uts/intel/Makefile.intel | 8 | ||||
-rw-r--r-- | usr/src/uts/intel/drm/Makefile | 19 | ||||
-rw-r--r-- | usr/src/uts/intel/i915/Makefile | 30 | ||||
-rw-r--r-- | usr/src/uts/intel/io/i915/Make-PCI-ID-list.awk | 38 | ||||
-rw-r--r-- | usr/src/uts/intel/io/i915/Makefile.mod | 55 | ||||
-rw-r--r-- | usr/src/uts/intel/io/i915/i915_drv.c | 8 | ||||
-rw-r--r-- | usr/src/uts/intel/io/i915/i915_gem_execbuffer.c | 8 | ||||
-rw-r--r-- | usr/src/uts/intel/io/i915/i915_gem_gtt.c | 4 | ||||
-rw-r--r-- | usr/src/uts/intel/io/i915/i915_irq.c | 2 | ||||
-rw-r--r-- | usr/src/uts/intel/io/i915/intel_i2c.c | 2 |
20 files changed, 355 insertions, 49 deletions
diff --git a/usr/src/uts/Makefile b/usr/src/uts/Makefile index 04f58fe..88ef315 100644 --- a/usr/src/uts/Makefile +++ b/usr/src/uts/Makefile @@ -87,6 +87,7 @@ $($(MACH)_ARCHITECTURES): $(PREREQ_TARGET) FRC # isomorphic locations. # COMMON_HDRDIRS= \ + common/drm \ common/sys # diff --git a/usr/src/uts/common/drm/Makefile b/usr/src/uts/common/drm/Makefile new file mode 100644 index 0000000..659c070 --- /dev/null +++ b/usr/src/uts/common/drm/Makefile @@ -0,0 +1,44 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2016 <contributor> +# + + +include ../../../Makefile.master + +HDRS= \ + drm.h \ + drm_fourcc.h \ + drm_mode.h \ + drm_os_solaris.h \ + drm_sarea.h \ + i915_drm.h + + +ROOTDIR= $(ROOT)/usr/include/drm +ROOTHDRS= $(HDRS:%=$(ROOTDIR)/%) +CHECKHDRS= $(HDRS:%.h=%.check) + +$(ROOTDIR)/%: % + $(INS.file) + +$(ROOTDIR): + $(INS.dir) + +.KEEP_STATE: + +.PARALLEL: $(CHECKHDRS) + +install_h: $(ROOTDIR) $(ROOTHDRS) + +check: $(CHECKHDRS) diff --git a/usr/src/uts/common/io/drm/Makefile.mod b/usr/src/uts/common/io/drm/Makefile.mod new file mode 100644 index 0000000..74539d8 --- /dev/null +++ b/usr/src/uts/common/io/drm/Makefile.mod @@ -0,0 +1,66 @@ +# +# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +# +############################################################################### +# +# This Makefile.mod defines DRM_OBJS +# +############################################################################### + +DRM_OBJS = ati_pcigart.o \ + drm_agpsupport.o \ + drm_auth.o \ + drm_bufs.o \ + drm_cache.o \ + drm_context.o \ + drm_crtc.o \ + drm_crtc_helper.o \ + drm_dma.o \ + drm_dp_helper.o \ + drm_dp_i2c_helper.o \ + drm_drv.o \ + drm_edid.o \ + drm_fb_helper.o \ + drm_fops.o \ + drm_gem.o \ + drm_io32.o \ + drm_ioctl.o \ + drm_irq.o \ + drm_kstat.o \ + drm_linux.o \ + drm_lock.o \ + drm_memory.o \ + drm_mm.o \ + drm_modes.o \ + drm_msg.o \ + drm_pci.o \ + drm_rect.o \ + drm_scatter.o \ + drm_stub.o \ + drm_sun_i2c.o \ + drm_sun_idr.o \ + drm_sun_pci.o \ + drm_sun_timer.o \ + drm_sun_workqueue.o \ + drm_sunmod.o \ + drm_sysfs.o diff --git a/usr/src/uts/common/io/drm/drm_agpsupport.c b/usr/src/uts/common/io/drm/drm_agpsupport.c index 272ab43..f59ab56 100644 --- a/usr/src/uts/common/io/drm/drm_agpsupport.c +++ b/usr/src/uts/common/io/drm/drm_agpsupport.c @@ -555,13 +555,13 @@ drm_agp_bind_pages(struct drm_device *dev, uint32_t gtt_offset, unsigned int agp_type) { - agp_gtt_info_t bind; + agp_bind_pages_t bind; int ret, rval; - bind.agp_pgstart = gtt_offset / AGP_PAGE_SIZE; - bind.agp_npage = num_pages; - bind.agp_phyaddr = pages; - bind.agp_flags = agp_type; + bind.agpb_pgstart = gtt_offset / AGP_PAGE_SIZE; + bind.agpb_pgcount = num_pages; + bind.agpb_pages = pages; + bind.agpb_type = agp_type; ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_PAGES_BIND, (intptr_t)&bind, FKIOCTL, kcred, &rval); @@ -574,20 +574,19 @@ drm_agp_bind_pages(struct drm_device *dev, int drm_agp_unbind_pages(struct drm_device *dev, - pfn_t *pages, + pfn_t *pages, /* NULL */ unsigned long num_pages, uint32_t gtt_offset, pfn_t scratch, - uint32_t type) + uint32_t ignored) /* old "VT_switch" flag */ { - agp_gtt_info_t unbind; + agp_unbind_pages_t unbind; int ret, rval; - unbind.agp_pgstart = gtt_offset / AGP_PAGE_SIZE; - unbind.agp_npage = num_pages; - unbind.agp_type = type; - unbind.agp_phyaddr = pages; - unbind.agp_scratch = scratch; + unbind.agpu_pgstart = gtt_offset / AGP_PAGE_SIZE; + unbind.agpu_pgcount = num_pages; + unbind.agpu_scratch = scratch; + unbind.agpu_flags = 0; ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_PAGES_UNBIND, (intptr_t)&unbind, FKIOCTL, kcred, &rval); @@ -613,18 +612,18 @@ drm_agp_rw_gtt(struct drm_device *dev, unsigned long num_pages, uint32_t gtt_offset, void *gttp, - uint32_t type) + uint32_t rw_flag) /* read = 0 write = 1 */ { - agp_rw_gtt_t gtt_info; + agp_rw_gtt_t rw; int ret, rval; - gtt_info.pgstart = gtt_offset / AGP_PAGE_SIZE; - gtt_info.pgcount = num_pages; - gtt_info.addr = gttp; - /* read = 0 write = 1 */ - gtt_info.type = type; + rw.agprw_pgstart = gtt_offset / AGP_PAGE_SIZE; + rw.agprw_pgcount = num_pages; + rw.agprw_addr = gttp; + rw.agprw_flags = rw_flag; + ret = ldi_ioctl(dev->agp->agpgart_lh, AGPIOC_RW_GTT, - (intptr_t)>t_info, FKIOCTL, kcred, &rval); + (intptr_t)&rw, FKIOCTL, kcred, &rval); if (ret) { DRM_ERROR("AGPIOC_RW_GTT failed %d", ret); return -ret; diff --git a/usr/src/uts/common/io/drm/drm_edid.c b/usr/src/uts/common/io/drm/drm_edid.c index 15fe208..f1bf41b 100644 --- a/usr/src/uts/common/io/drm/drm_edid.c +++ b/usr/src/uts/common/io/drm/drm_edid.c @@ -2102,6 +2102,7 @@ static int drm_cvt_modes(struct drm_connector *connector, height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2; switch (cvt->code[1] & 0x0c) { + default: /* else gcc says: width may be used uninitialized... */ case 0x00: width = height * 4 / 3; break; diff --git a/usr/src/uts/common/io/drm/drm_gem.c b/usr/src/uts/common/io/drm/drm_gem.c index 0c5651c..ee88602 100644 --- a/usr/src/uts/common/io/drm/drm_gem.c +++ b/usr/src/uts/common/io/drm/drm_gem.c @@ -111,7 +111,7 @@ drm_gem_object_free_internal(struct drm_gem_object *obj, int gen) static ddi_dma_attr_t old_dma_attr = { DMA_ATTR_V0, - 0xff000U, /* dma_attr_addr_lo */ + 0, /* dma_attr_addr_lo */ 0xffffffffU, /* dma_attr_addr_hi */ 0xffffffffU, /* dma_attr_count_max */ 4096, /* dma_attr_align */ diff --git a/usr/src/uts/common/io/drm/drm_stub.c b/usr/src/uts/common/io/drm/drm_stub.c index 26501ac..5663336 100644 --- a/usr/src/uts/common/io/drm/drm_stub.c +++ b/usr/src/uts/common/io/drm/drm_stub.c @@ -353,7 +353,6 @@ static int drm_get_minor(struct drm_device *dev, struct drm_minor **minor, int t err_g2: -err_mem: kfree(new_minor, sizeof (*new_minor)); err_idr: (void) idr_remove(&drm_minors_idr, minor_id); diff --git a/usr/src/uts/common/io/drm/drm_sunmod.c b/usr/src/uts/common/io/drm/drm_sunmod.c index 24971ba..0f4ef47 100644 --- a/usr/src/uts/common/io/drm/drm_sunmod.c +++ b/usr/src/uts/common/io/drm/drm_sunmod.c @@ -237,6 +237,7 @@ drm_gem_map_access(devmap_cookie_t dhp, void *pvt, offset_t offset, size_t len, obj = (struct drm_gem_object *)pvt; if (obj == NULL) { + dev = NULL; /* avoid "used uninitialized" warning */ goto next; } @@ -645,6 +646,9 @@ drm_sun_devmap(dev_t dev_id, devmap_cookie_t dhp, offset_t offset, case _DRM_GEM: return (__devmap_gem(dev, dhp, map, maplen)); + + default: + break; } return (ENOTSUP); @@ -745,7 +749,7 @@ static struct modlmisc modlmisc = { }; static struct modlinkage modlinkage = { - MODREV_1, (void *)&modlmisc, NULL + MODREV_1, { (void *)&modlmisc, NULL } }; int diff --git a/usr/src/uts/common/sys/gfx_private.h b/usr/src/uts/common/sys/gfx_private.h index 5c85d89..ddd91e5 100644 --- a/usr/src/uts/common/sys/gfx_private.h +++ b/usr/src/uts/common/sys/gfx_private.h @@ -23,11 +23,16 @@ * Use is subject to license terms. */ +/* + * This file defines interfaces consumed by the AGP kernel modules, + * and indirectly by the DRM system. Please consider everything in + * this file to be a "contract private interface", and keep in sync + * with the consumers in the "DRM" gate. + */ + #ifndef _GFX_PRIVATE_H #define _GFX_PRIVATE_H -#pragma ident "%Z%%M% %I% %E% SMI" - #ifdef __cplusplus extern "C" { #endif @@ -96,6 +101,63 @@ extern int gfxp_munlock_user_memory(caddr_t address, size_t length); extern int gfxp_vgatext_devmap(dev_t dev, devmap_cookie_t dhp, offset_t off, size_t len, size_t *maplen, uint_t model, void *ptr); + +/* + * Updated "glue" for newer libdrm code. + * See: kernel/drm/src/drm_fb_helper.c + */ + +/* Same as: gfxp_vgatext_softc_ptr_t; */ +typedef char *gfxp_fb_softc_ptr_t; + +/* + * Used by drm_register_fbops(). + * Note: only setmode is supplied. + */ +struct gfxp_blt_ops { + int (*blt)(void *); + int (*copy) (void *); + int (*clear) (void *); + int (*setmode) (int); +}; + +extern void gfxp_bm_register_fbops(gfxp_fb_softc_ptr_t, + struct gfxp_blt_ops *); + +/* See: kernel/drm/src/drm_fb_helper.c */ + +struct gfxp_bm_fb_info { + uint16_t xres; + uint16_t yres; + uint8_t bpp; + uint8_t depth; +}; + +void gfxp_bm_getfb_info(gfxp_fb_softc_ptr_t, struct gfxp_bm_fb_info *); + +/* See: kernel/drm/src/drm_bufs.c etc */ + +caddr_t gfxp_alloc_kernel_space(size_t size); /* vmem_alloc heap_arena */ +void gfxp_free_kernel_space(caddr_t address, size_t size); + +void gfxp_load_kernel_space(uint64_t start, size_t size, + uint32_t mode, caddr_t cvaddr); +void gfxp_unload_kernel_space(caddr_t address, size_t size); + +/* + * Note that "mempool" is optional and normally disabled in drm_gem.c + * (see HAS_MEM_POOL). Let's just stub these out so we can reduce + * changes from the upstream in the DRM driver code. + */ +struct gfxp_pmem_cookie { + ulong_t a, b, c; +}; +void gfxp_mempool_init(void); +void gfxp_mempool_destroy(void); +int gfxp_alloc_from_mempool(struct gfxp_pmem_cookie *, caddr_t *, + pfn_t *, pgcnt_t, int); +void gfxp_free_mempool(struct gfxp_pmem_cookie *, caddr_t, size_t); + #ifdef __cplusplus } #endif diff --git a/usr/src/uts/intel/Makefile.files b/usr/src/uts/intel/Makefile.files index 60c9f65..5654c7d 100644 --- a/usr/src/uts/intel/Makefile.files +++ b/usr/src/uts/intel/Makefile.files @@ -77,6 +77,8 @@ CORE_OBJS += # Driver modules # + + # # Kernel linker # diff --git a/usr/src/uts/intel/Makefile.intel b/usr/src/uts/intel/Makefile.intel index a77fbc6..609acd9 100644 --- a/usr/src/uts/intel/Makefile.intel +++ b/usr/src/uts/intel/Makefile.intel @@ -184,7 +184,11 @@ ALL_DEFS = $(DEBUG_DEFS) $(OPTION_DEFS) # DRV_KMODS_32 are built only 32-bit # DRV_KMODS_64 are built only 64-bit # -DRV_KMODS += foo +DRV_KMODS += amd64_gart +DRV_KMODS += agpgart +DRV_KMODS += agptarget +DRV_KMODS += drm +DRV_KMODS += i915 # # Common code drivers @@ -226,7 +230,7 @@ SYS_KMODS += # MISC_KMODS_32 are built only 32-bit # MISC_KMODS_64 are built only 64-bit # -MISC_KMODS += +MISC_KMODS += agpmaster # # Software Cryptographic Providers (/kernel/crypto): diff --git a/usr/src/uts/intel/drm/Makefile b/usr/src/uts/intel/drm/Makefile index 1e48127..df5cc64 100644 --- a/usr/src/uts/intel/drm/Makefile +++ b/usr/src/uts/intel/drm/Makefile @@ -18,7 +18,7 @@ # # CDDL HEADER END # -# uts/intel/drm/Makefile + # # Copyright 2008 Sun Microsystems, Inc. All rights reserved. # Use is subject to license terms. @@ -39,10 +39,11 @@ MODULE = drm OBJECTS = $(DRM_OBJS:%=$(OBJS_DIR)/%) LINTS = $(DRM_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_MISC_DIR)/$(MODULE) -DRM_SRC = $(UTSBASE)/i86pc/io/drm -GFX_DIR = $(UTSBASE)/i86pc/io/gfx_private -INC_PATH += -I$(DRM_SRC) -I$(GFX_DIR) +CMN_DRM = $(UTSBASE)/common/drm + +# Includes +INC_PATH += -I$(CMN_DRM) # Dependency LDFLAGS += -dy -Nmisc/agpmaster -Nmisc/gfx_private @@ -51,9 +52,10 @@ LDFLAGS += -dy -Nmisc/agpmaster -Nmisc/gfx_private # Include common rules. # include $(UTSBASE)/intel/Makefile.intel +include $(UTSBASE)/common/io/drm/Makefile.mod CERRWARN += -_gcc=-Wno-parentheses -CERRWARN += -_gcc=-Wno-uninitialized +CERRWARN += -_gcc=-Wno-unused-function CERRWARN += -_gcc=-Wno-unused-variable # @@ -84,6 +86,13 @@ clean.lint: $(CLEAN_LINT_DEPS) install: $(INSTALL_DEPS) +$(OBJS_DIR)/%.o: $(UTSBASE)/common/io/drm/%.c + $(COMPILE.c) -o $@ $< + $(CTFCONVERT_O) + +$(LINTS_DIR)/%.ln: $(UTSBASE)/common/io/drm/%.c + @($(LHEAD) $(LINT.c) $< $(LTAIL)) + # # Include common targets. # diff --git a/usr/src/uts/intel/i915/Makefile b/usr/src/uts/intel/i915/Makefile index e0c2a30..ae5cddb 100644 --- a/usr/src/uts/intel/i915/Makefile +++ b/usr/src/uts/intel/i915/Makefile @@ -25,8 +25,6 @@ # # -# uts/intel/drm/Makefile -# # This makefile drives the production of i915 graphics device driver, # which supports the DRI (Direct Rendering Infrastructure), with the help # of drm common misc module. @@ -35,7 +33,7 @@ # # Path to the base of the uts directory tree (usually /usr/src/uts). # -UTSBASE = ../.. +UTSBASE = ../.. # # Define the module and object file sets. @@ -45,22 +43,27 @@ OBJECTS = $(I915_OBJS:%=$(OBJS_DIR)/%) LINTS = $(I915_OBJS:%.o=$(LINTS_DIR)/%.ln) ROOTMODULE = $(ROOT_DRV_DIR)/$(MODULE) -# i915 driver depends on drm, agpmaster and gfx_private misc modules -INC_PATH += -I$(UTSBASE)/intel/io/drm -I$(UTSBASE)/common/io/drm +CMN_DRM = $(UTSBASE)/common/drm -# -# dependency -LDFLAGS += -dy -Nmisc/drm +# Includes +INC_PATH += -I$(CMN_DRM) + +# Dependency +LDFLAGS += -dy -Nmisc/drm # # Include common rules. # include $(UTSBASE)/intel/Makefile.intel +include $(UTSBASE)/intel/io/i915/Makefile.mod -CERRWARN += -_gcc=-Wno-unused-label +CERRWARN += -_gcc=-Wno-parentheses +CERRWARN += -_gcc=-Wno-unused-function +CERRWARN += -_gcc=-Wno-unused-variable +CERRWARN += -_gcc=-Wno-override-init # -# Re-define targets +# Define targets # ALL_TARGET = $(BINARY) LINT_TARGET = $(MODULE).lint @@ -87,6 +90,13 @@ clean.lint: $(CLEAN_LINT_DEPS) install: $(INSTALL_DEPS) +$(OBJS_DIR)/%.o: $(UTSBASE)/intel/io/i915/%.c + $(COMPILE.c) -o $@ $< + $(CTFCONVERT_O) + +$(LINTS_DIR)/%.ln: $(UTSBASE)/intel/io/i915/%.c + @($(LHEAD) $(LINT.c) $< $(LTAIL)) + # # Include common targets. # diff --git a/usr/src/uts/intel/io/i915/Make-PCI-ID-list.awk b/usr/src/uts/intel/io/i915/Make-PCI-ID-list.awk new file mode 100644 index 0000000..61a14af --- /dev/null +++ b/usr/src/uts/intel/io/i915/Make-PCI-ID-list.awk @@ -0,0 +1,38 @@ +# +# Copyright 2016 Gordon W. Ross +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# +# Unix "awk" program to extract the supported list of PCI IDs from +# i915_drv.c and put in the form needed in our pkg manifest. +# Run like: nawk -f Make-PCI-ID-list.awk < i915_drv.c |sort +# +BEGIN { FS="[(,)]" } +/^\tINTEL_VGA_DEVICE/ { + id=tolower($2); + if (match(id, "^0x")) + id=substr(id,3); + while (match(id, "^0")) + id=substr(id,2); + printf(" alias=pci8086,%s \\\n", id) +} diff --git a/usr/src/uts/intel/io/i915/Makefile.mod b/usr/src/uts/intel/io/i915/Makefile.mod new file mode 100644 index 0000000..433f7cd --- /dev/null +++ b/usr/src/uts/intel/io/i915/Makefile.mod @@ -0,0 +1,55 @@ +# +# This file and its contents are supplied under the terms of the +# Common Development and Distribution License ("CDDL"), version 1.0. +# You may only use this file in accordance with the terms of version +# 1.0 of the CDDL. +# +# A full copy of the text of the CDDL should have accompanied this +# source. A copy of the CDDL is also available via the Internet at +# http://www.illumos.org/license/CDDL. +# + +# +# Copyright 2016 Gordon W. Ross +# + +I915_OBJS = \ + dvo_ch7017.o \ + dvo_ch7xxx.o \ + dvo_ivch.o \ + dvo_ns2501.o \ + dvo_sil164.o \ + dvo_tfp410.o \ + i915_dma.o \ + i915_drv.o \ + i915_gem.o \ + i915_gem_context.o \ + i915_gem_debug.o \ + i915_gem_evict.o \ + i915_gem_execbuffer.o \ + i915_gem_gtt.o \ + i915_gem_stolen.o \ + i915_gem_tiling.o \ + i915_io32.o \ + i915_irq.o \ + i915_suspend.o \ + i915_ums.o \ + intel_bios.o \ + intel_crt.o \ + intel_ddi.o \ + intel_display.o \ + intel_dp.o \ + intel_dvo.o \ + intel_fb.o \ + intel_hdmi.o \ + intel_i2c.o \ + intel_lvds.o \ + intel_modes.o \ + intel_overlay.o \ + intel_panel.o \ + intel_pm.o \ + intel_ringbuffer.o \ + intel_sdvo.o \ + intel_sideband.o \ + intel_sprite.o \ + intel_tv.o diff --git a/usr/src/uts/intel/io/i915/i915_drv.c b/usr/src/uts/intel/io/i915/i915_drv.c index d7bb151..89ff8bb 100644 --- a/usr/src/uts/intel/io/i915/i915_drv.c +++ b/usr/src/uts/intel/io/i915/i915_drv.c @@ -110,7 +110,7 @@ static struct modldrv modldrv = { }; static struct modlinkage modlinkage = { - MODREV_1, (void *) &modldrv, NULL + MODREV_1, { (void *) &modldrv, NULL } }; #define INTEL_VGA_DEVICE(id, info) { \ @@ -969,6 +969,9 @@ i915_attach(dev_info_t *dip, ddi_attach_cmd_t cmd) } return (i915_resume(dev)); + + default: + break; } DRM_ERROR("only supports attach or resume"); @@ -996,6 +999,9 @@ i915_detach(dev_info_t *dip, ddi_detach_cmd_t cmd) case DDI_SUSPEND: return (i915_suspend(dev)); + + default: + break; } DRM_ERROR("only supports detach or suspend"); diff --git a/usr/src/uts/intel/io/i915/i915_gem_execbuffer.c b/usr/src/uts/intel/io/i915/i915_gem_execbuffer.c index b32278b..e862c1c 100644 --- a/usr/src/uts/intel/io/i915/i915_gem_execbuffer.c +++ b/usr/src/uts/intel/io/i915/i915_gem_execbuffer.c @@ -751,7 +751,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, struct drm_clip_rect *cliprects = NULL; struct intel_ring_buffer *ring; u32 ctx_id = i915_execbuffer2_get_context_id(*args); - struct batch_info_list *node; + struct batch_info_list *node = NULL; u32 exec_start, exec_len; u32 mask, flags; int ret, mode, i; @@ -930,7 +930,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, obj->exec_entry = &exec[i]; eb_add_object(eb, obj); - if (MDB_TRACK_ENABLE) + /* + * The condition here was: if (MDB_TRACK_ENABLE)... + * but that caused GCC warnings. This is equivalent. + */ + if (node != NULL) node->obj_list[i] = (caddr_t)obj; TRACE_GEM_OBJ_HISTORY(obj, "prepare emit"); } diff --git a/usr/src/uts/intel/io/i915/i915_gem_gtt.c b/usr/src/uts/intel/io/i915/i915_gem_gtt.c index 2d9a554..a0db09e 100644 --- a/usr/src/uts/intel/io/i915/i915_gem_gtt.c +++ b/usr/src/uts/intel/io/i915/i915_gem_gtt.c @@ -559,14 +559,14 @@ void i915_ggtt_insert_entries(struct drm_i915_gem_object *obj, { struct drm_device *dev = obj->base.dev; - unsigned int flags = (cache_level == I915_CACHE_NONE) ? + unsigned int agp_type = (cache_level == I915_CACHE_NONE) ? AGP_USER_MEMORY : AGP_USER_CACHED_MEMORY; (void) drm_agp_bind_pages(dev, obj->base.pfnarray, obj->base.size >> PAGE_SHIFT, obj->gtt_offset, - flags); + agp_type); } static void i915_ggtt_clear_range(struct drm_device *dev, diff --git a/usr/src/uts/intel/io/i915/i915_irq.c b/usr/src/uts/intel/io/i915/i915_irq.c index 518efe6..323a38f 100644 --- a/usr/src/uts/intel/io/i915/i915_irq.c +++ b/usr/src/uts/intel/io/i915/i915_irq.c @@ -1164,6 +1164,8 @@ static irqreturn_t ivybridge_irq_handler(DRM_IRQ_ARGS) sde_ier = I915_READ(SDEIER); I915_WRITE(SDEIER, 0); POSTING_READ(SDEIER); + } else { + sde_ier = 0; /* Fix GCC "used unitialized" warning */ } /* On Haswell, also mask ERR_INT because we don't want to risk diff --git a/usr/src/uts/intel/io/i915/intel_i2c.c b/usr/src/uts/intel/io/i915/intel_i2c.c index a3d4ca1..900f940 100644 --- a/usr/src/uts/intel/io/i915/intel_i2c.c +++ b/usr/src/uts/intel/io/i915/intel_i2c.c @@ -462,7 +462,7 @@ gmbus_xfer(struct i2c_adapter *adapter, ret = -ETIMEDOUT; } I915_WRITE(GMBUS0 + reg_offset, 0); - ret = ret ?: i; + ret = ret ? ret : i; goto out; clear_err: |