Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3594BC47255 for ; Mon, 11 May 2020 09:19:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 093152075E for ; Mon, 11 May 2020 09:19:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 093152075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9618B6E400; Mon, 11 May 2020 09:19:35 +0000 (UTC) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 11DE16E400 for ; Mon, 11 May 2020 09:19:34 +0000 (UTC) IronPort-SDR: qaRKaCqNfcbGCnFfIox2Ag4azuG24AUAWss5FSKIJRBkoUEkb++7L+Y/DE0mLhEpCpkpQTy2Yi WYsm7RBum5QA== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 02:19:33 -0700 IronPort-SDR: sRghqhedUbTNN9LcMSNl20wzJbUuOymLgnLmdKaFPEHAOg3bgFVg4jAJ+joG6445xx8HksmzIA PPIosyC93aFA== X-IronPort-AV: E=Sophos;i="5.73,379,1583222400"; d="scan'208,217";a="436630436" Received: from amanna-mobl1.gar.corp.intel.com (HELO [10.215.120.34]) ([10.215.120.34]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2020 02:19:30 -0700 To: Jani Nikula , Maarten Lankhorst , intel-gfx@lists.freedesktop.org References: <20200506131112.19581-1-animesh.manna@intel.com> <22382e1c-e5e1-f8c8-74f3-83bd6b649978@linux.intel.com> <87mu6e6eky.fsf@intel.com> From: "Manna, Animesh" Message-ID: <91097a91-aee2-babc-520c-2721c764f6f0@intel.com> Date: Mon, 11 May 2020 14:49:27 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <87mu6e6eky.fsf@intel.com> Content-Language: en-US Subject: Re: [Intel-gfx] [PATCH v5] drm/i915/dsb: Pre allocate and late cleanup of cmd buffer X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter Content-Type: multipart/mixed; boundary="===============1527372819==" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This is a multi-part message in MIME format. --===============1527372819== Content-Type: multipart/alternative; boundary="------------AC1F27AEBC5AEF7C18A699E8" Content-Language: en-US This is a multi-part message in MIME format. --------------AC1F27AEBC5AEF7C18A699E8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 11-05-2020 14:19, Jani Nikula wrote: > On Mon, 11 May 2020, "Manna, Animesh" wrote: >> On 08-05-2020 16:44, Maarten Lankhorst wrote: >>> Op 06-05-2020 om 15:11 schreef Animesh Manna: >>>> - struct intel_dsb *dsb = intel_dsb_get(crtc); >>>> + struct intel_dsb *dsb = (struct intel_dsb *)&crtc_state->dsb; >>> Why the cast? Unconstify crtc_state as it's obviously not const any more. >> Dsb cmd buffer filling is done in load_lut function, so need to >> unconstify. Otherwise throwing warning during compilation. > You shouldn't just throw the const away like that using a cast. It's a > bad idea. Don't do it. Hi Jani/Maarten, DSB instance was kept under intel_crtc to avoid typecasting. I do not know a way out to keep dsb-instance in intel_crtc_state and fill the dsb-cmd-buf using load-lut api. Maybe avoid using current load-lut api and create a separate api to fill the cmd_buf can be a solution. Can you please suggest. Regards, Animesh > > BR, > Jani. > > --------------AC1F27AEBC5AEF7C18A699E8 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit


On 11-05-2020 14:19, Jani Nikula wrote:
On Mon, 11 May 2020, "Manna, Animesh" <animesh.manna@intel.com> wrote:
On 08-05-2020 16:44, Maarten Lankhorst wrote:
Op 06-05-2020 om 15:11 schreef Animesh Manna:
-	struct intel_dsb *dsb = intel_dsb_get(crtc);
+	struct intel_dsb *dsb = (struct intel_dsb *)&crtc_state->dsb;
Why the cast? Unconstify crtc_state as it's obviously not const any more.
Dsb cmd buffer filling is done in load_lut function, so need to
unconstify. Otherwise throwing warning during compilation.
You shouldn't just throw the const away like that using a cast. It's a
bad idea. Don't do it.
Hi Jani/Maarten,

DSB instance was kept under intel_crtc to avoid typecasting. I do not know a way out to keep dsb-instance in intel_crtc_state and fill the dsb-cmd-buf using load-lut api.
Maybe avoid using current load-lut api and create a separate api to fill the cmd_buf can be a solution. Can you please suggest.

Regards,
Animesh

BR,
Jani.


--------------AC1F27AEBC5AEF7C18A699E8-- --===============1527372819== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============1527372819==--