From nobody Sat Nov 15 23:36:36 2025 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=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1746140678; cv=none; d=zohomail.com; s=zohoarc; b=mvuGXCSoMjOJP7Sdrt5IPcf/FEy3+XdbOCUr1wjWAF8+hrcJFmxDu6HUKDcW5Vm/odi43NVpbu1Hk6QbZm+Ulfy42AEfGP3VGnJl7XfzVINPUkUZgoBori6+c+6zHvgGJDX3ZSRLoB2jD5/759bkPmTbbNt02uNCrGMXHMn5QIA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1746140678; 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=WnkKvB1b+3d0EeHxFwXj6FOWV545S5FRjaJFzkqSlRY=; b=LEqBv4f9NV4heIfJno4nEgfxNWgaMyIeXYrjQuj+bEV2k/j2c50xA1dFte1y66TeoRYR1vJ8wlQIybPPUDvvWK27FYMC1kOFowBpeNybmSlwm00WA3P6ezBNKjKgr7rzzshe4No/RfFa3OckWAlM6TQAkRg/+GDeWSsEl1dpHFY= 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=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1746140678629845.9210651805938; Thu, 1 May 2025 16:04:38 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uAcvr-0000ix-PH; Thu, 01 May 2025 19:03:07 -0400 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 1uAcvi-0000bd-DB for qemu-devel@nongnu.org; Thu, 01 May 2025 19:02:59 -0400 Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uAcvg-0002QO-J3 for qemu-devel@nongnu.org; Thu, 01 May 2025 19:02:58 -0400 Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-85df99da233so145625339f.3 for ; Thu, 01 May 2025 16:02:55 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ca18e2360f4ac-864aa2f45adsm29354639f.18.2025.05.01.16.02.50 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 01 May 2025 16:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1746140574; x=1746745374; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WnkKvB1b+3d0EeHxFwXj6FOWV545S5FRjaJFzkqSlRY=; b=mEZAGoZUUGqPYxFrVPteuGgEvOXAt0gAmyMuMmGK58ymTxJEvDrQd+OLXxHcSoOws9 6kI2uG9mZpYWbSHcxOtrr8OMbquJ+Smoph4A0mTGhhle6BPRXFlh4cILU7q1b6FrDqOH w4ktgZ9ulEi/kbQG50/m/UuhgU69OEJpRJPPCDxuGtmYPpBNLS6weC5rPrg3k8s5oBth 3Y2l45LLMeZqA4C5cffyXPbX5XhZkPIKJmmzxO96x38pZEgvj6W9KDsHsI85h8DGWO5+ 7jeYvF3fi+ipJRtMnjGmcy1fCqfQbTS3vPB0EghwTPNt+CLqb7XD7xbv16eBea0aUB6I mdtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1746140574; x=1746745374; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WnkKvB1b+3d0EeHxFwXj6FOWV545S5FRjaJFzkqSlRY=; b=MPVcIA6gVeJdxTL+cFuifI/5HCxn1Fs5Vg5ugGiJm2UYysulcfCIjIlOXST/5ih7Tw 6HoXBC0xPVcZ0uHMyK1ufEp8gXeN/XvYoKOYxjkH5r7i4RZv4mWZw43DCpfV8yZq6D8f 6IWgLTtmgTnslv1DtTvg2lClCpBtJrzqfTbk05ubI531ezmZM1dRmuYjmbGWkyfLstnP 9uSciH9hTMOzGIT1TBcW3C+iYGdrpXt9czAod1a6Bx68l1kQJYNNld3FCSBABH6k8LvJ 6iN5jJO/y7yHE4R3AB7a44cUtqxQOamfv08yCuIGsSIn6So6Hles7Yg/BUzjJTwilCLT iS2w== X-Gm-Message-State: AOJu0YxSXZcmHBepMQ8CuBr0+h+C/u0AR0NNemtvf6HWmTyj2EkW0xZt XgsIdSmf/irzMSuqQ6+jCKdqi8WFTH8UL13E2Cng5SLoDGMvCfciOiMlcY8fp5w8Uxr2vwHa08+ E X-Gm-Gg: ASbGncv90XXyOgoWJcpSKC3CZWWk6yvGGXw/262s0nqgOtRtxjkQFVT9myTeZkKlutK 4bC2/og6TcAl4MNfS555zC0xz9mvNLj4fLCzBLL5A8B4UgvPWfHbR9/l+licEfw79oCGuPjr0Ll /ZReUHOXueVgI/158YDY57rCzjedhBWoNgc1sJRfSBn5149z+GL9RuuHia04IHOb+SVwAHBskCx TD49HZ8js0+1/KWffQO3nlfy6U5C/w1PVtmK5lZzVNh4TpLgF4UPM8pXEqNS8A92DJdeCQVNVxd zAC1CSGru958AkHGJWva8GVpELGaKZaprzJ+QSUdonpsyjFGXw0g/gW4Y0AZQvBRg/AFEn82U7Q XaTE1wwIDREnwLx742An18U6dvGvxC1I= X-Google-Smtp-Source: AGHT+IEiwebta2jjbmeb5yedYFDh3IKB0uoU2Du0UF3wCHzQ38JonuurTlwyuw+/UGzJLdk571OfdA== X-Received: by 2002:a05:6602:4743:b0:864:6a74:b56d with SMTP id ca18e2360f4ac-8669f9b6da2mr136803839f.5.1746140574195; Thu, 01 May 2025 16:02:54 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Yanan Wang , Paolo Bonzini , Gerd Hoffmann , Thomas Huth , Halil Pasic , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marcel Apfelbaum , qemu-rust@nongnu.org, Zhao Liu , Eric Farman , Ilya Leoshkevich , Eduardo Habkost , Jason Wang , David Hildenbrand , Dmitry Fleytman , Richard Henderson , "Michael S. Tsirkin" , qemu-s390x@nongnu.org, Christian Borntraeger Subject: [PATCH 09/10] hw/audio/hda-codec: Remove HDAAudioState::use_timer field Date: Fri, 2 May 2025 01:01:27 +0200 Message-ID: <20250501230129.2596-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250501230129.2596-1-philmd@linaro.org> References: <20250501230129.2596-1-philmd@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2607:f8b0:4864:20::d30; envelope-from=philmd@linaro.org; helo=mail-io1-xd30.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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 @linaro.org) X-ZM-MESSAGEID: 1746140679518124100 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 --- hw/audio/hda-codec.c | 91 +++++++------------------------------------- 1 file changed, 13 insertions(+), 78 deletions(-) diff --git a/hw/audio/hda-codec.c b/hw/audio/hda-codec.c index 66edad280f2..92e1fe65827 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) @@ -366,58 +365,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 AUD_read(st->voice.in, st->compat_buf + st->compat_bpo= s, - 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 AUD_write(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) { @@ -428,16 +375,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) { AUD_set_active_out(st->voice.out, st->running); @@ -474,7 +419,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) { @@ -485,21 +429,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 AUD_open_out(&st->state->card, 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 AUD_open_in(&st->state->card, st->voice.in, st->node->name, st, cb, &st->as); } @@ -805,7 +741,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 { @@ -861,7 +797,6 @@ static const Property hda_audio_properties[] =3D { DEFINE_AUDIO_PROPERTIES(HDAAudioState, card), 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.47.1