mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 09:46:20 +00:00
parent
5424628ebd
commit
e1c451f19a
@ -1,84 +1,128 @@
|
||||
linux-3.14.5/drivers/char/agp/intel-gtt.c
|
||||
linux-3.14.5/drivers/char/agp/intel-agp.h
|
||||
linux-3.14.5/drivers/char/agp/agp.h
|
||||
linux-3.14.5/drivers/char/agp/generic.c
|
||||
linux-3.14.5/drivers/char/agp/backend.c
|
||||
linux-3.14.5/drivers/i2c/i2c-core.c
|
||||
linux-3.14.5/drivers/i2c/i2c-core.h
|
||||
linux-3.14.5/drivers/i2c/i2c-boardinfo.c
|
||||
linux-3.14.5/drivers/i2c/algos/i2c-algo-bit.c
|
||||
linux-3.14.5/drivers/gpu/drm/drm_mm.c
|
||||
linux-3.14.5/drivers/gpu/drm/drm_crtc.c
|
||||
linux-3.14.5/drivers/gpu/drm/drm_crtc_helper.c
|
||||
linux-3.14.5/drivers/gpu/drm/drm_edid.c
|
||||
linux-3.14.5/drivers/gpu/drm/drm_modes.c
|
||||
linux-3.14.5/drivers/gpu/drm/drm_dp_helper.c
|
||||
linux-3.14.5/drivers/gpu/drm/drm_fb_helper.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/i915_dma.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/i915_drv.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/i915_drv.h
|
||||
linux-3.14.5/drivers/gpu/drm/i915/i915_gem.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/i915_gem_stolen.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/i915_reg.h
|
||||
linux-3.14.5/drivers/gpu/drm/i915/i915_gem_gtt.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/i915_irq.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_bios.h
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_bios.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_crt.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_ddi.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_dp.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_drv.h
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_fbdev.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_hdmi.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_ringbuffer.h
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_display.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_panel.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_uncore.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_lvds.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_i2c.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_overlay.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_pm.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_modes.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_sideband.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_sdvo.c
|
||||
linux-3.14.5/drivers/gpu/drm/i915/intel_sdvo_regs.h
|
||||
linux-3.14.5/drivers/video/fbcmap.c
|
||||
linux-3.14.5/include/asm-generic/atomic64.h
|
||||
linux-3.14.5/include/asm-generic/ioctl.h
|
||||
linux-3.14.5/include/asm-generic/getorder.h
|
||||
linux-3.14.5/include/asm-generic/bitops/__ffs.h
|
||||
linux-3.14.5/include/asm-generic/bitops/__fls.h
|
||||
linux-3.14.5/include/asm-generic/bitops/ffs.h
|
||||
linux-3.14.5/include/asm-generic/bitops/fls.h
|
||||
linux-3.14.5/include/asm-generic/bitops/fls64.h
|
||||
linux-3.14.5/include/asm-generic/bitops/non-atomic.h
|
||||
linux-3.14.5/include/linux/agp_backend.h
|
||||
linux-3.14.5/include/linux/list.h
|
||||
linux-3.14.5/include/linux/list_sort.h
|
||||
linux-3.14.5/include/linux/log2.h
|
||||
linux-3.14.5/include/linux/pci_ids.h
|
||||
linux-3.14.5/include/linux/hdmi.h
|
||||
linux-3.14.5/include/linux/i2c-algo-bit.h
|
||||
linux-3.14.5/include/linux/i2c.h
|
||||
linux-3.14.5/include/linux/pm_runtime.h
|
||||
linux-3.14.5/include/drm/intel-gtt.h
|
||||
linux-3.14.5/include/drm/i915_pciids.h
|
||||
linux-3.14.5/include/drm/i915_drm.h
|
||||
linux-3.14.5/include/drm/drm_dp_helper.h
|
||||
linux-3.14.5/include/drm/drm_fb_helper.h
|
||||
linux-3.14.5/include/drm/drm_mm.h
|
||||
linux-3.14.5/include/drm/drm_crtc.h
|
||||
linux-3.14.5/include/drm/drm_crtc_helper.h
|
||||
linux-3.14.5/include/drm/drm_edid.h
|
||||
linux-3.14.5/include/uapi/drm/i915_drm.h
|
||||
linux-3.14.5/include/uapi/drm/drm.h
|
||||
linux-3.14.5/include/uapi/linux/pci_regs.h
|
||||
linux-3.14.5/include/uapi/linux/i2c.h
|
||||
linux-3.14.5/include/uapi/asm-generic/ioctl.h
|
||||
linux-3.14.5/include/uapi/drm/drm_fourcc.h
|
||||
linux-3.14.5/include/uapi/drm/drm_mode.h
|
||||
linux-3.14.5/include/uapi/linux/byteorder/little_endian.h
|
||||
linux-3.14.5/include/uapi/linux/swab.h
|
||||
linux-3.14.5/include/uapi/linux/fb.h
|
||||
linux-3.14.5/arch/x86/include/asm/agp.h
|
||||
linux-3.14.5/lib/list_sort.c
|
||||
linux-4.4.3/arch/x86/include/asm/agp.h
|
||||
linux-4.4.3/drivers/char/agp/agp.h
|
||||
linux-4.4.3/drivers/char/agp/backend.c
|
||||
linux-4.4.3/drivers/char/agp/generic.c
|
||||
linux-4.4.3/drivers/char/agp/intel-agp.h
|
||||
linux-4.4.3/drivers/char/agp/intel-gtt.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_atomic_helper.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_atomic.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_crtc.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_crtc_helper.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_crtc_internal.h
|
||||
linux-4.4.3/drivers/gpu/drm/drm_dp_helper.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_edid.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_internal.h
|
||||
linux-4.4.3/drivers/gpu/drm/drm_irq.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_mm.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_modes.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_modeset_lock.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_plane_helper.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_probe_helper.c
|
||||
linux-4.4.3/drivers/gpu/drm/drm_rect.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_dma.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_drv.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_drv.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_gem.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_gem_batch_pool.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_gem_context.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_gem_fence.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_gem_gtt.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_gem_gtt.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_gem_render_state.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_gem_stolen.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_guc_reg.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_irq.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_reg.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_vgpu.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/i915_vgpu.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_atomic.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_atomic_plane.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_bios.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_bios.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_crt.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_ddi.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_display.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_dp.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_drv.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_fbc.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_fifo_underrun.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_frontbuffer.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_guc.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_guc_fwif.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_hdmi.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_hotplug.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_i2c.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_lrc.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_lvds.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_modes.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_overlay.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_panel.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_pm.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_psr.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_ringbuffer.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_ringbuffer.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_runtime_pm.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_sdvo.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_sdvo_regs.h
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_sideband.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_sprite.c
|
||||
linux-4.4.3/drivers/gpu/drm/i915/intel_uncore.c
|
||||
linux-4.4.3/drivers/i2c/algos/i2c-algo-bit.c
|
||||
linux-4.4.3/drivers/i2c/i2c-boardinfo.c
|
||||
linux-4.4.3/drivers/i2c/i2c-core.c
|
||||
linux-4.4.3/drivers/i2c/i2c-core.h
|
||||
linux-4.4.3/drivers/video/hdmi.c
|
||||
linux-4.4.3/include/asm-generic/atomic64.h
|
||||
linux-4.4.3/include/asm-generic/bitops/__ffs.h
|
||||
linux-4.4.3/include/asm-generic/bitops/__fls.h
|
||||
linux-4.4.3/include/asm-generic/bitops/ffs.h
|
||||
linux-4.4.3/include/asm-generic/bitops/fls.h
|
||||
linux-4.4.3/include/asm-generic/bitops/fls64.h
|
||||
linux-4.4.3/include/asm-generic/bitops/non-atomic.h
|
||||
linux-4.4.3/include/asm-generic/getorder.h
|
||||
linux-4.4.3/include/asm-generic/ioctl.h
|
||||
linux-4.4.3/include/drm/drmP.h
|
||||
linux-4.4.3/include/drm/drm_agpsupport.h
|
||||
linux-4.4.3/include/drm/drm_atomic.h
|
||||
linux-4.4.3/include/drm/drm_atomic_helper.h
|
||||
linux-4.4.3/include/drm/drm_crtc.h
|
||||
linux-4.4.3/include/drm/drm_crtc_helper.h
|
||||
linux-4.4.3/include/drm/drm_displayid.h
|
||||
linux-4.4.3/include/drm/drm_dp_helper.h
|
||||
linux-4.4.3/include/drm/drm_dp_mst_helper.h
|
||||
linux-4.4.3/include/drm/drm_edid.h
|
||||
linux-4.4.3/include/drm/drm_gem.h
|
||||
linux-4.4.3/include/drm/drm_global.h
|
||||
linux-4.4.3/include/drm/drm_hashtab.h
|
||||
linux-4.4.3/include/drm/drm_legacy.h
|
||||
linux-4.4.3/include/drm/drm_mm.h
|
||||
linux-4.4.3/include/drm/drm_modes.h
|
||||
linux-4.4.3/include/drm/drm_modeset_lock.h
|
||||
linux-4.4.3/include/drm/drm_plane_helper.h
|
||||
linux-4.4.3/include/drm/drm_rect.h
|
||||
linux-4.4.3/include/drm/i915_drm.h
|
||||
linux-4.4.3/include/drm/i915_pciids.h
|
||||
linux-4.4.3/include/drm/intel-gtt.h
|
||||
linux-4.4.3/include/linux/agp_backend.h
|
||||
linux-4.4.3/include/linux/hdmi.h
|
||||
linux-4.4.3/include/linux/i2c-algo-bit.h
|
||||
linux-4.4.3/include/linux/i2c.h
|
||||
linux-4.4.3/include/linux/list.h
|
||||
linux-4.4.3/include/linux/list_sort.h
|
||||
linux-4.4.3/include/linux/log2.h
|
||||
linux-4.4.3/include/linux/pci_ids.h
|
||||
linux-4.4.3/include/linux/pm_runtime.h
|
||||
linux-4.4.3/include/linux/pm_wakeirq.h
|
||||
linux-4.4.3/include/uapi/asm-generic/ioctl.h
|
||||
linux-4.4.3/include/uapi/drm/drm.h
|
||||
linux-4.4.3/include/uapi/drm/drm_fourcc.h
|
||||
linux-4.4.3/include/uapi/drm/drm_mode.h
|
||||
linux-4.4.3/include/uapi/drm/i915_drm.h
|
||||
linux-4.4.3/include/uapi/linux/byteorder/little_endian.h
|
||||
linux-4.4.3/include/uapi/linux/fb.h
|
||||
linux-4.4.3/include/uapi/linux/i2c.h
|
||||
linux-4.4.3/include/uapi/linux/pci_regs.h
|
||||
linux-4.4.3/include/uapi/linux/swab.h
|
||||
linux-4.4.3/include/video/display_timing.h
|
||||
linux-4.4.3/include/video/videomode.h
|
||||
linux-4.4.3/lib/list_sort.c
|
||||
|
@ -3,7 +3,7 @@ SRC_DIR := $(REP_DIR)/src/drivers/framebuffer/intel
|
||||
|
||||
# architecture-dependent includes
|
||||
ifeq ($(filter-out $(SPECS),x86),)
|
||||
ARCH_SRC_INC_DIR += $(REP_DIR)/src/include/x86 \
|
||||
ARCH_SRC_INC_DIR += $(REP_DIR)/src/include/spec/x86 \
|
||||
$(LX_CONTRIB_DIR)/arch/x86/include
|
||||
ifeq ($(filter-out $(SPECS),32bit),)
|
||||
ARCH_SRC_INC_DIR += $(REP_DIR)/src/include/spec/x86_32
|
||||
|
@ -10,6 +10,7 @@ SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/i2c/algos/*.c))
|
||||
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/gpu/drm/*.c))
|
||||
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/gpu/drm/i915/*.c))
|
||||
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/video/*.c))
|
||||
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/drivers/video/fbdev/core/*.c))
|
||||
SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/lib/*.c))
|
||||
|
||||
#
|
||||
@ -17,7 +18,8 @@ SRC_C += $(notdir $(wildcard $(LX_CONTRIB_DIR)/lib/*.c))
|
||||
#
|
||||
CC_WARN = -Wall -Wno-uninitialized -Wno-unused-but-set-variable \
|
||||
-Wno-unused-variable -Wno-unused-function \
|
||||
-Wno-pointer-arith -Wno-pointer-sign
|
||||
-Wno-pointer-arith -Wno-pointer-sign \
|
||||
-Wno-int-to-pointer-cast
|
||||
|
||||
vpath %.c $(LX_CONTRIB_DIR)/drivers/char/agp
|
||||
vpath %.c $(LX_CONTRIB_DIR)/drivers/i2c
|
||||
@ -25,5 +27,6 @@ vpath %.c $(LX_CONTRIB_DIR)/drivers/i2c/algos
|
||||
vpath %.c $(LX_CONTRIB_DIR)/drivers/gpu/drm/i915
|
||||
vpath %.c $(LX_CONTRIB_DIR)/drivers/gpu/drm
|
||||
vpath %.c $(LX_CONTRIB_DIR)/drivers/video
|
||||
vpath %.c $(LX_CONTRIB_DIR)/drivers/video/fbdev/core
|
||||
vpath %.c $(LX_CONTRIB_DIR)/lib
|
||||
|
||||
|
@ -9,7 +9,7 @@ ifeq ($(called_from_lib_mk),yes)
|
||||
LX_CONTRIB_DIR := $(call select_from_ports,dde_linux)/src/drivers/framebuffer/intel
|
||||
LX_EMUL_H := $(REP_DIR)/src/drivers/framebuffer/intel/include/lx_emul.h
|
||||
|
||||
GEN_INCLUDES := $(shell grep -rh "^\#include .*\/" $(LX_CONTRIB_DIR) |\
|
||||
GEN_INCLUDES := $(shell grep -rh "^\#include .*" $(LX_CONTRIB_DIR) |\
|
||||
sed "s/^\#include [^<\"]*[<\"]\([^>\"]*\)[>\"].*/\1/" | sort | uniq)
|
||||
|
||||
#
|
||||
|
@ -1,13 +0,0 @@
|
||||
diff --git a/drivers/gpu/drm/i915/intel_fbdev.c b/drivers/gpu/drm/i915/intel_fbdev.c
|
||||
index 39eac99..3e67601 100644
|
||||
--- a/drivers/gpu/drm/i915/intel_fbdev.c
|
||||
+++ b/drivers/gpu/drm/i915/intel_fbdev.c
|
||||
@@ -293,7 +293,7 @@ void intel_fbdev_initial_config(struct drm_device *dev)
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
|
||||
/* Due to peculiar init order wrt to hpd handling this is separate. */
|
||||
- drm_fb_helper_initial_config(&dev_priv->fbdev->helper, 32);
|
||||
+ drm_fb_helper_initial_config(&dev_priv->fbdev->helper, 16);
|
||||
}
|
||||
|
||||
void intel_fbdev_fini(struct drm_device *dev)
|
@ -1,55 +0,0 @@
|
||||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
|
||||
index 2688f6d..ca178a2 100644
|
||||
--- a/drivers/gpu/drm/i915/intel_dp.c
|
||||
+++ b/drivers/gpu/drm/i915/intel_dp.c
|
||||
@@ -811,7 +811,9 @@ intel_dp_compute_config(struct intel_encoder *encoder,
|
||||
struct intel_crtc *intel_crtc = encoder->new_crtc;
|
||||
struct intel_connector *intel_connector = intel_dp->attached_connector;
|
||||
int lane_count, clock;
|
||||
+ int min_lane_count = 1;
|
||||
int max_lane_count = drm_dp_max_lane_count(intel_dp->dpcd);
|
||||
+ int min_clock = 0;
|
||||
int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0;
|
||||
int bpp, mode_rate;
|
||||
static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 };
|
||||
@@ -844,19 +846,33 @@ intel_dp_compute_config(struct intel_encoder *encoder,
|
||||
/* Walk through all bpp values. Luckily they're all nicely spaced with 2
|
||||
* bpc in between. */
|
||||
bpp = pipe_config->pipe_bpp;
|
||||
- if (is_edp(intel_dp) && dev_priv->vbt.edp_bpp &&
|
||||
- dev_priv->vbt.edp_bpp < bpp) {
|
||||
- DRM_DEBUG_KMS("clamping bpp for eDP panel to BIOS-provided %i\n",
|
||||
- dev_priv->vbt.edp_bpp);
|
||||
- bpp = dev_priv->vbt.edp_bpp;
|
||||
+ if (is_edp(intel_dp)) {
|
||||
+ if (dev_priv->vbt.edp_bpp && dev_priv->vbt.edp_bpp < bpp) {
|
||||
+ DRM_DEBUG_KMS("clamping bpp for eDP panel to BIOS-provided %i\n",
|
||||
+ dev_priv->vbt.edp_bpp);
|
||||
+ bpp = dev_priv->vbt.edp_bpp;
|
||||
+ }
|
||||
+
|
||||
+ if (dev_priv->vbt.edp_lanes) {
|
||||
+ min_lane_count = min(dev_priv->vbt.edp_lanes,
|
||||
+ max_lane_count);
|
||||
+ DRM_DEBUG_KMS("using min %u lanes per VBT\n",
|
||||
+ min_lane_count);
|
||||
+ }
|
||||
+
|
||||
+ if (dev_priv->vbt.edp_rate) {
|
||||
+ min_clock = min(dev_priv->vbt.edp_rate >> 3, max_clock);
|
||||
+ DRM_DEBUG_KMS("using min %02x link bw per VBT\n",
|
||||
+ bws[min_clock]);
|
||||
+ }
|
||||
}
|
||||
|
||||
for (; bpp >= 6*3; bpp -= 2*3) {
|
||||
mode_rate = intel_dp_link_required(adjusted_mode->crtc_clock,
|
||||
bpp);
|
||||
|
||||
- for (clock = 0; clock <= max_clock; clock++) {
|
||||
- for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
|
||||
+ for (lane_count = min_lane_count; lane_count <= max_lane_count; lane_count <<= 1) {
|
||||
+ for (clock = min_clock; clock <= max_clock; clock++) {
|
||||
link_clock = drm_dp_bw_code_to_link_rate(bws[clock]);
|
||||
link_avail = intel_dp_max_data_rate(link_clock,
|
||||
lane_count);
|
16
repos/dde_linux/patches/intel_fb_export_api.patch
Normal file
16
repos/dde_linux/patches/intel_fb_export_api.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
|
||||
index 32cf973..ec1d558 100644
|
||||
--- a/drivers/gpu/drm/i915/intel_display.c
|
||||
+++ b/drivers/gpu/drm/i915/intel_display.c
|
||||
@@ -15816,3 +15816,11 @@ void intel_modeset_preclose(struct drm_device *dev, struct drm_file *file)
|
||||
spin_unlock_irq(&dev->event_lock);
|
||||
}
|
||||
}
|
||||
+
|
||||
+struct drm_framebuffer *
|
||||
+dde_c_intel_framebuffer_create(struct drm_device *dev,
|
||||
+ struct drm_mode_fb_cmd2 *mode_cmd,
|
||||
+ struct drm_i915_gem_object *obj) {
|
||||
+ return intel_framebuffer_create(dev, mode_cmd, obj);
|
||||
+}
|
||||
+EXPORT_SYMBOL(dde_c_intel_framebuffer_create);
|
@ -1,12 +0,0 @@
|
||||
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
|
||||
index 98a0363..b00c6b7 100644
|
||||
--- a/drivers/gpu/drm/drm_fb_helper.c
|
||||
+++ b/drivers/gpu/drm/drm_fb_helper.c
|
||||
@@ -1505,6 +1505,7 @@ static void drm_setup_crtcs(struct drm_fb_helper *fb_helper)
|
||||
modeset->mode = NULL;
|
||||
}
|
||||
}
|
||||
+ update_genode_report();
|
||||
out:
|
||||
kfree(crtcs);
|
||||
kfree(modes);
|
@ -1,29 +0,0 @@
|
||||
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
|
||||
index 963639d..f926f21 100644
|
||||
--- a/drivers/gpu/drm/i915/intel_display.c
|
||||
+++ b/drivers/gpu/drm/i915/intel_display.c
|
||||
@@ -9867,6 +9867,11 @@ intel_set_config_compute_mode_changes(struct drm_mode_set *set,
|
||||
config->mode_changed = true;
|
||||
}
|
||||
|
||||
+ /**
|
||||
+ * Adaption made for Genode context: ensure connector always uses a new fb
|
||||
+ */
|
||||
+ config->fb_changed = true;
|
||||
+
|
||||
DRM_DEBUG_KMS("computed changes for [CRTC:%d], mode_changed=%d, fb_changed=%d\n",
|
||||
set->crtc->base.id, config->mode_changed, config->fb_changed);
|
||||
}
|
||||
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
|
||||
index 3b7d32d..637f713 100644
|
||||
--- a/drivers/gpu/drm/drm_crtc.c
|
||||
+++ b/drivers/gpu/drm/drm_crtc.c
|
||||
@@ -487,7 +487,7 @@ static void drm_framebuffer_free_bug(struct kref *kref)
|
||||
static void __drm_framebuffer_unreference(struct drm_framebuffer *fb)
|
||||
{
|
||||
DRM_DEBUG("FB ID: %d\n", fb->base.id);
|
||||
- kref_put(&fb->refcount, drm_framebuffer_free_bug);
|
||||
+ /*kref_put(&fb->refcount, drm_framebuffer_free_bug);*/
|
||||
}
|
||||
|
||||
/* dev->mode_config.fb_lock must be held! */
|
@ -1 +1 @@
|
||||
c63f9c4df89a087251bafa448b8fd99f04334564
|
||||
a226766f99897d980fa70f8bf24e09ad0c1d39ee
|
||||
|
@ -50,9 +50,9 @@ DIR(dwc_otg) := $(SRC_DIR_USB)/drivers/usb/host/dwc_otg
|
||||
# Intel framebuffer driver
|
||||
#
|
||||
SRC_DIR_INTEL_FB := src/drivers/framebuffer/intel
|
||||
VERSION_INTEL_FB := 3.14.5
|
||||
URL(intel_fb) := http://www.kernel.org/pub/linux/kernel/v3.x/linux-$(VERSION_INTEL_FB).tar.gz
|
||||
SHA(intel_fb) := 675bb3446cbf0889d59a048f6af177ca0a7aacb5
|
||||
VERSION_INTEL_FB := 4.4.3
|
||||
URL(intel_fb) := https://cdn.kernel.org/pub/linux/kernel/v4.x/linux-$(VERSION_INTEL_FB).tar.xz
|
||||
SHA(intel_fb) := 336d66925a15ce9077cbf2c38acbdc6c2644e33f
|
||||
DIR(intel_fb) := $(SRC_DIR_INTEL_FB)
|
||||
TAR_OPT(intel_fb) := --strip-components=1 --files-from $(REP_DIR)/intel_fb.list
|
||||
HASH_INPUT += $(REP_DIR)/intel_fb.list
|
||||
@ -160,6 +160,7 @@ PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/libnl*.pa
|
||||
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/lxip*.patch)))
|
||||
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/intel*.patch)))
|
||||
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/usb*.patch)))
|
||||
PATCHES += $(addprefix patches/,$(notdir $(wildcard $(REP_DIR)/patches/intel*.patch)))
|
||||
|
||||
#IP stack
|
||||
LXIP_OPT = -p1 -d$(SRC_DIR_LXIP)
|
||||
@ -182,13 +183,6 @@ PATCH_OPT(patches/libnl.patch) := -p1 -d ${DIR(libnl)}
|
||||
# WPA supplicant
|
||||
PATCH_OPT(patches/wpa_supplicant.patch) := -p1 -d ${DIR(wpa_supplicant)}
|
||||
|
||||
# Intel fb
|
||||
PATCH_OPT(patches/intel_fb_16bit.patch) := -p1 -d ${DIR(intel_fb)}
|
||||
PATCH_OPT(patches/intel_fb_edp.patch) := -p1 -d ${DIR(intel_fb)}
|
||||
PATCH_OPT(patches/intel_fb_update.patch) := -p1 -d ${DIR(intel_fb)}
|
||||
PATCH_OPT(patches/intel_fb_x201.patch) := -p1 -d ${DIR(intel_fb)}
|
||||
PATCH_OPT(patches/intel_fb_report.patch) := -p1 -d ${DIR(intel_fb)}
|
||||
|
||||
# USB
|
||||
USB_OPT = -p1 -d$(SRC_DIR_USB)
|
||||
PATCH_OPT(patches/usb_ax88179.patch) := $(USB_OPT)
|
||||
@ -197,4 +191,7 @@ PATCH_OPT(patches/usb_evdev.patch) := $(USB_OPT)
|
||||
PATCH_OPT(patches/usb_mem.patch) := $(USB_OPT)
|
||||
PATCH_OPT(patches/usb_usbnet.patch) := $(USB_OPT)
|
||||
|
||||
# INTEL FB
|
||||
PATCH_OPT(patches/intel_fb_export_api.patch) := -p1 -d$(SRC_DIR_INTEL_FB)
|
||||
|
||||
# vi: set ft=make :
|
||||
|
@ -8,6 +8,8 @@ set build_components {
|
||||
drivers/framebuffer/intel
|
||||
test/framebuffer
|
||||
server/report_rom
|
||||
server/ram_fs
|
||||
server/fs_rom
|
||||
}
|
||||
|
||||
source ${genode_dir}/repos/base/run/platform_drv.inc
|
||||
@ -22,7 +24,7 @@ create_boot_directory
|
||||
#
|
||||
|
||||
append config {
|
||||
<config verbose="yes">
|
||||
<config verbose="yes" prio_levels="2">
|
||||
<parent-provides>
|
||||
<service name="ROM"/>
|
||||
<service name="RAM"/>
|
||||
@ -45,7 +47,8 @@ append config {
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<provides><service name="Timer"/></provides>
|
||||
</start>
|
||||
<start name="report_rom">
|
||||
|
||||
<start name="report_rom" priority="-1">
|
||||
<resource name="RAM" quantum="2M"/>
|
||||
<provides> <service name="Report" /> <service name="ROM" /> </provides>
|
||||
<config verbose="yes">
|
||||
@ -83,13 +86,15 @@ append config {
|
||||
<start name="intel_fb_drv">
|
||||
<resource name="RAM" quantum="20M"/>
|
||||
<provides><service name="Framebuffer"/></provides>
|
||||
<configfile name="fb_drv.config"/>
|
||||
<route>
|
||||
<service name="ROM" label="fb_drv.config"> <child name="config_rom"/> </service>
|
||||
<service name="Report"> <child name="report_rom"/> </service>
|
||||
<any-service> <parent/> <any-child /> </any-service>
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="intel_fb_controller">
|
||||
<start name="intel_fb_controller" priority="-1">
|
||||
<resource name="RAM" quantum="1M"/>
|
||||
<route>
|
||||
<service name="File_system"> <child name="config_fs"/> </service>
|
||||
@ -98,7 +103,7 @@ append config {
|
||||
</route>
|
||||
</start>
|
||||
|
||||
<start name="test-framebuffer">
|
||||
<start name="test-framebuffer" priority="-1">
|
||||
<resource name="RAM" quantum="10M"/>
|
||||
</start>
|
||||
</config>}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,136 +0,0 @@
|
||||
/*
|
||||
* \brief Dummy functions
|
||||
* \author Norman Feske
|
||||
* \date 2015-08-18
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2015 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#include "lx_emul_private.h"
|
||||
|
||||
extern "C" {
|
||||
|
||||
#include <drm/drmP.h>
|
||||
#include <i915/i915_drv.h>
|
||||
|
||||
/*
|
||||
* Incorporate dummy implemementations semi-automaticall generated via the
|
||||
* 'gen_dummy' script.
|
||||
*/
|
||||
|
||||
#include "gen_dummies.h"
|
||||
|
||||
/*
|
||||
* Manually defined dummies (because they are not covered by the heuristics
|
||||
* of the 'gen_dummy' script).
|
||||
*/
|
||||
|
||||
struct timespec timespec_sub(struct timespec lhs, struct timespec rhs)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return { 0, 0 };
|
||||
}
|
||||
|
||||
struct timespec ns_to_timespec(const s64 nsec)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return { 0, 0 };
|
||||
}
|
||||
|
||||
bool capable(int cap)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return false;
|
||||
}
|
||||
|
||||
int i915_gem_execbuffer(struct drm_device *dev, void *data, struct drm_file *file_priv)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int i915_gem_execbuffer2(struct drm_device *dev, void *data, struct drm_file *file_priv)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int i915_gem_set_tiling(struct drm_device *dev, void *data, struct drm_file *file)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return -1;
|
||||
}
|
||||
|
||||
int i915_gem_get_tiling(struct drm_device *dev, void *data, struct drm_file *file)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool flush_delayed_work(struct delayed_work *dwork)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return false;
|
||||
}
|
||||
|
||||
void down_read(struct rw_semaphore *sem)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
}
|
||||
|
||||
void device_unregister(struct device *dev)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
}
|
||||
|
||||
int i2c_algo_bit_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg msgs[], int num)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return -1;
|
||||
}
|
||||
|
||||
u32 i2c_algo_bit_func(struct i2c_adapter *adap)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void i915_setup_sysfs(struct drm_device *dev_priv)
|
||||
{
|
||||
TRACE;
|
||||
}
|
||||
|
||||
int acpi_video_register(void)
|
||||
{
|
||||
TRACE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void ips_link_to_i915_driver(void)
|
||||
{
|
||||
TRACE;
|
||||
}
|
||||
|
||||
void spin_lock(spinlock_t *lock)
|
||||
{
|
||||
TRACE;
|
||||
}
|
||||
|
||||
void drm_sysfs_hotplug_event(struct drm_device *dev)
|
||||
{
|
||||
TRACE;
|
||||
}
|
||||
|
||||
const char *acpi_dev_name(struct acpi_device *)
|
||||
{
|
||||
TRACE_AND_STOP;
|
||||
return 0;
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
||||
|
@ -17,7 +17,7 @@
|
||||
# with the signature of the declarated function.
|
||||
#
|
||||
|
||||
set symbol $argv
|
||||
set symbol [lindex $argv 0]
|
||||
|
||||
# determine contrib directory of dde_linux
|
||||
set lx_drv_path [exec ../../../../../../tool/ports/current dde_linux]
|
||||
|
35
repos/dde_linux/src/drivers/framebuffer/intel/i915_params.c
Normal file
35
repos/dde_linux/src/drivers/framebuffer/intel/i915_params.c
Normal file
@ -0,0 +1,35 @@
|
||||
#include <../drivers/gpu/drm/i915/i915_drv.h>
|
||||
|
||||
struct i915_params i915 = {
|
||||
.modeset = -1,
|
||||
.panel_ignore_lid = 1,
|
||||
.semaphores = -1,
|
||||
.lvds_channel_mode = 0,
|
||||
.panel_use_ssc = -1,
|
||||
.vbt_sdvo_panel_type = -1,
|
||||
.enable_rc6 = -1,
|
||||
.enable_fbc = -1,
|
||||
.enable_execlists = -1,
|
||||
.enable_hangcheck = false,
|
||||
.enable_ppgtt = -1,
|
||||
.enable_psr = 0,
|
||||
.preliminary_hw_support = true,
|
||||
.disable_power_well = -1,
|
||||
.enable_ips = 1,
|
||||
.fastboot = 0,
|
||||
.prefault_disable = 0,
|
||||
.load_detect_test = 0,
|
||||
.reset = true,
|
||||
.invert_brightness = 0,
|
||||
.disable_display = 0,
|
||||
.enable_cmd_parser = 1,
|
||||
.disable_vtd_wa = 0,
|
||||
.use_mmio_flip = 0,
|
||||
.mmio_debug = 0,
|
||||
.verbose_state_checks = 1,
|
||||
.nuclear_pageflip = 0,
|
||||
.edp_vswing = 0,
|
||||
.enable_guc_submission = false,
|
||||
.guc_log_level = -1,
|
||||
};
|
||||
|
@ -25,64 +25,102 @@
|
||||
#include <os/attached_ram_dataspace.h>
|
||||
#include <blit/blit.h>
|
||||
|
||||
struct drm_display_mode;
|
||||
struct drm_connector;
|
||||
struct drm_framebuffer;
|
||||
|
||||
namespace Framebuffer {
|
||||
class Driver;
|
||||
class Session_component;
|
||||
class Root;
|
||||
|
||||
extern Root * root;
|
||||
Genode::Dataspace_capability framebuffer_dataspace();
|
||||
}
|
||||
|
||||
|
||||
class Framebuffer::Driver
|
||||
{
|
||||
private:
|
||||
|
||||
Session_component &_session;
|
||||
int _height = 0;
|
||||
int _width = 0;
|
||||
static constexpr unsigned _bytes_per_pixel = 2;
|
||||
void *_new_fb_ds_base = nullptr;
|
||||
void *_cur_fb_ds_base = nullptr;
|
||||
Genode::uint64_t _cur_fb_ds_size = 0;
|
||||
drm_framebuffer *_new_fb = nullptr;
|
||||
drm_framebuffer *_cur_fb = nullptr;
|
||||
|
||||
drm_display_mode * _preferred_mode(drm_connector *connector);
|
||||
|
||||
public:
|
||||
|
||||
Driver(Session_component &session) : _session(session) {}
|
||||
|
||||
int width() const { return _width; }
|
||||
int height() const { return _height; }
|
||||
unsigned bpp() const { return _bytes_per_pixel; }
|
||||
|
||||
Genode::size_t size() const {
|
||||
return _width * _height * _bytes_per_pixel; }
|
||||
|
||||
void finish_initialization();
|
||||
bool mode_changed();
|
||||
void generate_report();
|
||||
void free_framebuffer();
|
||||
Genode::Dataspace_capability dataspace();
|
||||
};
|
||||
|
||||
|
||||
class Framebuffer::Session_component : public Genode::Rpc_object<Session>
|
||||
{
|
||||
private:
|
||||
|
||||
template <typename T> using Lazy = Genode::Lazy_volatile_object<T>;
|
||||
|
||||
int _height;
|
||||
int _width;
|
||||
Driver _driver;
|
||||
Genode::Signal_context_capability _mode_sigh;
|
||||
Timer::Connection _timer;
|
||||
bool const _buffered;
|
||||
Lazy<Genode::Attached_dataspace> _fb_ds;
|
||||
Lazy<Genode::Attached_ram_dataspace> _bb_ds;
|
||||
bool _in_update = false;
|
||||
static constexpr unsigned _bytes_per_pixel = 2;
|
||||
|
||||
void _refresh_buffered(int x, int y, int w, int h)
|
||||
{
|
||||
using namespace Genode;
|
||||
|
||||
int width = _driver.width(), height = _driver.height();
|
||||
unsigned bpp = _driver.bpp();
|
||||
|
||||
/* clip specified coordinates against screen boundaries */
|
||||
int x2 = min(x + w - 1, (int)_width - 1),
|
||||
y2 = min(y + h - 1, (int)_height - 1);
|
||||
int x2 = min(x + w - 1, width - 1),
|
||||
y2 = min(y + h - 1, height - 1);
|
||||
int x1 = max(x, 0),
|
||||
y1 = max(y, 0);
|
||||
if (x1 > x2 || y1 > y2) return;
|
||||
|
||||
int const bpp = _bytes_per_pixel;
|
||||
|
||||
/* copy pixels from back buffer to physical frame buffer */
|
||||
char *src = _bb_ds->local_addr<char>() + bpp*(_width*y1 + x1),
|
||||
*dst = _fb_ds->local_addr<char>() + bpp*(_width*y1 + x1);
|
||||
char *src = _bb_ds->local_addr<char>() + bpp*(width*y1 + x1),
|
||||
*dst = _fb_ds->local_addr<char>() + bpp*(width*y1 + x1);
|
||||
|
||||
blit(src, bpp*_width, dst, bpp*_width,
|
||||
blit(src, bpp*width, dst, bpp*width,
|
||||
bpp*(x2 - x1 + 1), y2 - y1 + 1);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
Session_component(bool buffered)
|
||||
: _height(0), _width(0), _buffered(buffered) {}
|
||||
: _driver(*this), _buffered(buffered) {}
|
||||
|
||||
void update(int height, int width)
|
||||
Driver & driver() { return _driver; }
|
||||
|
||||
void config_changed()
|
||||
{
|
||||
_in_update = true;
|
||||
_height = height;
|
||||
_width = width;
|
||||
|
||||
if (_mode_sigh.valid())
|
||||
if (_driver.mode_changed() && _mode_sigh.valid())
|
||||
Genode::Signal_transmitter(_mode_sigh).submit();
|
||||
else
|
||||
_in_update = false;
|
||||
}
|
||||
|
||||
|
||||
@ -97,14 +135,16 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Session>
|
||||
if (_fb_ds.constructed())
|
||||
_fb_ds.destruct();
|
||||
|
||||
_fb_ds.construct(framebuffer_dataspace());
|
||||
if (!_fb_ds.constructed())
|
||||
_fb_ds.construct(_driver.dataspace());
|
||||
if (!_fb_ds.is_constructed())
|
||||
PERR("framebuffer dataspace not initialized");
|
||||
|
||||
if (_buffered) {
|
||||
_bb_ds.construct(Genode::env()->ram_session(),
|
||||
_width * _height * _bytes_per_pixel);
|
||||
if (!_bb_ds.constructed()) {
|
||||
if (_bb_ds.is_constructed())
|
||||
_bb_ds.destruct();
|
||||
|
||||
_bb_ds.construct(Genode::env()->ram_session(), _driver.size());
|
||||
if (!_bb_ds.is_constructed()) {
|
||||
PERR("buffered mode enabled, but buffer not initialized");
|
||||
return Genode::Dataspace_capability();
|
||||
}
|
||||
@ -115,7 +155,7 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Session>
|
||||
}
|
||||
|
||||
Mode mode() const override {
|
||||
return Mode(_width, _height, Mode::RGB565); }
|
||||
return Mode(_driver.width(), _driver.height(), Mode::RGB565); }
|
||||
|
||||
void mode_sigh(Genode::Signal_context_capability sigh) override {
|
||||
_mode_sigh = sigh; }
|
||||
@ -131,27 +171,18 @@ class Framebuffer::Session_component : public Genode::Rpc_object<Session>
|
||||
};
|
||||
|
||||
|
||||
class Framebuffer::Root
|
||||
: public Genode::Root_component<Framebuffer::Session_component,
|
||||
Genode::Single_client>
|
||||
struct Framebuffer::Root
|
||||
: Genode::Root_component<Framebuffer::Session_component, Genode::Single_client>
|
||||
{
|
||||
private:
|
||||
Session_component session; /* single session */
|
||||
|
||||
Session_component _single_session;
|
||||
Session_component *_create_session(const char *args) override {
|
||||
return &session; }
|
||||
|
||||
Session_component *_create_session(const char *args) override {
|
||||
return &_single_session; }
|
||||
|
||||
public:
|
||||
|
||||
Root(Genode::Rpc_entrypoint *session_ep, Genode::Allocator *md_alloc,
|
||||
bool buffered)
|
||||
: Genode::Root_component<Session_component,
|
||||
Genode::Single_client>(session_ep, md_alloc),
|
||||
_single_session(buffered) { }
|
||||
|
||||
void update(int height, int width) {
|
||||
_single_session.update(height, width); }
|
||||
Root(Genode::Rpc_entrypoint *ep, Genode::Allocator *alloc, bool buffered)
|
||||
: Genode::Root_component<Session_component,
|
||||
Genode::Single_client>(ep, alloc),
|
||||
session(buffered) { }
|
||||
};
|
||||
|
||||
#endif /* __COMPONENT_H__ */
|
||||
|
@ -1,713 +0,0 @@
|
||||
/*
|
||||
* \brief Platform interface of DRM code
|
||||
* \author Norman Feske
|
||||
* \date 2015-08-19
|
||||
*/
|
||||
|
||||
#ifndef _DRMP_H_
|
||||
#define _DRMP_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* local includes */
|
||||
#include <lx_emul.h>
|
||||
|
||||
/*
|
||||
* Unfortunately, DRM headers use certain C++ keywords as variable names.
|
||||
* To enable the inclusion of 'drmP.h' from C++ source codes, we have to
|
||||
* rename these identifiers.
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
#define new _new
|
||||
#define virtual _virtual
|
||||
#define private _private
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#include <uapi/drm/drm.h>
|
||||
#include <uapi/drm/i915_drm.h>
|
||||
#include <uapi/drm/drm_fourcc.h>
|
||||
#include <uapi/drm/drm_mode.h>
|
||||
|
||||
#include <drm/i915_pciids.h>
|
||||
#include <drm/drm_mm.h>
|
||||
#include <drm/drm_crtc.h>
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#undef virtual
|
||||
#undef new
|
||||
#undef private
|
||||
#endif /* __cplusplus */
|
||||
|
||||
extern unsigned int drm_debug;
|
||||
|
||||
|
||||
/*******************
|
||||
** DRM constants **
|
||||
*******************/
|
||||
|
||||
enum {
|
||||
DRM_MINOR_CONTROL = 2,
|
||||
// DRM_MINOR_RENDER = 3,
|
||||
// DRM_MAGIC_HASH_ORDER = 4,
|
||||
};
|
||||
|
||||
enum {
|
||||
DRM_AUTH = 0x1,
|
||||
DRM_MASTER = 0x2,
|
||||
DRM_ROOT_ONLY = 0x4,
|
||||
DRM_CONTROL_ALLOW = 0x8,
|
||||
DRM_UNLOCKED = 0x10,
|
||||
DRM_RENDER_ALLOW = 0x20,
|
||||
};
|
||||
|
||||
enum {
|
||||
DRIVER_USE_AGP = 0x1,
|
||||
DRIVER_REQUIRE_AGP = 0x2,
|
||||
DRIVER_HAVE_IRQ = 0x40,
|
||||
DRIVER_IRQ_SHARED = 0x80,
|
||||
DRIVER_GEM = 0x1000,
|
||||
DRIVER_MODESET = 0x2000,
|
||||
DRIVER_PRIME = 0x4000,
|
||||
DRIVER_RENDER = 0x8000,
|
||||
};
|
||||
|
||||
//enum { DRM_HZ = HZ };
|
||||
|
||||
enum {
|
||||
DRM_SCANOUTPOS_VALID = (1 << 0),
|
||||
DRM_SCANOUTPOS_INVBL = (1 << 1),
|
||||
DRM_SCANOUTPOS_ACCURATE = (1 << 2),
|
||||
};
|
||||
|
||||
enum { DRM_CALLED_FROM_VBLIRQ = 1 };
|
||||
|
||||
//enum {
|
||||
// DRM_CONNECTOR_POLL_HPD = 1 << 0,
|
||||
// DRM_CONNECTOR_POLL_CONNECT = 1 << 1,
|
||||
// DRM_CONNECTOR_POLL_DISCONNECT = 1 << 2,
|
||||
//};
|
||||
|
||||
|
||||
/****************
|
||||
** DRM macros **
|
||||
****************/
|
||||
|
||||
#define obj_to_crtc(x) container_of(x, struct drm_crtc, base)
|
||||
|
||||
///*
|
||||
// * Type and function mappings
|
||||
// */
|
||||
//#define DRM_IRQ_ARGS void *arg
|
||||
//#define DRM_ARRAY_SIZE ARRAY_SIZE
|
||||
//#define DRM_WAKEUP wake_up
|
||||
//#define DRM_INIT_WAITQUEUE init_waitqueue_head
|
||||
//#define DRM_AGP_KERN struct agp_kern_info
|
||||
//#define DRM_AGP_MEM struct agp_memory
|
||||
//#define DRM_COPY_TO_USER copy_to_user
|
||||
//
|
||||
///*
|
||||
// * Debug macros
|
||||
// */
|
||||
#define DRM_VERBOSE 0
|
||||
|
||||
#if DRM_VERBOSE
|
||||
#define DRM_INFO(fmt, arg...) do { \
|
||||
lx_printfln("[" DRM_NAME ":%s] *INFO* " fmt , __func__ , ##arg); } while (0)
|
||||
|
||||
#define DRM_ERROR(fmt, arg...) do { \
|
||||
lx_printfln("[" DRM_NAME ":%s] *ERROR* " fmt , __func__ , ##arg); } while (0)
|
||||
|
||||
#define DRM_DEBUG(fmt, arg...) do { \
|
||||
lx_printfln("[" DRM_NAME ":%s] *DEBUG* " fmt , __func__ , ##arg); } while (0)
|
||||
|
||||
#define DRM_DEBUG_DRIVER(fmt, arg...) do { \
|
||||
lx_printfln("[" DRM_NAME ":%s] *DRIVER* " fmt , __func__ , ##arg); } while (0)
|
||||
|
||||
#define DRM_DEBUG_KMS(fmt, arg...) do { \
|
||||
lx_printfln("[" DRM_NAME ":%s] *KMS* " fmt , __func__ , ##arg); } while (0)
|
||||
#else
|
||||
#define DRM_INFO(fmt, arg...) do { } while (0)
|
||||
#define DRM_ERROR(fmt, arg...) do { } while (0)
|
||||
#define DRM_DEBUG(fmt, arg...) do { } while (0)
|
||||
#define DRM_DEBUG_DRIVER(fmt, arg...) do { } while (0)
|
||||
#define DRM_DEBUG_KMS(fmt, arg...) do { } while (0)
|
||||
#endif
|
||||
|
||||
#define DRM_ARRAY_SIZE(x) ARRAY_SIZE(x)
|
||||
|
||||
#define DRM_UT_KMS 0x04
|
||||
|
||||
|
||||
///***************
|
||||
// ** DRM types **
|
||||
// ***************/
|
||||
//
|
||||
///*
|
||||
// * Forward type declarations
|
||||
// */
|
||||
struct drm_device;
|
||||
struct drm_mm_node;
|
||||
struct drm_master;
|
||||
struct drm_file;
|
||||
struct drm_crtc;
|
||||
struct drm_plane;
|
||||
struct drm_display_mode;
|
||||
struct drm_connector;
|
||||
struct drm_mode_create_dumb;
|
||||
struct drm_mode_fb_cmd2;
|
||||
struct drm_cmdline_mode;
|
||||
|
||||
|
||||
/**
|
||||
* Ioctl handler function
|
||||
*/
|
||||
typedef int drm_ioctl_t(struct drm_device *dev, void *data,
|
||||
struct drm_file *file_priv);
|
||||
|
||||
/**
|
||||
* Ioctl representation
|
||||
*/
|
||||
struct drm_ioctl_desc {
|
||||
unsigned int cmd;
|
||||
int flags;
|
||||
drm_ioctl_t *func;
|
||||
unsigned int cmd_drv;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
#define DRM_IOCTL_NR(n) (n & 0xff)
|
||||
|
||||
#define DRM_IOCTL_DEF_DRV(ioctl, _func, _flags) \
|
||||
[DRM_IOCTL_NR(DRM_##ioctl)] = {.cmd = DRM_##ioctl, .func = _func, .flags = _flags, .cmd_drv = DRM_IOCTL_##ioctl, .name = #ioctl}
|
||||
|
||||
#if 0
|
||||
#define DRM_IOCTL_DEF(ioctl, _func, _flags) \
|
||||
[ioctl & 0xff] = {.cmd = ioctl, .func = _func, .flags = _flags}
|
||||
#endif
|
||||
|
||||
|
||||
struct drm_gem_object;
|
||||
|
||||
|
||||
struct drm_driver {
|
||||
u32 driver_features;
|
||||
const struct vm_operations_struct *gem_vm_ops;
|
||||
const struct drm_ioctl_desc *ioctls;
|
||||
int num_ioctls;
|
||||
const struct file_operations *fops;
|
||||
int major;
|
||||
int minor;
|
||||
int patchlevel;
|
||||
char *name;
|
||||
char *desc;
|
||||
char *date;
|
||||
|
||||
int (*load) (struct drm_device *, unsigned long flags);
|
||||
int (*unload) (struct drm_device *);
|
||||
int (*open) (struct drm_device *, struct drm_file *);
|
||||
void (*lastclose) (struct drm_device *);
|
||||
void (*preclose) (struct drm_device *, struct drm_file *file_priv);
|
||||
void (*postclose) (struct drm_device *, struct drm_file *);
|
||||
|
||||
int (*suspend) (struct drm_device *, pm_message_t state);
|
||||
int (*resume) (struct drm_device *);
|
||||
|
||||
int (*device_is_agp) (struct drm_device *dev);
|
||||
int (*master_create)(struct drm_device *dev, struct drm_master *master);
|
||||
void (*master_destroy)(struct drm_device *dev, struct drm_master *master);
|
||||
void (*gem_free_object) (struct drm_gem_object *obj);
|
||||
|
||||
int (*prime_handle_to_fd)(struct drm_device *dev, struct drm_file *file_priv,
|
||||
uint32_t handle, uint32_t flags, int *prime_fd);
|
||||
int (*prime_fd_to_handle)(struct drm_device *dev, struct drm_file *file_priv,
|
||||
int prime_fd, uint32_t *handle);
|
||||
struct dma_buf * (*gem_prime_export)(struct drm_device *dev,
|
||||
struct drm_gem_object *obj, int flags);
|
||||
struct drm_gem_object * (*gem_prime_import)(struct drm_device *dev,
|
||||
struct dma_buf *dma_buf);
|
||||
|
||||
int (*dumb_create)(struct drm_file *file_priv,
|
||||
struct drm_device *dev,
|
||||
struct drm_mode_create_dumb *args);
|
||||
int (*dumb_map_offset)(struct drm_file *file_priv,
|
||||
struct drm_device *dev, uint32_t handle,
|
||||
uint64_t *offset);
|
||||
int (*dumb_destroy)(struct drm_file *file_priv,
|
||||
struct drm_device *dev,
|
||||
uint32_t handle);
|
||||
int (*get_vblank_timestamp) (struct drm_device *dev, int crtc,
|
||||
int *max_error,
|
||||
struct timeval *vblank_time,
|
||||
unsigned flags);
|
||||
u32 (*get_vblank_counter) (struct drm_device *dev, int crtc);
|
||||
int (*get_scanout_position) (struct drm_device *dev, int crtc,
|
||||
unsigned int flags,
|
||||
int *vpos, int *hpos, ktime_t *stime,
|
||||
ktime_t *etime);
|
||||
irqreturn_t(*irq_handler) (int irq, void *arg);
|
||||
void (*irq_preinstall) (struct drm_device *dev);
|
||||
int (*irq_postinstall) (struct drm_device *dev);
|
||||
void (*irq_uninstall) (struct drm_device *dev);
|
||||
int (*enable_vblank) (struct drm_device *dev, int crtc);
|
||||
void (*disable_vblank) (struct drm_device *dev, int crtc);
|
||||
};
|
||||
|
||||
|
||||
///* needed by drm_agpsupport.c */
|
||||
//struct drm_agp_mem {
|
||||
// unsigned long handle;
|
||||
// DRM_AGP_MEM *memory;
|
||||
// unsigned long bound;
|
||||
// int pages;
|
||||
// struct list_head head;
|
||||
//};
|
||||
//
|
||||
//struct drm_agp_head {
|
||||
// DRM_AGP_KERN agp_info;
|
||||
// unsigned long base;
|
||||
//
|
||||
// /*
|
||||
// * Members used by drm_agpsupport.c
|
||||
// */
|
||||
// int acquired;
|
||||
// struct agp_bridge_data *bridge;
|
||||
// int enabled;
|
||||
// unsigned long mode;
|
||||
// struct list_head memory;
|
||||
// int cant_use_aperture;
|
||||
// unsigned long page_mask;
|
||||
//};
|
||||
|
||||
#define DRM_SWITCH_POWER_ON 0
|
||||
#define DRM_SWITCH_POWER_OFF 1
|
||||
#define DRM_SWITCH_POWER_CHANGING 2
|
||||
|
||||
struct drm_i915_private;
|
||||
|
||||
struct drm_vblank_crtc {
|
||||
u32 last;
|
||||
};
|
||||
|
||||
struct drm_device {
|
||||
// int pci_device;
|
||||
struct pci_dev *pdev;
|
||||
struct mutex struct_mutex;
|
||||
struct drm_driver *driver;
|
||||
struct drm_i915_private *dev_private;
|
||||
// struct drm_gem_mm *mm_private;
|
||||
// enum drm_stat_type types[15];
|
||||
// unsigned long counters;
|
||||
struct address_space *dev_mapping;
|
||||
struct drm_agp_head *agp;
|
||||
int irq_enabled; /* needed for i915_dma.c */
|
||||
spinlock_t count_lock;
|
||||
struct drm_mode_config mode_config;
|
||||
int open_count;
|
||||
int vblank_disable_allowed;
|
||||
u32 max_vblank_count;
|
||||
struct drm_minor *primary; /* needed by i915_dma.c */
|
||||
// atomic_t object_count;
|
||||
// atomic_t object_memory;
|
||||
// atomic_t pin_count;
|
||||
// atomic_t pin_memory;
|
||||
// atomic_t gtt_count;
|
||||
// atomic_t gtt_memory;
|
||||
// uint32_t gtt_total;
|
||||
// uint32_t invalidate_domains;
|
||||
// uint32_t flush_domains;
|
||||
int switch_power_state;
|
||||
spinlock_t event_lock;
|
||||
struct device *dev; /* i915_gem_stolen.c */
|
||||
struct drm_vblank_crtc *vblank; /* needed by intel_pm.c */
|
||||
spinlock_t vbl_lock; /* needed by intel_pm.c */
|
||||
struct timer_list vblank_disable_timer;
|
||||
};
|
||||
|
||||
//
|
||||
//struct drm_map_list {
|
||||
// struct drm_hash_item hash;
|
||||
// struct drm_local_map *map;
|
||||
// struct drm_mm_node *file_offset_node;
|
||||
//};
|
||||
|
||||
|
||||
/***************************
|
||||
** drm/drm_vma_manager.h **
|
||||
***************************/
|
||||
|
||||
struct drm_vma_offset_node {
|
||||
int dummy;
|
||||
};
|
||||
|
||||
|
||||
struct drm_gem_object {
|
||||
|
||||
// /** Related drm device */
|
||||
struct drm_device *dev;
|
||||
//
|
||||
// /** File representing the shmem storage */
|
||||
struct file *filp;
|
||||
//
|
||||
// /**
|
||||
// * Size of the object, in bytes. Immutable over the object's
|
||||
// * lifetime.
|
||||
// */
|
||||
size_t size;
|
||||
//
|
||||
// /**
|
||||
// * Global name for this object, starts at 1. 0 means unnamed.
|
||||
// * Access is covered by the object_name_lock in the related drm_device
|
||||
// */
|
||||
// int name;
|
||||
//
|
||||
// /* Mapping info for this object */
|
||||
// struct drm_map_list map_list;
|
||||
//
|
||||
// /**
|
||||
// * Memory domains. These monitor which caches contain read/write data
|
||||
// * related to the object. When transitioning from one set of domains
|
||||
// * to another, the driver is called to ensure that caches are suitably
|
||||
// * flushed and invalidated
|
||||
// */
|
||||
uint32_t read_domains;
|
||||
uint32_t write_domain;
|
||||
//
|
||||
// /**
|
||||
// * While validating an exec operation, the
|
||||
// * new read/write domain values are computed here.
|
||||
// * They will be transferred to the above values
|
||||
// * at the point that any cache flushing occurs
|
||||
// */
|
||||
// uint32_t pending_read_domains;
|
||||
// uint32_t pending_write_domain;
|
||||
//
|
||||
// void *driver_private;
|
||||
struct drm_vma_offset_node vma_node;
|
||||
struct dma_buf_attachment *import_attach;
|
||||
};
|
||||
|
||||
typedef struct drm_dma_handle {
|
||||
void *vaddr;
|
||||
size_t size;
|
||||
dma_addr_t busaddr; /* needed by i915_drv.h */
|
||||
} drm_dma_handle_t;
|
||||
|
||||
typedef struct drm_local_map {
|
||||
size_t offset; /* Requested physical address (0 for SAREA)*/
|
||||
unsigned long size; /* Requested physical size (bytes) */
|
||||
// enum drm_map_type type; /* Type of memory to map */
|
||||
// enum drm_map_flags flags; /* Flags */
|
||||
void *handle; /* User-space: "Handle" to pass to mmap() */
|
||||
/* Kernel-space: kernel-virtual address */
|
||||
int mtrr; /* MTRR slot used */
|
||||
} drm_local_map_t;
|
||||
|
||||
//struct drm_gem_mm {
|
||||
// struct drm_mm offset_manager;
|
||||
// struct drm_open_hash offset_hash;
|
||||
//};
|
||||
//
|
||||
struct drm_lock_data {
|
||||
struct drm_hw_lock *hw_lock; /* for i915_dma.c */
|
||||
struct drm_file *file_priv; /* for i915_dma.c */
|
||||
};
|
||||
//
|
||||
struct drm_master {
|
||||
struct drm_lock_data lock; /* needed for i915_dma.c */
|
||||
void *driver_priv; /* needed for i915_dma.c */
|
||||
struct drm_minor *minor;
|
||||
};
|
||||
|
||||
struct drm_file {
|
||||
void *driver_priv;
|
||||
struct drm_minor *minor; /* needed for drm_agpsupport.c */
|
||||
struct drm_master *master; /* needed for i915_dma.c */
|
||||
struct list_head fbs;
|
||||
struct mutex fbs_lock;
|
||||
unsigned stereo_allowed :1;
|
||||
unsigned is_master :1; /* this file private is a master for a minor */
|
||||
int event_space;
|
||||
};
|
||||
//
|
||||
|
||||
#define DRM_MINOR_LEGACY 1
|
||||
|
||||
///*
|
||||
// * needed for drm_agpsupport.c
|
||||
// */
|
||||
struct drm_minor {
|
||||
struct device *kdev; /* needed by i915_irq.c */
|
||||
struct drm_device *dev;
|
||||
struct drm_master *master; /* needed for i915_dma.c */
|
||||
int index; /**< Minor device number */
|
||||
struct drm_mode_group mode_group;
|
||||
int type; /**< Control or render */
|
||||
};
|
||||
//
|
||||
///*
|
||||
// * needed for drm_crtc_helper.h, included by i915_dma.c
|
||||
// */
|
||||
//struct drm_encoder { void *helper_private; };
|
||||
//struct drm_mode_set { };
|
||||
|
||||
|
||||
#define DRM_MODE_OBJECT_CRTC 0xcccccccc
|
||||
//#define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
|
||||
//#define DRM_MODE_OBJECT_ENCODER 0xe0e0e0e0
|
||||
#define DRM_MODE_OBJECT_MODE 0xdededede
|
||||
//#define DRM_MODE_OBJECT_PROPERTY 0xb0b0b0b0
|
||||
//#define DRM_MODE_OBJECT_FB 0xfbfbfbfb
|
||||
//#define DRM_MODE_OBJECT_BLOB 0xbbbbbbbb
|
||||
//#define DRM_MODE_OBJECT_PLANE 0xeeeeeeee
|
||||
//#define DRM_MODE_OBJECT_BRIDGE 0xbdbdbdbd
|
||||
|
||||
#define DRM_MODE(nm, t, c, hd, hss, hse, ht, hsk, vd, vss, vse, vt, vs, f) \
|
||||
.name = nm, .status = 0, .type = (t), .clock = (c), \
|
||||
.hdisplay = (hd), .hsync_start = (hss), .hsync_end = (hse), \
|
||||
.htotal = (ht), .hskew = (hsk), .vdisplay = (vd), \
|
||||
.vsync_start = (vss), .vsync_end = (vse), .vtotal = (vt), \
|
||||
.vscan = (vs), .flags = (f), \
|
||||
.base.type = DRM_MODE_OBJECT_MODE
|
||||
|
||||
#define CRTC_STEREO_DOUBLE (1 << 1) /* adjust timings for stereo modes */
|
||||
|
||||
|
||||
struct drm_pending_vblank_event;
|
||||
|
||||
|
||||
#include <drm/drm_dp_helper.h>
|
||||
|
||||
|
||||
/***************************
|
||||
** drm/drm_crtc_helper.h **
|
||||
***************************/
|
||||
|
||||
struct drm_pending_event {
|
||||
struct drm_event *event;
|
||||
// struct list_head link;
|
||||
struct drm_file *file_priv;
|
||||
// pid_t pid; /* pid of requester, no guarantee it's valid by the time
|
||||
// we deliver the event, for tracing only */
|
||||
void (*destroy)(struct drm_pending_event *event);
|
||||
};
|
||||
|
||||
struct drm_pending_vblank_event {
|
||||
int dummy;
|
||||
struct drm_pending_event base;
|
||||
// int pipe;
|
||||
struct drm_event_vblank event;
|
||||
};
|
||||
|
||||
|
||||
/***************************
|
||||
** drm/drm_crtc_helper.h **
|
||||
***************************/
|
||||
|
||||
struct drm_cmdline_mode
|
||||
{
|
||||
bool specified;
|
||||
bool refresh_specified;
|
||||
bool bpp_specified;
|
||||
int xres, yres;
|
||||
int bpp;
|
||||
int refresh;
|
||||
bool rb;
|
||||
bool interlace;
|
||||
bool cvt;
|
||||
bool margins;
|
||||
enum drm_connector_force force;
|
||||
};
|
||||
|
||||
|
||||
/******************
|
||||
** Misc helpers **
|
||||
******************/
|
||||
|
||||
/* normally found in drm_os_linux.h */
|
||||
#define DRM_WAIT_ON( ret, queue, timeout, condition ) \
|
||||
do { \
|
||||
DECLARE_WAITQUEUE(entry, current); \
|
||||
unsigned long end = jiffies + (timeout); \
|
||||
add_wait_queue(&(queue), &entry); \
|
||||
\
|
||||
for (;;) { \
|
||||
__set_current_state(TASK_INTERRUPTIBLE); \
|
||||
if (condition) \
|
||||
break; \
|
||||
if (time_after_eq(jiffies, end)) { \
|
||||
ret = -EBUSY; \
|
||||
break; \
|
||||
} \
|
||||
schedule_timeout((HZ/100 > 1) ? HZ/100 : 1); \
|
||||
if (signal_pending(current)) { \
|
||||
ret = -EINTR; \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
__set_current_state(TASK_RUNNING); \
|
||||
remove_wait_queue(&(queue), &entry); \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* normally found in Linux drmP.h */
|
||||
#define LOCK_TEST_WITH_RETURN( dev, _file_priv ) \
|
||||
do { \
|
||||
if (!_DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock) || \
|
||||
_file_priv->master->lock.file_priv != _file_priv) { \
|
||||
DRM_ERROR( "%s called without lock held, held %d owner %p %p\n",\
|
||||
__func__, _DRM_LOCK_IS_HELD(_file_priv->master->lock.hw_lock->lock),\
|
||||
_file_priv->master->lock.file_priv, _file_priv); \
|
||||
return -EINVAL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
static inline int drm_core_check_feature(struct drm_device *dev, int feature) {
|
||||
return ((dev->driver->driver_features & feature) ? 1 : 0); }
|
||||
|
||||
#if 0
|
||||
|
||||
static inline int drm_core_has_AGP(struct drm_device *dev) {
|
||||
return drm_core_check_feature(dev, DRIVER_USE_AGP); }
|
||||
|
||||
/*
|
||||
* Functions normally provided by drm_bufs.c
|
||||
*/
|
||||
static inline resource_size_t
|
||||
drm_get_resource_start(struct drm_device *dev, unsigned int rsc) {
|
||||
return pci_resource_start(dev->pdev, rsc); }
|
||||
|
||||
static inline resource_size_t
|
||||
drm_get_resource_len(struct drm_device *dev, unsigned int rsc) {
|
||||
return pci_resource_len(dev->pdev, rsc); }
|
||||
|
||||
#endif
|
||||
|
||||
static __inline__ bool drm_can_sleep(void) { return true; }
|
||||
|
||||
extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
|
||||
extern int drm_noop(struct drm_device *dev, void *data, struct drm_file *file_priv);
|
||||
extern int drm_irq_install(struct drm_device *dev);
|
||||
extern int drm_irq_uninstall(struct drm_device *dev);
|
||||
extern struct drm_local_map *drm_getsarea(struct drm_device *dev);
|
||||
extern int drm_vblank_init(struct drm_device *dev, int num_crtcs);
|
||||
extern void drm_vblank_cleanup(struct drm_device *dev);
|
||||
extern void drm_kms_helper_poll_disable(struct drm_device *dev);
|
||||
extern void drm_kms_helper_poll_init(struct drm_device *dev);
|
||||
extern void drm_mm_takedown(struct drm_mm *mm);
|
||||
extern bool drm_helper_hpd_irq_event(struct drm_device *dev);
|
||||
extern void drm_modeset_lock_all(struct drm_device *dev);
|
||||
extern void drm_mode_config_reset(struct drm_device *dev);
|
||||
extern void drm_modeset_unlock_all(struct drm_device *dev);
|
||||
extern void drm_kms_helper_poll_enable(struct drm_device *dev);
|
||||
extern int drm_get_pci_dev(struct pci_dev *pdev, const struct pci_device_id *ent, struct drm_driver *driver);
|
||||
extern void drm_put_dev(struct drm_device *dev);
|
||||
extern void drm_gem_vm_open(struct vm_area_struct *vma);
|
||||
extern void drm_gem_vm_close(struct vm_area_struct *vma);
|
||||
extern int drm_open(struct inode *inode, struct file *filp);
|
||||
extern int drm_release(struct inode *inode, struct file *filp);
|
||||
extern int drm_mmap(struct file *filp, struct vm_area_struct *vma);
|
||||
extern long drm_ioctl(struct file *filp, unsigned int cmd, unsigned long arg);
|
||||
extern unsigned int drm_poll(struct file *filp, struct poll_table_struct *wait);
|
||||
extern ssize_t drm_read(struct file *filp, char __user *buffer, size_t count, loff_t *offset);
|
||||
extern int drm_gem_mmap(struct file *filp, struct vm_area_struct *vma);
|
||||
extern int drm_gem_prime_handle_to_fd(struct drm_device *dev, struct drm_file *file_priv, uint32_t handle, uint32_t flags, int *prime_fd);
|
||||
extern int drm_gem_prime_fd_to_handle(struct drm_device *dev, struct drm_file *file_priv, int prime_fd, uint32_t *handle);
|
||||
extern int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev, uint32_t handle);
|
||||
extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
|
||||
extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
|
||||
extern void drm_vblank_off(struct drm_device *dev, int crtc);
|
||||
extern void drm_encoder_cleanup(struct drm_encoder *encoder);
|
||||
extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc);
|
||||
extern void drm_vblank_post_modeset(struct drm_device *dev, int crtc);
|
||||
extern struct drm_connector *drm_select_eld(struct drm_encoder *encoder, struct drm_display_mode *mode);
|
||||
extern int drm_av_sync_delay(struct drm_connector *connector, struct drm_display_mode *mode);
|
||||
extern struct drm_gem_object *drm_gem_object_lookup(struct drm_device *dev, struct drm_file *filp, u32 handle);
|
||||
extern void drm_gem_object_unreference(struct drm_gem_object *obj);
|
||||
extern void drm_gem_object_unreference_unlocked(struct drm_gem_object *obj);
|
||||
extern uint32_t drm_mode_legacy_fb_format(uint32_t bpp, uint32_t depth);
|
||||
extern void drm_framebuffer_unregister_private(struct drm_framebuffer *fb);
|
||||
extern void drm_framebuffer_unreference(struct drm_framebuffer *fb);
|
||||
extern void drm_mode_set_name(struct drm_display_mode *mode);
|
||||
extern void drm_crtc_cleanup(struct drm_crtc *crtc);
|
||||
extern void drm_send_vblank_event(struct drm_device *dev, int crtc, struct drm_pending_vblank_event *e);
|
||||
extern void drm_vblank_put(struct drm_device *dev, int crtc);
|
||||
extern int drm_vblank_get(struct drm_device *dev, int crtc);
|
||||
extern void drm_gem_object_reference(struct drm_gem_object *obj);
|
||||
extern void drm_mode_debug_printmodeline(const struct drm_display_mode *mode);
|
||||
extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src);
|
||||
extern void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags);
|
||||
extern int drm_object_property_set_value(struct drm_mode_object *obj, struct drm_property *property, uint64_t val);
|
||||
extern void drm_calc_timestamping_constants(struct drm_crtc *crtc, const struct drm_display_mode *mode);
|
||||
extern bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2);
|
||||
extern bool drm_encoder_crtc_ok(struct drm_encoder *encoder, struct drm_crtc *crtc);
|
||||
extern int drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, int gamma_size);
|
||||
extern void drm_crtc_helper_add(struct drm_crtc *crtc, const struct drm_crtc_helper_funcs *funcs);
|
||||
extern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev, uint32_t id, uint32_t type);
|
||||
extern void drm_helper_move_panel_connectors_to_head(struct drm_device *);
|
||||
extern void drm_framebuffer_cleanup(struct drm_framebuffer *fb);
|
||||
extern int drm_gem_handle_create(struct drm_file *file_priv, struct drm_gem_object *obj, u32 *handlep);
|
||||
extern int drm_helper_mode_fill_fb_struct(struct drm_framebuffer *fb, struct drm_mode_fb_cmd2 *mode_cmd);
|
||||
extern int drm_framebuffer_init(struct drm_device *dev, struct drm_framebuffer *fb, const struct drm_framebuffer_funcs *funcs);
|
||||
extern void drm_mode_config_init(struct drm_device *dev);
|
||||
extern void drm_kms_helper_poll_fini(struct drm_device *dev);
|
||||
extern void drm_sysfs_connector_remove(struct drm_connector *connector);
|
||||
extern void drm_mode_config_cleanup(struct drm_device *dev);
|
||||
extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, struct drm_encoder *encoder);
|
||||
extern bool drm_dp_enhanced_frame_cap(const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
|
||||
extern int drm_encoder_init(struct drm_device *dev, struct drm_encoder *encoder, const struct drm_encoder_funcs *funcs, int encoder_type);
|
||||
extern int drm_dp_bw_code_to_link_rate(u8 link_bw);
|
||||
extern u8 drm_dp_max_lane_count(const u8 dpcd[DP_RECEIVER_CAP_SIZE]);
|
||||
extern u8 drm_match_cea_mode(const struct drm_display_mode *to_match);
|
||||
extern bool drm_probe_ddc(struct i2c_adapter *adapter);
|
||||
extern struct edid *drm_edid_duplicate(const struct edid *edid);
|
||||
extern struct edid *drm_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter);
|
||||
extern bool drm_detect_monitor_audio(struct edid *edid);
|
||||
extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev, const struct drm_display_mode *mode);
|
||||
extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
|
||||
extern void drm_connector_cleanup(struct drm_connector *connector);
|
||||
extern int drm_helper_probe_single_connector_modes(struct drm_connector *connector, uint32_t maxX, uint32_t maxY);
|
||||
extern int drm_mode_create_scaling_mode_property(struct drm_device *dev);
|
||||
extern void drm_object_attach_property(struct drm_mode_object *obj, struct drm_property *property, uint64_t init_val);
|
||||
extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
|
||||
extern int drm_mode_connector_update_edid_property(struct drm_connector *connector, struct edid *edid);
|
||||
extern void drm_edid_to_eld(struct drm_connector *connector, struct edid *edid);
|
||||
extern int drm_connector_init(struct drm_device *dev, struct drm_connector *connector, const struct drm_connector_funcs *funcs, int connector_type);
|
||||
extern int drm_sysfs_connector_add(struct drm_connector *connector);
|
||||
extern void drm_clflush_virt_range(char *addr, unsigned long length);
|
||||
extern void drm_vma_node_unmap(struct drm_vma_offset_node *node, struct address_space *file_mapping);
|
||||
extern bool drm_vma_node_has_offset(struct drm_vma_offset_node *node);
|
||||
extern int drm_gem_create_mmap_offset(struct drm_gem_object *obj);
|
||||
extern void drm_gem_free_mmap_offset(struct drm_gem_object *obj);
|
||||
extern __u64 drm_vma_node_offset_addr(struct drm_vma_offset_node *node);
|
||||
extern bool drm_mm_node_allocated(struct drm_mm_node *node);
|
||||
extern void drm_mm_remove_node(struct drm_mm_node *node);
|
||||
extern void drm_clflush_sg(struct sg_table *st);
|
||||
extern int drm_gem_object_init(struct drm_device *dev, struct drm_gem_object *obj, size_t size);
|
||||
extern void drm_prime_gem_destroy(struct drm_gem_object *obj, struct sg_table *sg);
|
||||
extern void drm_gem_object_release(struct drm_gem_object *obj);
|
||||
extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, size_t align);
|
||||
extern void drm_clflush_pages(struct page *pages[], unsigned long num_pages);
|
||||
extern void drm_mode_destroy(struct drm_device *dev, struct drm_display_mode *mode);
|
||||
extern const char *drm_get_connector_name(const struct drm_connector *connector);
|
||||
extern const char *drm_get_encoder_name(const struct drm_encoder *encoder);
|
||||
extern const char *drm_get_format_name(uint32_t format);
|
||||
extern void drm_mm_init(struct drm_mm *mm, unsigned long start, unsigned long size);
|
||||
extern int drm_mm_reserve_node(struct drm_mm *mm, struct drm_mm_node *node);
|
||||
extern int drm_calc_vbltimestamp_from_scanoutpos(struct drm_device *dev, int crtc, int *max_error, struct timeval *vblank_time, unsigned flags, const struct drm_crtc *refcrtc, const struct drm_display_mode *mode);
|
||||
extern const char *drm_get_connector_status_name(enum drm_connector_status status);
|
||||
extern void drm_kms_helper_hotplug_event(struct drm_device *dev);
|
||||
extern bool drm_handle_vblank(struct drm_device *dev, int crtc);
|
||||
extern void drm_gem_private_object_init(struct drm_device *dev, struct drm_gem_object *obj, size_t size);
|
||||
extern void drm_sysfs_hotplug_event(struct drm_device *dev);
|
||||
extern bool drm_mode_parse_command_line_for_connector(const char *mode_option, struct drm_connector *connector, struct drm_cmdline_mode *mode);
|
||||
extern struct drm_display_mode * drm_mode_create_from_cmdline_mode(struct drm_device *dev, struct drm_cmdline_mode *cmd);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* extern "C" */
|
||||
|
||||
#endif /* _DRMP_H_ */
|
@ -1 +0,0 @@
|
||||
#include <lx_emul.h>
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
146
repos/dde_linux/src/drivers/framebuffer/intel/lx_emul_c.c
Normal file
146
repos/dde_linux/src/drivers/framebuffer/intel/lx_emul_c.c
Normal file
@ -0,0 +1,146 @@
|
||||
#include "lx_emul_private.h"
|
||||
#include <../drivers/gpu/drm/i915/i915_drv.h>
|
||||
#include <../drivers/gpu/drm/i915/intel_drv.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
|
||||
extern struct drm_framebuffer *
|
||||
dde_c_intel_framebuffer_create(struct drm_device *dev,
|
||||
struct drm_mode_fb_cmd2 *mode_cmd,
|
||||
struct drm_i915_gem_object *obj);
|
||||
|
||||
|
||||
int intel_sanitize_enable_execlists(struct drm_device *dev,
|
||||
int enable_execlists)
|
||||
{
|
||||
if (INTEL_INFO(dev)->gen >= 9)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
struct drm_framebuffer*
|
||||
dde_c_allocate_framebuffer(int width, int height, void ** base,
|
||||
uint64_t * size, struct drm_device * dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_framebuffer * fb = NULL;
|
||||
struct drm_mode_fb_cmd2 * r;
|
||||
struct drm_i915_gem_object * obj = NULL;
|
||||
|
||||
mutex_lock(&dev->struct_mutex);
|
||||
|
||||
*size = roundup(width * height * 2, PAGE_SIZE);
|
||||
if (*size * 2 < dev_priv->gtt.stolen_usable_size)
|
||||
obj = i915_gem_object_create_stolen(dev, *size);
|
||||
if (obj == NULL)
|
||||
obj = i915_gem_alloc_object(dev, *size);
|
||||
if (obj == NULL) goto out2;
|
||||
|
||||
r = (struct drm_mode_fb_cmd2*) kzalloc(sizeof(struct drm_mode_fb_cmd2), 0);
|
||||
if (!r) goto err2;
|
||||
r->width = width;
|
||||
r->height = height;
|
||||
r->pixel_format = DRM_FORMAT_RGB565;
|
||||
r->pitches[0] = width * 2;
|
||||
fb = dde_c_intel_framebuffer_create(dev, r, obj);
|
||||
if (!fb) goto err2;
|
||||
|
||||
if (intel_pin_and_fence_fb_obj(NULL, fb, NULL, NULL, NULL))
|
||||
goto err1;
|
||||
|
||||
*base = ioremap_wc(dev_priv->gtt.mappable_base
|
||||
+ i915_gem_obj_ggtt_offset(obj), *size);
|
||||
|
||||
memset_io(*base, 0, *size);
|
||||
goto out1;
|
||||
|
||||
err1:
|
||||
drm_framebuffer_remove(fb);
|
||||
fb = NULL;
|
||||
err2:
|
||||
drm_gem_object_unreference(&obj->base);
|
||||
out1:
|
||||
kfree(r);
|
||||
out2:
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
return fb;
|
||||
}
|
||||
|
||||
|
||||
void dde_c_set_mode(struct drm_device * dev, struct drm_connector * connector,
|
||||
struct drm_framebuffer *fb, struct drm_display_mode *mode)
|
||||
{
|
||||
struct drm_crtc *crtc = NULL;
|
||||
struct drm_encoder *encoder = connector->encoder;
|
||||
|
||||
if (!mode) return;
|
||||
|
||||
if (!encoder) {
|
||||
struct drm_encoder *enc;
|
||||
list_for_each_entry(enc, &dev->mode_config.encoder_list, head) {
|
||||
unsigned i;
|
||||
for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++)
|
||||
if (connector->encoder_ids[i] == enc->base.id) break;
|
||||
|
||||
if (i == DRM_CONNECTOR_MAX_ENCODER) continue;
|
||||
|
||||
bool used = false;
|
||||
struct drm_connector *c;
|
||||
list_for_each_entry(c, &dev->mode_config.connector_list, head) {
|
||||
if (c->encoder == enc) used = true;
|
||||
}
|
||||
if (used) continue;
|
||||
encoder = enc;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!encoder) {
|
||||
DRM_DEBUG("Found no encoder for the connector %s\n", connector->name);
|
||||
return;
|
||||
}
|
||||
|
||||
crtc = encoder->crtc;
|
||||
if (!crtc) {
|
||||
unsigned i = 0;
|
||||
struct drm_crtc *c;
|
||||
list_for_each_entry(c, &dev->mode_config.crtc_list, head) {
|
||||
if (!(encoder->possible_crtcs & (1 << i))) continue;
|
||||
if (c->state->enable) continue;
|
||||
crtc = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!crtc) {
|
||||
DRM_DEBUG("Found no crtc for the connector %s\n", connector->name);
|
||||
return;
|
||||
}
|
||||
|
||||
DRM_DEBUG("set mode %s for connector %s\n", mode->name, connector->name);
|
||||
|
||||
struct drm_mode_set set;
|
||||
set.crtc = crtc;
|
||||
set.x = 0;
|
||||
set.y = 0;
|
||||
set.mode = mode;
|
||||
set.connectors = &connector;
|
||||
set.num_connectors = 1;
|
||||
set.fb = fb;
|
||||
drm_atomic_helper_set_config(&set);
|
||||
}
|
||||
|
||||
|
||||
void dde_c_set_driver(struct drm_device * dev, void * driver)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
ASSERT(!dev_priv->audio_component);
|
||||
dev_priv->audio_component = (struct i915_audio_component *) driver;
|
||||
}
|
||||
|
||||
|
||||
void* dde_c_get_driver(struct drm_device * dev)
|
||||
{
|
||||
struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
return (void*) dev_priv->audio_component;
|
||||
}
|
@ -7,17 +7,14 @@
|
||||
#ifndef _LX_EMUL_PRIVATE_H_
|
||||
#define _LX_EMUL_PRIVATE_H_
|
||||
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/sleep.h>
|
||||
|
||||
/* Linux kernel API */
|
||||
#include <lx_emul.h>
|
||||
#include <stdarg.h>
|
||||
#include <lx_emul/printf.h>
|
||||
|
||||
#if 0
|
||||
#define TRACE \
|
||||
do { \
|
||||
PLOG("%s not implemented", __func__); \
|
||||
lx_printf("%s not implemented\n", __func__); \
|
||||
} while (0)
|
||||
#else
|
||||
#define TRACE do { ; } while (0)
|
||||
@ -25,15 +22,15 @@
|
||||
|
||||
#define TRACE_AND_STOP \
|
||||
do { \
|
||||
PWRN("%s not implemented", __func__); \
|
||||
Genode::sleep_forever(); \
|
||||
lx_printf("%s not implemented\n", __func__); \
|
||||
BUG(); \
|
||||
} while (0)
|
||||
|
||||
#define ASSERT(x) \
|
||||
do { \
|
||||
if (!(x)) { \
|
||||
PWRN("%s:%u assertion failed", __func__, __LINE__); \
|
||||
Genode::sleep_forever(); \
|
||||
lx_printf("%s:%u assertion failed\n", __func__, __LINE__); \
|
||||
BUG(); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* \brief Intel framebuffer driver
|
||||
* \author Norman Feske
|
||||
* \author Stefan Kalkowski
|
||||
* \date 2015-08-19
|
||||
*/
|
||||
|
||||
@ -16,67 +17,25 @@
|
||||
#include <os/server.h>
|
||||
#include <os/config.h>
|
||||
|
||||
/* Server related local includes */
|
||||
#include <component.h>
|
||||
|
||||
/* Linux emulation environment includes */
|
||||
#include <lx_emul.h>
|
||||
#include <lx_emul/impl/internal/scheduler.h>
|
||||
#include <lx_emul/impl/internal/timer.h>
|
||||
#include <lx_emul/impl/internal/irq.h>
|
||||
#include <lx_emul/impl/internal/pci_dev_registry.h>
|
||||
#include <lx_emul/impl/internal/pci_backend_alloc.h>
|
||||
#include <lx_kit/scheduler.h>
|
||||
#include <lx_kit/timer.h>
|
||||
#include <lx_kit/irq.h>
|
||||
#include <lx_kit/pci_dev_registry.h>
|
||||
#include <lx_kit/backend_alloc.h>
|
||||
#include <lx_kit/work.h>
|
||||
|
||||
/* Linux module functions */
|
||||
extern "C" int postcore_i2c_init(); /* i2c-core.c */
|
||||
extern "C" int module_i915_init(); /* i915_drv.c */
|
||||
|
||||
|
||||
namespace Server { struct Main; }
|
||||
|
||||
|
||||
Lx::Scheduler & Lx::scheduler()
|
||||
{
|
||||
static Lx::Scheduler inst;
|
||||
return inst;
|
||||
}
|
||||
|
||||
|
||||
Lx::Timer & Lx::timer(Server::Entrypoint *ep, unsigned long *jiffies)
|
||||
{
|
||||
return _timer_impl(ep, jiffies);
|
||||
}
|
||||
|
||||
|
||||
Lx::Irq & Lx::Irq::irq(Server::Entrypoint *ep)
|
||||
{
|
||||
static Lx::Irq irq(*ep);
|
||||
return irq;
|
||||
}
|
||||
|
||||
|
||||
Platform::Connection *Lx::pci()
|
||||
{
|
||||
static Platform::Connection _pci;
|
||||
return &_pci;
|
||||
}
|
||||
|
||||
|
||||
Lx::Pci_dev_registry *Lx::pci_dev_registry()
|
||||
{
|
||||
static Lx::Pci_dev_registry _pci_dev_registry;
|
||||
return &_pci_dev_registry;
|
||||
}
|
||||
|
||||
|
||||
namespace Lx {
|
||||
Genode::Object_pool<Memory_object_base> memory_pool;
|
||||
};
|
||||
|
||||
|
||||
Framebuffer::Root * Framebuffer::root = nullptr;
|
||||
|
||||
|
||||
extern "C" int postcore_i2c_init(); /* i2c-core.c */
|
||||
extern "C" int module_i915_init(); /* i915_drv.c */
|
||||
extern "C" void update_framebuffer_config();
|
||||
|
||||
|
||||
static void run_linux(void * m);
|
||||
|
||||
unsigned long jiffies;
|
||||
@ -102,7 +61,10 @@ struct Server::Main
|
||||
Lx::Timer &timer = Lx::timer(&ep, &jiffies);
|
||||
|
||||
/* init singleton Lx::Irq */
|
||||
Lx::Irq &irq = Lx::Irq::irq(&ep);
|
||||
Lx::Irq &irq = Lx::Irq::irq(&ep, Genode::env()->heap());
|
||||
|
||||
/* init singleton Lx::Work */
|
||||
Lx::Work &work = Lx::Work::work_queue(Genode::env()->heap());
|
||||
|
||||
/* Linux task that handles the initialization */
|
||||
Lx::Task linux { run_linux, reinterpret_cast<void*>(this), "linux",
|
||||
@ -112,11 +74,12 @@ struct Server::Main
|
||||
{
|
||||
Genode::printf("--- intel framebuffer driver ---\n");
|
||||
|
||||
Framebuffer::root = &root_component;
|
||||
|
||||
/* give all task a first kick before returning */
|
||||
Lx::scheduler().schedule();
|
||||
}
|
||||
|
||||
void announce() {
|
||||
Genode::env()->parent()->announce(ep.manage(root_component)); }
|
||||
};
|
||||
|
||||
|
||||
@ -142,26 +105,24 @@ static void run_linux(void * m)
|
||||
|
||||
postcore_i2c_init();
|
||||
module_i915_init();
|
||||
|
||||
Genode::env()->parent()->announce(main->ep.manage(*Framebuffer::root));
|
||||
main->root_component.session.driver().finish_initialization();
|
||||
main->announce();
|
||||
|
||||
static Policy_agent pa(*main);
|
||||
Genode::config()->sigh(pa.sd);
|
||||
|
||||
while (1) {
|
||||
Lx::scheduler().current()->block_and_schedule();
|
||||
update_framebuffer_config();
|
||||
main->root_component.session.config_changed();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace Server {
|
||||
|
||||
char const *name() { return "intel_fb_ep"; }
|
||||
|
||||
size_t stack_size() { return 8*1024*sizeof(long); }
|
||||
|
||||
void construct(Entrypoint &ep)
|
||||
{
|
||||
static Main main(ep);
|
||||
}
|
||||
void construct(Entrypoint &ep) { static Main m(ep); }
|
||||
}
|
||||
|
@ -2,5 +2,19 @@ REQUIRES = x86
|
||||
|
||||
TARGET = intel_fb_drv
|
||||
LIBS = base intel_fb_drv intel_fb_include libc-setjmp server config blit
|
||||
SRC_CC = main.cc lx_emul.cc dummies.cc
|
||||
SRC_CC = main.cc lx_emul.cc
|
||||
SRC_C = dummies.c i915_params.c lx_emul_c.c
|
||||
|
||||
# lx_kit
|
||||
SRC_CC += irq.cc \
|
||||
malloc.cc \
|
||||
mapped_io_mem_range.cc \
|
||||
pci.cc \
|
||||
scheduler.cc \
|
||||
timer.cc \
|
||||
work.cc
|
||||
|
||||
INC_DIR += $(REP_DIR)/src/include
|
||||
|
||||
vpath %.cc $(PRG_DIR)
|
||||
vpath %.cc $(REP_DIR)/src/lx_kit
|
||||
|
@ -33,12 +33,25 @@ struct page *alloc_pages(gfp_t gfp_mask, unsigned int order)
|
||||
return 0;
|
||||
}
|
||||
|
||||
Lx::Addr_to_page_mapping::insert(page);
|
||||
Lx::Addr_to_page_mapping::insert(page, ds_cap);
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
void free_pages(unsigned long addr, unsigned int order)
|
||||
{
|
||||
page * page = Lx::Addr_to_page_mapping::find_page(addr);
|
||||
if (!page) return;
|
||||
|
||||
Genode::Ram_dataspace_capability cap =
|
||||
Lx::Addr_to_page_mapping::remove(page);
|
||||
if (cap.valid())
|
||||
Lx::backend_free(cap);
|
||||
kfree(page);
|
||||
}
|
||||
|
||||
|
||||
void get_page(struct page *page)
|
||||
{
|
||||
atomic_inc(&page->_count);
|
||||
|
@ -24,13 +24,9 @@ void *kmalloc(size_t size, gfp_t flags)
|
||||
|
||||
void *addr = nullptr;
|
||||
|
||||
if (flags & GFP_LX_DMA) {
|
||||
addr = Lx::Malloc::dma().alloc(size, 12);
|
||||
} else {
|
||||
addr = (size > (1 << Lx::Malloc::MAX_SIZE_LOG2))
|
||||
? Lx::Malloc::mem().alloc_large(size)
|
||||
: Lx::Malloc::mem().alloc(size);
|
||||
}
|
||||
addr = (flags & GFP_LX_DMA)
|
||||
? Lx::Malloc::dma().alloc(size, 12)
|
||||
: Lx::Malloc::mem().alloc(size);
|
||||
|
||||
if ((Genode::addr_t)addr & 0x3)
|
||||
PERR("unaligned kmalloc %lx", (Genode::addr_t)addr);
|
||||
|
@ -26,8 +26,9 @@ class Lx::Addr_to_page_mapping : public Lx_kit::List<Addr_to_page_mapping>::Elem
|
||||
{
|
||||
private:
|
||||
|
||||
unsigned long _addr { 0 };
|
||||
struct page *_page { 0 };
|
||||
unsigned long _addr { 0 };
|
||||
struct page *_page { 0 };
|
||||
Genode::Ram_dataspace_capability _cap;
|
||||
|
||||
static Genode::List<Addr_to_page_mapping> *_list()
|
||||
{
|
||||
@ -37,31 +38,34 @@ class Lx::Addr_to_page_mapping : public Lx_kit::List<Addr_to_page_mapping>::Elem
|
||||
|
||||
public:
|
||||
|
||||
Addr_to_page_mapping(unsigned long addr, struct page *page)
|
||||
: _addr(addr), _page(page) { }
|
||||
|
||||
static void insert(struct page *page)
|
||||
static void insert(struct page *page,
|
||||
Genode::Ram_dataspace_capability cap)
|
||||
{
|
||||
Addr_to_page_mapping *m = (Addr_to_page_mapping*)
|
||||
Lx::Malloc::mem().alloc(sizeof (Addr_to_page_mapping));
|
||||
|
||||
m->_addr = (unsigned long)page->addr;
|
||||
m->_page = page;
|
||||
m->_cap = cap;
|
||||
|
||||
_list()->insert(m);
|
||||
}
|
||||
|
||||
static void remove(struct page *page)
|
||||
static Genode::Ram_dataspace_capability remove(struct page *page)
|
||||
{
|
||||
Genode::Ram_dataspace_capability cap;
|
||||
Addr_to_page_mapping *mp = 0;
|
||||
for (Addr_to_page_mapping *m = _list()->first(); m; m = m->next())
|
||||
if (m->_page == page)
|
||||
mp = m;
|
||||
|
||||
if (mp) {
|
||||
cap = mp->_cap;
|
||||
_list()->remove(mp);
|
||||
Lx::Malloc::mem().free(mp);
|
||||
}
|
||||
|
||||
return cap;
|
||||
}
|
||||
|
||||
static struct page* find_page(unsigned long addr)
|
||||
|
Loading…
x
Reference in New Issue
Block a user