From nobody Sat Apr 11 23:03:22 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1772708090; cv=none; d=zohomail.com; s=zohoarc; b=Cf5TmPU3fNsbgiMD5JPOyA6mkTv36DxUuUSxCmzZYFHtMuXUcvKdTARhgd9hA2GeL0inuNkpWLWRsGc3MKIZ2C4usZy3vZnbl5FN5qhhTkeAiCM25ek5BsaUgx04U196NEPo3/crJpLibhrInYMkzULe+uz8RG1VfHY+qLpescI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1772708090; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=WMwRFyszVHwmFHxuLsqKw06eCvsGENQbEI+Ki3As3Oo=; b=jEaTABIVv36PhzpzgoLCKKfJFNjFThwSIXkAz+fQIY+L/vTxTfj/uQGYhqJC3vzIcgrOxnITW4oojj374PLJTLfVESUmHAGUnSVNW71JMaJui5otsSC6u1gsEtEkfvgBgzw8+sIH6+BVAjZhWU9aTlXXz2Xrhs32E8EITKK8BYc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1772708090296537.8872717831439; Thu, 5 Mar 2026 02:54:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vy6L3-0004eE-B4; Thu, 05 Mar 2026 05:53:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vy6L0-0004Sf-Ir for qemu-devel@nongnu.org; Thu, 05 Mar 2026 05:53:50 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vy6Ky-0005l1-QD for qemu-devel@nongnu.org; Thu, 05 Mar 2026 05:53:50 -0500 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-329-H8KRixL6N8SMxSY9T8_Ufg-1; Thu, 05 Mar 2026 05:53:46 -0500 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 545381955DE2; Thu, 5 Mar 2026 10:53:45 +0000 (UTC) Received: from thuth-p1g4.redhat.com (unknown [10.45.224.75]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B9D5D3003E98; Thu, 5 Mar 2026 10:53:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1772708028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WMwRFyszVHwmFHxuLsqKw06eCvsGENQbEI+Ki3As3Oo=; b=bXjQOhXLVOeu0TCOzJL65rB3akqKb5z1KBWdBMQsuCf98F5WRAjrlLOB8SNRMLwd3hKVX0 4GHxQ9IIIZyhN5I9+V8oPHpaMEaprtTWHUnc3Pgvv/iAA4Q++r8QESbix0AohdHA8NtjXZ dOrh3JlsKQ8sKEdrzzbGLHktB/Refdk= X-MC-Unique: H8KRixL6N8SMxSY9T8_Ufg-1 X-Mimecast-MFC-AGG-ID: H8KRixL6N8SMxSY9T8_Ufg_1772708025 From: Thomas Huth To: Peter Maydell Cc: qemu-devel@nongnu.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PULL 27/28] hw/audio/hda-codec: Remove HDAAudioState::use_timer field Date: Thu, 5 Mar 2026 11:52:14 +0100 Message-ID: <20260305105215.302571-28-thuth@redhat.com> In-Reply-To: <20260305105215.302571-1-thuth@redhat.com> References: <20260305105215.302571-1-thuth@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: 33 X-Spam_score: 3.3 X-Spam_bar: +++ X-Spam_report: (3.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_SBL_CSS=3.335, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.703, RCVD_IN_VALIDITY_SAFE_BLOCKED=1.386, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1772708091280158500 From: Philippe Mathieu-Daud=C3=A9 The HDAAudioState::use_timer boolean was only set in the hw_compat_2_12[] array, via the 'use-timer=3Dfalse' property. We removed all machines using that array, lets remove that property and all the code around it, like the compatibility callbacks. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-ID: <20250501230129.2596-10-philmd@linaro.org> Reviewed-by: Thomas Huth [thuth: Rebased the patch to current master branch, fixed conflicts] Signed-off-by: Thomas Huth --- hw/audio/hda-codec.c | 93 +++++++------------------------------------- 1 file changed, 13 insertions(+), 80 deletions(-) diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 984029a8db1..173fe56bea3 100644 --- a/hw/audio/hda-codec.c +++ b/hw/audio/hda-codec.c @@ -187,7 +187,6 @@ struct HDAAudioState { /* properties */ uint32_t debug; bool mixer; - bool use_timer; }; =20 static inline uint32_t hda_bytes_per_second(HDAAudioStream *st) @@ -368,60 +367,6 @@ static void hda_audio_output_cb(void *opaque, int avai= l) hda_timer_sync_adjust(st, (wpos - rpos) - (B_SIZE >> 1)); } =20 -static void hda_audio_compat_input_cb(void *opaque, int avail) -{ - HDAAudioStream *st =3D opaque; - int recv =3D 0; - int len; - bool rc; - - while (avail - recv >=3D sizeof(st->compat_buf)) { - if (st->compat_bpos !=3D sizeof(st->compat_buf)) { - len =3D audio_be_read(st->state->audio_be, st->voice.in, - st->compat_buf + st->compat_bpos, - sizeof(st->compat_buf) - st->compat_bpos); - st->compat_bpos +=3D len; - recv +=3D len; - if (st->compat_bpos !=3D sizeof(st->compat_buf)) { - break; - } - } - rc =3D hda_codec_xfer(&st->state->hda, st->stream, false, - st->compat_buf, sizeof(st->compat_buf)); - if (!rc) { - break; - } - st->compat_bpos =3D 0; - } -} - -static void hda_audio_compat_output_cb(void *opaque, int avail) -{ - HDAAudioStream *st =3D opaque; - int sent =3D 0; - int len; - bool rc; - - while (avail - sent >=3D sizeof(st->compat_buf)) { - if (st->compat_bpos =3D=3D sizeof(st->compat_buf)) { - rc =3D hda_codec_xfer(&st->state->hda, st->stream, true, - st->compat_buf, sizeof(st->compat_buf)); - if (!rc) { - break; - } - st->compat_bpos =3D 0; - } - len =3D audio_be_write(st->state->audio_be, st->voice.out, - st->compat_buf + st->compat_bpos, - sizeof(st->compat_buf) - st->compat_bpos); - st->compat_bpos +=3D len; - sent +=3D len; - if (st->compat_bpos !=3D sizeof(st->compat_buf)) { - break; - } - } -} - static void hda_audio_set_running(HDAAudioStream *st, bool running) { if (st->node =3D=3D NULL) { @@ -432,16 +377,14 @@ static void hda_audio_set_running(HDAAudioStream *st,= bool running) } st->running =3D running; trace_hda_audio_running(st->node->name, st->stream, st->running); - if (st->state->use_timer) { - if (running) { - int64_t now =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); - st->rpos =3D 0; - st->wpos =3D 0; - st->buft_start =3D now; - timer_mod_anticipate_ns(st->buft, now + HDA_TIMER_TICKS); - } else { - timer_del(st->buft); - } + if (running) { + int64_t now =3D qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL); + st->rpos =3D 0; + st->wpos =3D 0; + st->buft_start =3D now; + timer_mod_anticipate_ns(st->buft, now + HDA_TIMER_TICKS); + } else { + timer_del(st->buft); } if (st->output) { audio_be_set_active_out(st->state->audio_be, st->voice.out, st->ru= nning); @@ -480,7 +423,6 @@ static void hda_audio_set_amp(HDAAudioStream *st) =20 static void hda_audio_setup(HDAAudioStream *st) { - bool use_timer =3D st->state->use_timer; audio_callback_fn cb; =20 if (st->node =3D=3D NULL) { @@ -491,21 +433,13 @@ static void hda_audio_setup(HDAAudioStream *st) fmt2name[st->as.fmt], st->as.freq); =20 if (st->output) { - if (use_timer) { - cb =3D hda_audio_output_cb; - timer_del(st->buft); - } else { - cb =3D hda_audio_compat_output_cb; - } + cb =3D hda_audio_output_cb; + timer_del(st->buft); st->voice.out =3D audio_be_open_out(st->state->audio_be, st->voice= .out, st->node->name, st, cb, &st->as); } else { - if (use_timer) { - cb =3D hda_audio_input_cb; - timer_del(st->buft); - } else { - cb =3D hda_audio_compat_input_cb; - } + cb =3D hda_audio_input_cb; + timer_del(st->buft); st->voice.in =3D audio_be_open_in(st->state->audio_be, st->voice.i= n, st->node->name, st, cb, &st->as); } @@ -810,7 +744,7 @@ static void hda_audio_reset(DeviceState *dev) static bool vmstate_hda_audio_stream_buf_needed(void *opaque) { HDAAudioStream *st =3D opaque; - return st->state && st->state->use_timer; + return st->state; } =20 static const VMStateDescription vmstate_hda_audio_stream_buf =3D { @@ -866,7 +800,6 @@ static const Property hda_audio_properties[] =3D { DEFINE_AUDIO_PROPERTIES(HDAAudioState, audio_be), DEFINE_PROP_UINT32("debug", HDAAudioState, debug, 0), DEFINE_PROP_BOOL("mixer", HDAAudioState, mixer, true), - DEFINE_PROP_BOOL("use-timer", HDAAudioState, use_timer, true), }; =20 static void hda_audio_init_output(HDACodecDevice *hda, Error **errp) --=20 2.53.0