From: jsg Date: Wed, 19 Jan 2022 02:20:06 +0000 (+0000) Subject: move some unused functions under ifdef X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=065db74666d100be1ef8bdd66000faaca98ecbd3;p=openbsd move some unused functions under ifdef --- diff --git a/sys/dev/pci/drm/i915/i915_drv.c b/sys/dev/pci/drm/i915/i915_drv.c index b04df8b540c..096cb731ef9 100644 --- a/sys/dev/pci/drm/i915/i915_drv.c +++ b/sys/dev/pci/drm/i915/i915_drv.c @@ -782,12 +782,11 @@ static void i915_welcome_messages(struct drm_i915_private *dev_priv) "DRM_I915_DEBUG_RUNTIME_PM enabled\n"); } +#ifdef __linux__ + static struct drm_i915_private * i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent) { - STUB(); - return ERR_PTR(-ENOSYS); -#ifdef notyet const struct intel_device_info *match_info = (struct intel_device_info *)ent->driver_data; struct intel_device_info *device_info; @@ -809,11 +808,8 @@ i915_driver_create(struct pci_dev *pdev, const struct pci_device_id *ent) RUNTIME_INFO(i915)->device_id = pdev->device; return i915; -#endif } -#ifdef __linux__ - /** * i915_driver_probe - setup chip and create an initial config * @pdev: PCI device @@ -1549,6 +1545,8 @@ int i915_resume_switcheroo(struct drm_i915_private *i915) return i915_drm_resume(&i915->drm); } +#ifdef __linux__ + static int i915_pm_prepare(struct device *kdev) { struct drm_i915_private *i915 = kdev_to_i915(kdev); @@ -1687,8 +1685,6 @@ static int i915_pm_restore(struct device *kdev) return i915_pm_resume(kdev); } -#ifdef __linux__ - static int intel_runtime_suspend(struct device *kdev) { struct drm_i915_private *dev_priv = kdev_to_i915(kdev); diff --git a/sys/dev/pci/drm/i915/i915_perf.c b/sys/dev/pci/drm/i915/i915_perf.c index a2aca7cf182..b57f8388a51 100644 --- a/sys/dev/pci/drm/i915/i915_perf.c +++ b/sys/dev/pci/drm/i915/i915_perf.c @@ -371,7 +371,9 @@ struct i915_oa_config_bo { static struct ctl_table_header *sysctl_header; +#ifdef notyet static enum hrtimer_restart oa_poll_check_timer_cb(struct hrtimer *hrtimer); +#endif void i915_oa_config_release(struct kref *ref) { @@ -399,6 +401,8 @@ i915_perf_get_oa_config(struct i915_perf *perf, int metrics_set) return oa_config; } +#ifdef notyet + static void free_oa_config_bo(struct i915_oa_config_bo *oa_bo) { i915_oa_config_put(oa_bo->oa_config); @@ -406,6 +410,8 @@ static void free_oa_config_bo(struct i915_oa_config_bo *oa_bo) kfree(oa_bo); } +#endif + static u32 gen12_oa_hw_tail_read(struct i915_perf_stream *stream) { struct intel_uncore *uncore = stream->uncore; @@ -429,6 +435,8 @@ static u32 gen7_oa_hw_tail_read(struct i915_perf_stream *stream) return oastatus1 & GEN7_OASTATUS1_TAIL_MASK; } +#ifdef notyet + /** * oa_buffer_check_unlocked - check for data and update tail ptr state * @stream: i915 stream instance @@ -455,9 +463,6 @@ static u32 gen7_oa_hw_tail_read(struct i915_perf_stream *stream) */ static bool oa_buffer_check_unlocked(struct i915_perf_stream *stream) { - STUB(); - return false; -#ifdef notyet u32 gtt_offset = i915_ggtt_offset(stream->oa_buffer.vma); int report_size = stream->oa_buffer.format_size; unsigned long flags; @@ -537,9 +542,10 @@ static bool oa_buffer_check_unlocked(struct i915_perf_stream *stream) spin_unlock_irqrestore(&stream->oa_buffer.ptr_lock, flags); return pollin; -#endif } +#endif + /** * append_oa_status - Appends a status record to a userspace read() buffer. * @stream: An i915-perf stream opened for OA metrics @@ -1131,6 +1137,8 @@ static int gen7_oa_read(struct i915_perf_stream *stream, return gen7_append_oa_reports(stream, buf, count, offset); } +#ifdef notyet + /** * i915_oa_wait_unlocked - handles blocking IO until OA data available * @stream: An i915-perf stream opened for OA metrics @@ -1155,7 +1163,6 @@ static int i915_oa_wait_unlocked(struct i915_perf_stream *stream) oa_buffer_check_unlocked(stream)); } -#ifdef notyet /** * i915_oa_poll_wait - call poll_wait() for an OA stream poll() * @stream: An i915-perf stream opened for OA metrics @@ -1172,7 +1179,6 @@ static void i915_oa_poll_wait(struct i915_perf_stream *stream, { poll_wait(file, &stream->poll_wq, wait); } -#endif /** * i915_oa_read - just calls through to &i915_oa_ops->read @@ -1376,8 +1382,6 @@ free_noa_wait(struct i915_perf_stream *stream) static void i915_oa_stream_destroy(struct i915_perf_stream *stream) { - STUB(); -#ifdef notyet struct i915_perf *perf = stream->perf; BUG_ON(stream != perf->exclusive_stream); @@ -1406,9 +1410,10 @@ static void i915_oa_stream_destroy(struct i915_perf_stream *stream) DRM_NOTE("%d spurious OA report notices suppressed due to ratelimiting\n", perf->spurious_report_rs.missed); } -#endif } +#endif + static void gen7_init_oa_buffer(struct i915_perf_stream *stream) { struct intel_uncore *uncore = stream->uncore; @@ -1564,6 +1569,8 @@ static void gen12_init_oa_buffer(struct i915_perf_stream *stream) stream->oa_buffer.vma->size); } +#ifdef notyet + static int alloc_oa_buffer(struct i915_perf_stream *stream) { struct drm_i915_private *i915 = stream->perf->i915; @@ -1830,6 +1837,8 @@ out_ww: return ret; } +#endif + static u32 *write_cs_mi_lri(u32 *cs, const struct i915_oa_reg *reg_data, u32 n_regs) @@ -2702,6 +2711,8 @@ static void gen12_oa_enable(struct i915_perf_stream *stream) GEN12_OAG_OACONTROL_OA_COUNTER_ENABLE); } +#ifdef notyet + /** * i915_oa_stream_enable - handle `I915_PERF_IOCTL_ENABLE` for OA stream * @stream: An i915 perf stream opened for OA metrics @@ -2713,8 +2724,6 @@ static void gen12_oa_enable(struct i915_perf_stream *stream) */ static void i915_oa_stream_enable(struct i915_perf_stream *stream) { - STUB(); -#ifdef notyet stream->pollin = false; stream->perf->ops.oa_enable(stream); @@ -2723,9 +2732,10 @@ static void i915_oa_stream_enable(struct i915_perf_stream *stream) hrtimer_start(&stream->poll_check_timer, ns_to_ktime(stream->poll_oa_period), HRTIMER_MODE_REL_PINNED); -#endif } +#endif + static void gen7_oa_disable(struct i915_perf_stream *stream) { struct intel_uncore *uncore = stream->uncore; @@ -2771,6 +2781,8 @@ static void gen12_oa_disable(struct i915_perf_stream *stream) "wait for OA tlb invalidate timed out\n"); } +#ifdef notyet + /** * i915_oa_stream_disable - handle `I915_PERF_IOCTL_DISABLE` for OA stream * @stream: An i915 perf stream opened for OA metrics @@ -2781,16 +2793,12 @@ static void gen12_oa_disable(struct i915_perf_stream *stream) */ static void i915_oa_stream_disable(struct i915_perf_stream *stream) { - STUB(); -#ifdef notyet stream->perf->ops.oa_disable(stream); if (stream->sample_flags & SAMPLE_OA_REPORT) hrtimer_cancel(&stream->poll_check_timer); -#endif } -#ifdef notyet static const struct i915_perf_stream_ops i915_oa_stream_ops = { .destroy = i915_oa_stream_destroy, .enable = i915_oa_stream_enable, @@ -2799,7 +2807,6 @@ static const struct i915_perf_stream_ops i915_oa_stream_ops = { .poll_wait = i915_oa_poll_wait, .read = i915_oa_read, }; -#endif static int i915_perf_stream_enable_sync(struct i915_perf_stream *stream) { @@ -2838,6 +2845,8 @@ get_default_sseu_config(struct intel_sseu *out_sseu, } } +#endif + static int get_sseu_config(struct intel_sseu *out_sseu, struct intel_engine_cs *engine, @@ -2850,6 +2859,8 @@ get_sseu_config(struct intel_sseu *out_sseu, return i915_gem_user_to_context_sseu(engine->gt, drm_sseu, out_sseu); } +#ifdef notyet + /** * i915_oa_stream_init - validate combined props for OA stream and init * @stream: An i915 perf stream @@ -2872,9 +2883,6 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream, struct drm_i915_perf_open_param *param, struct perf_open_properties *props) { - STUB(); - return -ENOSYS; -#ifdef notyet struct drm_i915_private *i915 = stream->perf->i915; struct i915_perf *perf = stream->perf; int format_size; @@ -3026,9 +3034,10 @@ err_noa_wait_alloc: oa_put_render_ctx_id(stream); return ret; -#endif } +#endif + void i915_oa_init_reg_state(const struct intel_context *ce, const struct intel_engine_cs *engine) { @@ -3043,6 +3052,8 @@ void i915_oa_init_reg_state(const struct intel_context *ce, gen8_update_reg_state_unlocked(ce, stream); } +#ifdef notyet + /** * i915_perf_read - handles read() FOP for i915 perf stream FDs * @file: An i915 perf stream file @@ -3066,9 +3077,6 @@ static ssize_t i915_perf_read(struct file *file, size_t count, loff_t *ppos) { - STUB(); - return -ENOSYS; -#ifdef notyet struct i915_perf_stream *stream = file->private_data; struct i915_perf *perf = stream->perf; size_t offset = 0; @@ -3120,14 +3128,10 @@ static ssize_t i915_perf_read(struct file *file, /* Possible values for ret are 0, -EFAULT, -ENOSPC, -EIO, ... */ return offset ?: (ret ?: -EAGAIN); -#endif } static enum hrtimer_restart oa_poll_check_timer_cb(struct hrtimer *hrtimer) { - STUB(); - return 0; -#ifdef notyet struct i915_perf_stream *stream = container_of(hrtimer, typeof(*stream), poll_check_timer); @@ -3140,11 +3144,8 @@ static enum hrtimer_restart oa_poll_check_timer_cb(struct hrtimer *hrtimer) ns_to_ktime(stream->poll_oa_period)); return HRTIMER_RESTART; -#endif } -#ifdef notyet - /** * i915_perf_poll_locked - poll_wait() with a suitable wait queue for stream * @stream: An i915 perf stream @@ -3206,8 +3207,6 @@ static __poll_t i915_perf_poll(struct file *file, poll_table *wait) return ret; } -#endif /* notyet */ - /** * i915_perf_enable_locked - handle `I915_PERF_IOCTL_ENABLE` ioctl * @stream: A disabled i915 perf stream @@ -3341,9 +3340,6 @@ static long i915_perf_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - STUB(); - return -ENOSYS; -#ifdef notyet struct i915_perf_stream *stream = file->private_data; struct i915_perf *perf = stream->perf; long ret; @@ -3353,7 +3349,6 @@ static long i915_perf_ioctl(struct file *file, mutex_unlock(&perf->lock); return ret; -#endif } /** @@ -3380,8 +3375,6 @@ static void i915_perf_destroy_locked(struct i915_perf_stream *stream) kfree(stream); } -#ifdef notyet - /** * i915_perf_release - handles userspace close() of a stream file * @inode: anonymous inode associated with file @@ -3988,6 +3981,8 @@ static bool gen12_is_valid_mux_addr(struct i915_perf *perf, u32 addr) REG_IN_RANGE(addr, NOA_CONFIG(0), NOA_CONFIG(8)); } +#ifdef notyet + static u32 mask_reg_value(u32 reg, u32 val) { /* HALF_SLICE_CHICKEN2 is programmed with a the @@ -4062,22 +4057,15 @@ static ssize_t show_dynamic_id(struct device *dev, struct device_attribute *attr, char *buf) { - STUB(); - return -ENOSYS; -#ifdef notyet struct i915_oa_config *oa_config = container_of(attr, typeof(*oa_config), sysfs_metric_id); return sprintf(buf, "%d\n", oa_config->id); -#endif } static int create_dynamic_oa_sysfs_entry(struct i915_perf *perf, struct i915_oa_config *oa_config) { - STUB(); - return -ENOSYS; -#ifdef notyet sysfs_attr_init(&oa_config->sysfs_metric_id.attr); oa_config->sysfs_metric_id.attr.name = "id"; oa_config->sysfs_metric_id.attr.mode = S_IRUGO; @@ -4092,9 +4080,10 @@ static int create_dynamic_oa_sysfs_entry(struct i915_perf *perf, return sysfs_create_group(perf->metrics_kobj, &oa_config->sysfs_metric); -#endif } +#endif + /** * i915_perf_add_config_ioctl - DRM ioctl() for userspace to add a new OA config * @dev: drm device