KR20220065650A - Electrnonic device and method for image rendering thereof - Google Patents

Electrnonic device and method for image rendering thereof Download PDF

Info

Publication number
KR20220065650A
KR20220065650A KR1020210052642A KR20210052642A KR20220065650A KR 20220065650 A KR20220065650 A KR 20220065650A KR 1020210052642 A KR1020210052642 A KR 1020210052642A KR 20210052642 A KR20210052642 A KR 20210052642A KR 20220065650 A KR20220065650 A KR 20220065650A
Authority
KR
South Korea
Prior art keywords
frame
electronic device
display
thread
gpu
Prior art date
Application number
KR1020210052642A
Other languages
Korean (ko)
Inventor
김도현
이고르 나자로브
Original Assignee
삼성전자주식회사
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 삼성전자주식회사 filed Critical 삼성전자주식회사
Priority to PCT/KR2021/016648 priority Critical patent/WO2022103225A1/en
Priority to US17/544,411 priority patent/US11935149B2/en
Publication of KR20220065650A publication Critical patent/KR20220065650A/en

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/50Controlling the output signals based on the game progress
    • A63F13/52Controlling the output signals based on the game progress involving aspects of the displayed game scene
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/25Output arrangements for video game devices
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/837Shooting of targets
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Controls And Circuits For Display Device (AREA)

Abstract

The present invention provides an electronic device capable of outputting image content by stable and uniform frame intervals in accordance with a target frame rate when rendering the image content. According to various embodiments of the present invention, the electronic device comprises a display, a memory, and a processor operatively connected to the display and the memory. The processor can be configured to create a main thread associated with data processing and input of a user on an application and a render thread rendering image data in frame units based on data processed by the main thread in response to execution of the application, set a target frame rate to display an execution screen of the application on the display, calculate expected processing time of a current frame based on processing time of at least one previous frame outputted through the display, determine a time margin based on the target frame rate and the calculated expected processing time, and perform the data processing and the input of the user after the main thread waits in a sleep state during the time margin.

Description

전자 장치 및 전자 장치의 이미지 렌더링 방법 {ELECTRNONIC DEVICE AND METHOD FOR IMAGE RENDERING THEREOF}ELECTRONIC DEVICE AND METHOD FOR IMAGE RENDERING THEREOF

본 문서는 전자 장치에 관한 것이며, 예를 들어, 이미지 컨텐츠의 렌더링 시 프레임 레이트(frame rate)를 조정할 수 있는 전자 장치 및 전자 장치의 이미지 렌더링 방법에 대한 것이다.This document relates to an electronic device, for example, an electronic device capable of adjusting a frame rate when rendering image content, and an image rendering method of the electronic device.

이동통신 및 하드웨어/소프트웨어 기술의 발달에 따라, 스마트폰으로 대표되는 휴대용 전자 장치(이하, 전자 장치)는 진화를 거듭하여 다양한 기능들을 탑재할 수 있게 되었다. 전자 장치는 다양한 어플리케이션을 설치 및 실행하여 사용자에게 다양한 사용자 경험을 제공할 수 있다. 게임과 같은 어플리케이션은 실시간으로 이미지 컨텐츠를 생성하여 디스플레이 상에 제공할 수 있다.With the development of mobile communication and hardware/software technology, a portable electronic device (hereinafter, referred to as an electronic device) represented by a smart phone has evolved and can be equipped with various functions. The electronic device may provide various user experiences to users by installing and executing various applications. An application such as a game may generate image content in real time and provide it on a display.

전자 장치는 어플리케이션에서 생성한 이미지 컨텐츠를 다양한 그래픽 API(application programming interface)를 이용하여 렌더링 하여 디스플레이에 표시할 수 있다. 전자 장치는 디스플레이 상에 이미지 컨텐츠를 주어진 프레임 레이트(frame rate)에 따라 출력하기 위해, 이미지 컨텐츠의 각 프레임의 출력 타이밍을 스케줄링 할 수 있다.The electronic device may render image content generated by an application using various graphic application programming interfaces (APIs) and display it on a display. The electronic device may schedule an output timing of each frame of the image content to output the image content on the display according to a given frame rate.

전자 장치가 어플리케이션에서 제공되는 이미지 컨텐츠를 렌더링하는 경우, 그래픽 API는 디스플레이 서브 시스템에서 제공되는 수직 동기 신호를 어플리케이션에 제공하고, 어플리케이션은 이를 프레임 페이싱(frame pacing)을 수행할 수 있다. 이 경우, 타겟 프레임 레이트에 맞추어 어플리케이션이 이미지 프레임의 출력 타이밍을 조정할 수 있으나, 해당 이미지 프레임이 디스플레이 상에 출력되는 타이밍을 정확히 맞추는 것은 어려울 수 있다.When the electronic device renders image content provided by the application, the graphic API may provide the vertical synchronization signal provided from the display subsystem to the application, and the application may perform frame pacing. In this case, the application may adjust the output timing of the image frame according to the target frame rate, but it may be difficult to accurately match the timing at which the corresponding image frame is output on the display.

전자 장치에서 사용할 수 있는 그래픽 API 중 일부는 현재 렌더링 되는 이미지 프레임이 언제 디스플레이 상에 출력될 지에 대한 타이밍을 설정하는 기능을 제공할 수 있다. 하지만, 해당 그래픽 API를 사용 하더라도, 과거에 이미 출력된 프레임들의 정보를 제공하므로 현재 렌더링 중인 프레임의 정보는 얻을 수 없기 때문에, 향후 렌더링 할 이미지 프레임의 정확한 출력 타이밍을 스케줄링 하기 어려울 수 있다.Some of the graphic APIs usable in the electronic device may provide a function of setting timing for when the currently rendered image frame is output on the display. However, even if the corresponding graphic API is used, it may be difficult to schedule an accurate output timing of an image frame to be rendered in the future because information on a frame currently being rendered cannot be obtained because information on frames that have already been output in the past is provided.

다양한 실시예에 따른 전자 장치는, 디스플레이, 메모리, 및 상기 디스플레이 및 상기 메모리와 작동적으로 연결되는 프로세서를 포함하고, 상기 프로세서는, 어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하고, 상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하고, 상기 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하고, 상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하고, 및 상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하도록 설정될 수 있다.An electronic device according to various embodiments of the present disclosure includes a display, a memory, and a processor operatively connected to the display and the memory, wherein the processor processes user input and data on the application in response to the execution of the application A main thread related to and a render thread for rendering image data in units of frames based on data processed in the main thread, and displaying an execution screen of the application on the display setting a target frame rate, calculating an expected processing time of the current frame based on the processing time of at least one previous frame output through the display, and based on the target frame rate and the calculated expected processing time, It may be configured to determine a time margin and perform the user input and data processing after the main thread waits in a sleep state for the time margin.

다양한 실시예에 따른 전자 장치의 이미지 렌더링 방법은, 어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하는 동작, 상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하는 동작, 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하는 동작, 상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하는 동작, 및 상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하는 동작을 포함할 수 있다.An image rendering method of an electronic device according to various embodiments includes a main thread related to a user input and data processing in the application in response to execution of an application, and a frame unit based on data processed in the main thread An operation of creating a render thread for rendering raw image data, an operation of setting a target frame rate for displaying the execution screen of the application on the display, and processing of at least one previous frame output through the display calculating an expected processing time of the current frame based on time, determining a time margin based on the target frame rate and the calculated expected processing time, and causing the main thread to execute the time margin It may include an operation of performing the user input and data processing after waiting in the sleep state for a while.

본 문서의 다양한 실시예에 따르면, 이미지 컨텐츠의 렌더링 시에, 타겟 프레임 레이트에 따라 안정 적이고 균일한 프레임 간격에 의해 이미지 컨텐츠를 출력할 수 있는 전자 장치 및 전자 장치의 이미지 렌더링 방법을 제공할 수 있다.According to various embodiments of the present disclosure, it is possible to provide an electronic device capable of outputting image content at a stable and uniform frame interval according to a target frame rate and an image rendering method of the electronic device when rendering image content. .

도 1은 다양한 실시예들에 따른, 네트워크 환경 내의 전자 장치의 블록도이다.
도 2는 다양한 실시예에 따른 전자 장치의 블록도이다.
도 3은 다양한 실시예에 따른 이미지 렌더링에 사용되는 구성의 블록도이다.
도 4는 그래픽 API의 타이밍 확장 기능을 사용하지 않은 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 5는 그래픽 API의 타이밍 확장 기능을 사용한 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 6은 그래픽 API의 타이밍 확장 기능을 사용하고 present 타이밍을 조절한 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 7은 present 동작을 CPU의 렌더 스레드에서 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 8은 present 동작을 스왑체인 스레드에서 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 9는 GPU vertex 처리와 fragment 처리를 병렬로 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.
도 10은 SPE(sync frame end)를 사용하기 이전에 게임 엔진에서 수행되는 스레드의 일 예를 도시한 것이다.
도 11은 SPE를 사용한 이후 게임 엔진에서 수행되는 스레드의 일 예를 도시한 것이다.
도 12는 다양한 실시예에 따른 전자 장치의 이미지 렌더링 방법의 흐름도이다.
1 is a block diagram of an electronic device in a network environment, according to various embodiments of the present disclosure;
2 is a block diagram of an electronic device according to various embodiments of the present disclosure;
3 is a block diagram of a configuration used for image rendering according to various embodiments of the present disclosure;
4 is a diagram illustrating processing of each frame in an embodiment in which the timing extension function of the graphic API is not used.
5 is a diagram illustrating a process of processing each frame in an embodiment using the timing extension function of the graphic API.
6 is a diagram illustrating a process of processing each frame in an embodiment in which the timing extension function of the graphic API is used and the present timing is adjusted.
7 illustrates a processing process of each frame in an embodiment in which the present operation is processed by the render thread of the CPU.
FIG. 8 shows the processing process of each frame in an embodiment in which the present operation is processed by the swap chain thread.
9 shows a processing process of each frame in an embodiment in which GPU vertex processing and fragment processing are processed in parallel.
10 illustrates an example of a thread executed in a game engine before using a sync frame end (SPE).
11 illustrates an example of a thread executed in a game engine after using the SPE.
12 is a flowchart of an image rendering method of an electronic device according to various embodiments of the present disclosure;

도 1은, 다양한 실시예들에 따른, 네트워크 환경(100) 내의 전자 장치(101)의 블록도이다. 도 1을 참조하면, 네트워크 환경(100)에서 전자 장치(101)는 제 1 네트워크(198)(예: 근거리 무선 통신 네트워크)를 통하여 전자 장치(102)와 통신하거나, 또는 제 2 네트워크(199)(예: 원거리 무선 통신 네트워크)를 통하여 전자 장치(104) 또는 서버(108) 중 적어도 하나와 통신할 수 있다. 일실시예에 따르면, 전자 장치(101)는 서버(108)를 통하여 전자 장치(104)와 통신할 수 있다. 일실시예에 따르면, 전자 장치(101)는 프로세서(120), 메모리(130), 입력 모듈(150), 음향 출력 모듈(155), 디스플레이 모듈(160), 오디오 모듈(170), 센서 모듈(176), 인터페이스(177), 연결 단자(178), 햅틱 모듈(179), 카메라 모듈(180), 전력 관리 모듈(188), 배터리(189), 통신 모듈(190), 가입자 식별 모듈(196), 또는 안테나 모듈(197)을 포함할 수 있다. 어떤 실시예에서는, 전자 장치(101)에는, 이 구성요소들 중 적어도 하나(예: 연결 단자(178))가 생략되거나, 하나 이상의 다른 구성요소가 추가될 수 있다. 어떤 실시예에서는, 이 구성요소들 중 일부들(예: 센서 모듈(176), 카메라 모듈(180), 또는 안테나 모듈(197))은 하나의 구성요소(예: 디스플레이 모듈(160))로 통합될 수 있다.1 is a block diagram of an electronic device 101 in a network environment 100 according to various embodiments. Referring to FIG. 1 , in a network environment 100 , an electronic device 101 communicates with an electronic device 102 through a first network 198 (eg, a short-range wireless communication network) or a second network 199 . It may communicate with at least one of the electronic device 104 and the server 108 through (eg, a long-distance wireless communication network). According to an embodiment, the electronic device 101 may communicate with the electronic device 104 through the server 108 . According to an embodiment, the electronic device 101 includes a processor 120 , a memory 130 , an input module 150 , a sound output module 155 , a display module 160 , an audio module 170 , and a sensor module ( 176), interface 177, connection terminal 178, haptic module 179, camera module 180, power management module 188, battery 189, communication module 190, subscriber identification module 196 , or an antenna module 197 may be included. In some embodiments, at least one of these components (eg, the connection terminal 178 ) may be omitted or one or more other components may be added to the electronic device 101 . In some embodiments, some of these components (eg, sensor module 176 , camera module 180 , or antenna module 197 ) are integrated into one component (eg, display module 160 ). can be

프로세서(120)는, 예를 들면, 소프트웨어(예: 프로그램(140))를 실행하여 프로세서(120)에 연결된 전자 장치(101)의 적어도 하나의 다른 구성요소(예: 하드웨어 또는 소프트웨어 구성요소)를 제어할 수 있고, 다양한 데이터 처리 또는 연산을 수행할 수 있다. 일실시예에 따르면, 데이터 처리 또는 연산의 적어도 일부로서, 프로세서(120)는 다른 구성요소(예: 센서 모듈(176) 또는 통신 모듈(190))로부터 수신된 명령 또는 데이터를 휘발성 메모리(132)에 저장하고, 휘발성 메모리(132)에 저장된 명령 또는 데이터를 처리하고, 결과 데이터를 비휘발성 메모리(134)에 저장할 수 있다. 일실시예에 따르면, 프로세서(120)는 메인 프로세서(121)(예: 중앙 처리 장치 또는 어플리케이션 프로세서) 또는 이와는 독립적으로 또는 함께 운영 가능한 보조 프로세서(123)(예: 그래픽 처리 장치, 신경망 처리 장치(NPU: neural processing unit), 이미지 시그널 프로세서, 센서 허브 프로세서, 또는 커뮤니케이션 프로세서)를 포함할 수 있다. 예를 들어, 전자 장치(101)가 메인 프로세서(121) 및 보조 프로세서(123)를 포함하는 경우, 보조 프로세서(123)는 메인 프로세서(121)보다 저전력을 사용하거나, 지정된 기능에 특화되도록 설정될 수 있다. 보조 프로세서(123)는 메인 프로세서(121)와 별개로, 또는 그 일부로서 구현될 수 있다.The processor 120, for example, executes software (eg, a program 140) to execute at least one other component (eg, a hardware or software component) of the electronic device 101 connected to the processor 120 . It can control and perform various data processing or operations. According to one embodiment, as at least part of data processing or operation, the processor 120 converts commands or data received from other components (eg, the sensor module 176 or the communication module 190 ) to the volatile memory 132 . may be stored in the volatile memory 132 , and may process commands or data stored in the volatile memory 132 , and store the result data in the non-volatile memory 134 . According to an embodiment, the processor 120 is the main processor 121 (eg, a central processing unit or an application processor) or a secondary processor 123 (eg, a graphic processing unit, a neural network processing unit) a neural processing unit (NPU), an image signal processor, a sensor hub processor, or a communication processor). For example, when the electronic device 101 includes the main processor 121 and the sub-processor 123 , the sub-processor 123 uses less power than the main processor 121 or is set to be specialized for a specified function. can The auxiliary processor 123 may be implemented separately from or as a part of the main processor 121 .

보조 프로세서(123)는, 예를 들면, 메인 프로세서(121)가 인액티브(예: 슬립) 상태에 있는 동안 메인 프로세서(121)를 대신하여, 또는 메인 프로세서(121)가 액티브(예: 어플리케이션 실행) 상태에 있는 동안 메인 프로세서(121)와 함께, 전자 장치(101)의 구성요소들 중 적어도 하나의 구성요소(예: 디스플레이 모듈(160), 센서 모듈(176), 또는 통신 모듈(190))와 관련된 기능 또는 상태들의 적어도 일부를 제어할 수 있다. 일실시예에 따르면, 보조 프로세서(123)(예: 이미지 시그널 프로세서 또는 커뮤니케이션 프로세서)는 기능적으로 관련 있는 다른 구성요소(예: 카메라 모듈(180) 또는 통신 모듈(190))의 일부로서 구현될 수 있다. 일실시예에 따르면, 보조 프로세서(123)(예: 신경망 처리 장치)는 인공지능 모델의 처리에 특화된 하드웨어 구조를 포함할 수 있다. 인공지능 모델은 기계 학습을 통해 생성될 수 있다. 이러한 학습은, 예를 들어, 인공지능 모델이 수행되는 전자 장치(101) 자체에서 수행될 수 있고, 별도의 서버(예: 서버(108))를 통해 수행될 수도 있다. 학습 알고리즘은, 예를 들어, 지도형 학습(supervised learning), 비지도형 학습(unsupervised learning), 준지도형 학습(semi-supervised learning) 또는 강화 학습(reinforcement learning)을 포함할 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은, 복수의 인공 신경망 레이어들을 포함할 수 있다. 인공 신경망은 심층 신경망(DNN: deep neural network), CNN(convolutional neural network), RNN(recurrent neural network), RBM(restricted boltzmann machine), DBN(deep belief network), BRDNN(bidirectional recurrent deep neural network), 심층 Q-네트워크(deep Q-networks) 또는 상기 중 둘 이상의 조합 중 하나일 수 있으나, 전술한 예에 한정되지 않는다. 인공지능 모델은 하드웨어 구조 이외에, 추가적으로 또는 대체적으로, 소프트웨어 구조를 포함할 수 있다.The auxiliary processor 123 is, for example, on behalf of the main processor 121 while the main processor 121 is in an inactive (eg, sleep) state, or the main processor 121 is active (eg, executing an application). ), together with the main processor 121, at least one of the components of the electronic device 101 (eg, the display module 160, the sensor module 176, or the communication module 190) It is possible to control at least some of the related functions or states. According to an embodiment, the co-processor 123 (eg, an image signal processor or a communication processor) may be implemented as part of another functionally related component (eg, the camera module 180 or the communication module 190). there is. According to an embodiment, the auxiliary processor 123 (eg, a neural network processing device) may include a hardware structure specialized for processing an artificial intelligence model. Artificial intelligence models can be created through machine learning. Such learning may be performed, for example, in the electronic device 101 itself on which the artificial intelligence model is performed, or may be performed through a separate server (eg, the server 108). The learning algorithm may include, for example, supervised learning, unsupervised learning, semi-supervised learning, or reinforcement learning, but in the above example not limited The artificial intelligence model may include a plurality of artificial neural network layers. Artificial neural networks include deep neural networks (DNNs), convolutional neural networks (CNNs), recurrent neural networks (RNNs), restricted boltzmann machines (RBMs), deep belief networks (DBNs), bidirectional recurrent deep neural networks (BRDNNs), It may be one of deep Q-networks or a combination of two or more of the above, but is not limited to the above example. The artificial intelligence model may include, in addition to, or alternatively, a software structure in addition to the hardware structure.

메모리(130)는, 전자 장치(101)의 적어도 하나의 구성요소(예: 프로세서(120) 또는 센서 모듈(176))에 의해 사용되는 다양한 데이터를 저장할 수 있다. 데이터는, 예를 들어, 소프트웨어(예: 프로그램(140)) 및, 이와 관련된 명령에 대한 입력 데이터 또는 출력 데이터를 포함할 수 있다. 메모리(130)는, 휘발성 메모리(132) 또는 비휘발성 메모리(134)를 포함할 수 있다. The memory 130 may store various data used by at least one component of the electronic device 101 (eg, the processor 120 or the sensor module 176 ). The data may include, for example, input data or output data for software (eg, the program 140 ) and instructions related thereto. The memory 130 may include a volatile memory 132 or a non-volatile memory 134 .

프로그램(140)은 메모리(130)에 소프트웨어로서 저장될 수 있으며, 예를 들면, 운영 체제(142), 미들 웨어(144) 또는 어플리케이션(146)을 포함할 수 있다. The program 140 may be stored as software in the memory 130 , and may include, for example, an operating system 142 , middleware 144 , or an application 146 .

입력 모듈(150)은, 전자 장치(101)의 구성요소(예: 프로세서(120))에 사용될 명령 또는 데이터를 전자 장치(101)의 외부(예: 사용자)로부터 수신할 수 있다. 입력 모듈(150)은, 예를 들면, 마이크, 마우스, 키보드, 키(예: 버튼), 또는 디지털 펜(예: 스타일러스 펜)을 포함할 수 있다. The input module 150 may receive a command or data to be used in a component (eg, the processor 120 ) of the electronic device 101 from the outside (eg, a user) of the electronic device 101 . The input module 150 may include, for example, a microphone, a mouse, a keyboard, a key (eg, a button), or a digital pen (eg, a stylus pen).

음향 출력 모듈(155)은 음향 신호를 전자 장치(101)의 외부로 출력할 수 있다. 음향 출력 모듈(155)은, 예를 들면, 스피커 또는 리시버를 포함할 수 있다. 스피커는 멀티미디어 재생 또는 녹음 재생과 같이 일반적인 용도로 사용될 수 있다. 리시버는 착신 전화를 수신하기 위해 사용될 수 있다. 일실시예에 따르면, 리시버는 스피커와 별개로, 또는 그 일부로서 구현될 수 있다.The sound output module 155 may output a sound signal to the outside of the electronic device 101 . The sound output module 155 may include, for example, a speaker or a receiver. The speaker can be used for general purposes such as multimedia playback or recording playback. The receiver may be used to receive an incoming call. According to one embodiment, the receiver may be implemented separately from or as part of the speaker.

디스플레이 모듈(160)은 전자 장치(101)의 외부(예: 사용자)로 정보를 시각적으로 제공할 수 있다. 디스플레이 모듈(160)은, 예를 들면, 디스플레이, 홀로그램 장치, 또는 프로젝터 및 해당 장치를 제어하기 위한 제어 회로를 포함할 수 있다. 일실시예에 따르면, 디스플레이 모듈(160)은 터치를 감지하도록 설정된 터치 센서, 또는 상기 터치에 의해 발생되는 힘의 세기를 측정하도록 설정된 압력 센서를 포함할 수 있다. The display module 160 may visually provide information to the outside (eg, a user) of the electronic device 101 . The display module 160 may include, for example, a control circuit for controlling a display, a hologram device, or a projector and a corresponding device. According to an embodiment, the display module 160 may include a touch sensor configured to sense a touch or a pressure sensor configured to measure the intensity of a force generated by the touch.

오디오 모듈(170)은 소리를 전기 신호로 변환시키거나, 반대로 전기 신호를 소리로 변환시킬 수 있다. 일실시예에 따르면, 오디오 모듈(170)은, 입력 모듈(150)을 통해 소리를 획득하거나, 음향 출력 모듈(155), 또는 전자 장치(101)와 직접 또는 무선으로 연결된 외부 전자 장치(예: 전자 장치(102))(예: 스피커 또는 헤드폰)를 통해 소리를 출력할 수 있다.The audio module 170 may convert a sound into an electric signal or, conversely, convert an electric signal into a sound. According to an embodiment, the audio module 170 acquires a sound through the input module 150 , or an external electronic device (eg, a sound output module 155 ) connected directly or wirelessly with the electronic device 101 . A sound may be output through the electronic device 102 (eg, a speaker or headphones).

센서 모듈(176)은 전자 장치(101)의 작동 상태(예: 전력 또는 온도), 또는 외부의 환경 상태(예: 사용자 상태)를 감지하고, 감지된 상태에 대응하는 전기 신호 또는 데이터 값을 생성할 수 있다. 일실시예에 따르면, 센서 모듈(176)은, 예를 들면, 제스처 센서, 자이로 센서, 기압 센서, 마그네틱 센서, 가속도 센서, 그립 센서, 근접 센서, 컬러 센서, IR(infrared) 센서, 생체 센서, 온도 센서, 습도 센서, 또는 조도 센서를 포함할 수 있다. The sensor module 176 detects an operating state (eg, power or temperature) of the electronic device 101 or an external environmental state (eg, user state), and generates an electrical signal or data value corresponding to the sensed state. can do. According to an embodiment, the sensor module 176 may include, for example, a gesture sensor, a gyro sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a grip sensor, a proximity sensor, a color sensor, an IR (infrared) sensor, a biometric sensor, It may include a temperature sensor, a humidity sensor, or an illuminance sensor.

인터페이스(177)는 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 직접 또는 무선으로 연결되기 위해 사용될 수 있는 하나 이상의 지정된 프로토콜들을 지원할 수 있다. 일실시예에 따르면, 인터페이스(177)는, 예를 들면, HDMI(high definition multimedia interface), USB(universal serial bus) 인터페이스, SD카드 인터페이스, 또는 오디오 인터페이스를 포함할 수 있다.The interface 177 may support one or more designated protocols that may be used by the electronic device 101 to directly or wirelessly connect with an external electronic device (eg, the electronic device 102 ). According to an embodiment, the interface 177 may include, for example, a high definition multimedia interface (HDMI), a universal serial bus (USB) interface, an SD card interface, or an audio interface.

연결 단자(178)는, 그를 통해서 전자 장치(101)가 외부 전자 장치(예: 전자 장치(102))와 물리적으로 연결될 수 있는 커넥터를 포함할 수 있다. 일실시예에 따르면, 연결 단자(178)는, 예를 들면, HDMI 커넥터, USB 커넥터, SD 카드 커넥터, 또는 오디오 커넥터(예: 헤드폰 커넥터)를 포함할 수 있다.The connection terminal 178 may include a connector through which the electronic device 101 can be physically connected to an external electronic device (eg, the electronic device 102 ). According to an embodiment, the connection terminal 178 may include, for example, an HDMI connector, a USB connector, an SD card connector, or an audio connector (eg, a headphone connector).

햅틱 모듈(179)은 전기적 신호를 사용자가 촉각 또는 운동 감각을 통해서 인지할 수 있는 기계적인 자극(예: 진동 또는 움직임) 또는 전기적인 자극으로 변환할 수 있다. 일실시예에 따르면, 햅틱 모듈(179)은, 예를 들면, 모터, 압전 소자, 또는 전기 자극 장치를 포함할 수 있다.The haptic module 179 may convert an electrical signal into a mechanical stimulus (eg, vibration or movement) or an electrical stimulus that the user can perceive through tactile or kinesthetic sense. According to an embodiment, the haptic module 179 may include, for example, a motor, a piezoelectric element, or an electrical stimulation device.

카메라 모듈(180)은 정지 영상 및 동영상을 촬영할 수 있다. 일실시예에 따르면, 카메라 모듈(180)은 하나 이상의 렌즈들, 이미지 센서들, 이미지 시그널 프로세서들, 또는 플래시들을 포함할 수 있다.The camera module 180 may capture still images and moving images. According to an embodiment, the camera module 180 may include one or more lenses, image sensors, image signal processors, or flashes.

전력 관리 모듈(188)은 전자 장치(101)에 공급되는 전력을 관리할 수 있다. 일실시예에 따르면, 전력 관리 모듈(188)은, 예를 들면, PMIC(power management integrated circuit)의 적어도 일부로서 구현될 수 있다.The power management module 188 may manage power supplied to the electronic device 101 . According to an embodiment, the power management module 188 may be implemented as, for example, at least a part of a power management integrated circuit (PMIC).

배터리(189)는 전자 장치(101)의 적어도 하나의 구성요소에 전력을 공급할 수 있다. 일실시예에 따르면, 배터리(189)는, 예를 들면, 재충전 불가능한 1차 전지, 재충전 가능한 2차 전지 또는 연료 전지를 포함할 수 있다.The battery 189 may supply power to at least one component of the electronic device 101 . According to one embodiment, battery 189 may include, for example, a non-rechargeable primary cell, a rechargeable secondary cell, or a fuel cell.

통신 모듈(190)은 전자 장치(101)와 외부 전자 장치(예: 전자 장치(102), 전자 장치(104), 또는 서버(108)) 간의 직접(예: 유선) 통신 채널 또는 무선 통신 채널의 수립, 및 수립된 통신 채널을 통한 통신 수행을 지원할 수 있다. 통신 모듈(190)은 프로세서(120)(예: 어플리케이션 프로세서)와 독립적으로 운영되고, 직접(예: 유선) 통신 또는 무선 통신을 지원하는 하나 이상의 커뮤니케이션 프로세서를 포함할 수 있다. 일실시예에 따르면, 통신 모듈(190)은 무선 통신 모듈(192)(예: 셀룰러 통신 모듈, 근거리 무선 통신 모듈, 또는 GNSS(global navigation satellite system) 통신 모듈) 또는 유선 통신 모듈(194)(예: LAN(local area network) 통신 모듈, 또는 전력선 통신 모듈)을 포함할 수 있다. 이들 통신 모듈 중 해당하는 통신 모듈은 제 1 네트워크(198)(예: 블루투스, WiFi(wireless fidelity) direct 또는 IrDA(infrared data association)와 같은 근거리 통신 네트워크) 또는 제 2 네트워크(199)(예: 레거시 셀룰러 네트워크, 5G 네트워크, 차세대 통신 네트워크, 인터넷, 또는 컴퓨터 네트워크(예: LAN 또는 WAN)와 같은 원거리 통신 네트워크)를 통하여 외부의 전자 장치(104)와 통신할 수 있다. 이런 여러 종류의 통신 모듈들은 하나의 구성요소(예: 단일 칩)로 통합되거나, 또는 서로 별도의 복수의 구성요소들(예: 복수 칩들)로 구현될 수 있다. 무선 통신 모듈(192)은 가입자 식별 모듈(196)에 저장된 가입자 정보(예: 국제 모바일 가입자 식별자(IMSI))를 이용하여 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크 내에서 전자 장치(101)를 확인 또는 인증할 수 있다. The communication module 190 is a direct (eg, wired) communication channel or a wireless communication channel between the electronic device 101 and an external electronic device (eg, the electronic device 102, the electronic device 104, or the server 108). It can support establishment and communication performance through the established communication channel. The communication module 190 may include one or more communication processors that operate independently of the processor 120 (eg, an application processor) and support direct (eg, wired) communication or wireless communication. According to one embodiment, the communication module 190 is a wireless communication module 192 (eg, a cellular communication module, a short-range wireless communication module, or a global navigation satellite system (GNSS) communication module) or a wired communication module 194 (eg, : It may include a LAN (local area network) communication module, or a power line communication module). A corresponding communication module among these communication modules is a first network 198 (eg, a short-range communication network such as Bluetooth, wireless fidelity (WiFi) direct, or infrared data association (IrDA)) or a second network 199 (eg, legacy It may communicate with the external electronic device 104 through a cellular network, a 5G network, a next-generation communication network, the Internet, or a computer network (eg, a telecommunication network such as a LAN or a WAN). These various types of communication modules may be integrated into one component (eg, a single chip) or may be implemented as a plurality of components (eg, multiple chips) separate from each other. The wireless communication module 192 uses the subscriber information (eg, International Mobile Subscriber Identifier (IMSI)) stored in the subscriber identification module 196 within a communication network such as the first network 198 or the second network 199 . The electronic device 101 may be identified or authenticated.

무선 통신 모듈(192)은 4G 네트워크 이후의 5G 네트워크 및 차세대 통신 기술, 예를 들어, NR 접속 기술(new radio access technology)을 지원할 수 있다. NR 접속 기술은 고용량 데이터의 고속 전송(eMBB(enhanced mobile broadband)), 단말 전력 최소화와 다수 단말의 접속(mMTC(massive machine type communications)), 또는 고신뢰도와 저지연(URLLC(ultra-reliable and low-latency communications))을 지원할 수 있다. 무선 통신 모듈(192)은, 예를 들어, 높은 데이터 전송률 달성을 위해, 고주파 대역(예: mmWave 대역)을 지원할 수 있다. 무선 통신 모듈(192)은 고주파 대역에서의 성능 확보를 위한 다양한 기술들, 예를 들어, 빔포밍(beamforming), 거대 배열 다중 입출력(massive MIMO(multiple-input and multiple-output)), 전차원 다중입출력(FD-MIMO: full dimensional MIMO), 어레이 안테나(array antenna), 아날로그 빔형성(analog beam-forming), 또는 대규모 안테나(large scale antenna)와 같은 기술들을 지원할 수 있다. 무선 통신 모듈(192)은 전자 장치(101), 외부 전자 장치(예: 전자 장치(104)) 또는 네트워크 시스템(예: 제 2 네트워크(199))에 규정되는 다양한 요구사항을 지원할 수 있다. 일실시예에 따르면, 무선 통신 모듈(192)은 eMBB 실현을 위한 Peak data rate(예: 20Gbps 이상), mMTC 실현을 위한 손실 Coverage(예: 164dB 이하), 또는 URLLC 실현을 위한 U-plane latency(예: 다운링크(DL) 및 업링크(UL) 각각 0.5ms 이하, 또는 라운드 트립 1ms 이하)를 지원할 수 있다.The wireless communication module 192 may support a 5G network after a 4G network and a next-generation communication technology, for example, a new radio access technology (NR). NR access technology includes high-speed transmission of high-capacity data (eMBB (enhanced mobile broadband)), minimization of terminal power and access to multiple terminals (mMTC (massive machine type communications)), or high reliability and low latency (URLLC (ultra-reliable and low-latency) -latency communications)). The wireless communication module 192 may support a high frequency band (eg, mmWave band) to achieve a high data rate, for example. The wireless communication module 192 includes various technologies for securing performance in a high-frequency band, for example, beamforming, massive multiple-input and multiple-output (MIMO), all-dimensional multiplexing. It may support technologies such as full dimensional MIMO (FD-MIMO), an array antenna, analog beam-forming, or a large scale antenna. The wireless communication module 192 may support various requirements specified in the electronic device 101 , an external electronic device (eg, the electronic device 104 ), or a network system (eg, the second network 199 ). According to an embodiment, the wireless communication module 192 may include a peak data rate (eg, 20 Gbps or more) for realizing eMBB, loss coverage (eg, 164 dB or less) for realizing mMTC, or U-plane latency for realizing URLLC ( Example: downlink (DL) and uplink (UL) each 0.5 ms or less, or round trip 1 ms or less).

안테나 모듈(197)은 신호 또는 전력을 외부(예: 외부의 전자 장치)로 송신하거나 외부로부터 수신할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 서브스트레이트(예: PCB) 위에 형성된 도전체 또는 도전성 패턴으로 이루어진 방사체를 포함하는 안테나를 포함할 수 있다. 일실시예에 따르면, 안테나 모듈(197)은 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다. 이런 경우, 제 1 네트워크(198) 또는 제 2 네트워크(199)와 같은 통신 네트워크에서 사용되는 통신 방식에 적합한 적어도 하나의 안테나가, 예를 들면, 통신 모듈(190)에 의하여 상기 복수의 안테나들로부터 선택될 수 있다. 신호 또는 전력은 상기 선택된 적어도 하나의 안테나를 통하여 통신 모듈(190)과 외부의 전자 장치 간에 송신되거나 수신될 수 있다. 어떤 실시예에 따르면, 방사체 이외에 다른 부품(예: RFIC(radio frequency integrated circuit))이 추가로 안테나 모듈(197)의 일부로 형성될 수 있다. The antenna module 197 may transmit or receive a signal or power to the outside (eg, an external electronic device). According to an embodiment, the antenna module 197 may include an antenna including a conductor formed on a substrate (eg, a PCB) or a radiator formed of a conductive pattern. According to an embodiment, the antenna module 197 may include a plurality of antennas (eg, an array antenna). In this case, at least one antenna suitable for a communication method used in a communication network such as the first network 198 or the second network 199 is connected from the plurality of antennas by, for example, the communication module 190 . can be selected. A signal or power may be transmitted or received between the communication module 190 and an external electronic device through the selected at least one antenna. According to some embodiments, other components (eg, a radio frequency integrated circuit (RFIC)) other than the radiator may be additionally formed as a part of the antenna module 197 .

다양한 실시예에 따르면, 안테나 모듈(197)은 mmWave 안테나 모듈을 형성할 수 있다. 일실시예에 따르면, mmWave 안테나 모듈은 인쇄 회로 기판, 상기 인쇄 회로 기판의 제 1 면(예: 아래 면)에 또는 그에 인접하여 배치되고 지정된 고주파 대역(예: mmWave 대역)을 지원할 수 있는 RFIC, 및 상기 인쇄 회로 기판의 제 2 면(예: 윗 면 또는 측 면)에 또는 그에 인접하여 배치되고 상기 지정된 고주파 대역의 신호를 송신 또는 수신할 수 있는 복수의 안테나들(예: 어레이 안테나)을 포함할 수 있다.According to various embodiments, the antenna module 197 may form a mmWave antenna module. According to one embodiment, the mmWave antenna module comprises a printed circuit board, an RFIC disposed on or adjacent to a first side (eg, bottom side) of the printed circuit board and capable of supporting a designated high frequency band (eg, mmWave band); and a plurality of antennas (eg, an array antenna) disposed on or adjacent to a second side (eg, top or side) of the printed circuit board and capable of transmitting or receiving signals of the designated high frequency band. can do.

상기 구성요소들 중 적어도 일부는 주변 기기들간 통신 방식(예: 버스, GPIO(general purpose input and output), SPI(serial peripheral interface), 또는 MIPI(mobile industry processor interface))을 통해 서로 연결되고 신호(예: 명령 또는 데이터)를 상호간에 교환할 수 있다.At least some of the components are connected to each other through a communication method between peripheral devices (eg, a bus, general purpose input and output (GPIO), serial peripheral interface (SPI), or mobile industry processor interface (MIPI)) and a signal ( eg commands or data) can be exchanged with each other.

일실시예에 따르면, 명령 또는 데이터는 제 2 네트워크(199)에 연결된 서버(108)를 통해서 전자 장치(101)와 외부의 전자 장치(104)간에 송신 또는 수신될 수 있다. 외부의 전자 장치(102, 또는 104) 각각은 전자 장치(101)와 동일한 또는 다른 종류의 장치일 수 있다. 일실시예에 따르면, 전자 장치(101)에서 실행되는 동작들의 전부 또는 일부는 외부의 전자 장치들(102, 104, 또는 108) 중 하나 이상의 외부의 전자 장치들에서 실행될 수 있다. 예를 들면, 전자 장치(101)가 어떤 기능이나 서비스를 자동으로, 또는 사용자 또는 다른 장치로부터의 요청에 반응하여 수행해야 할 경우에, 전자 장치(101)는 기능 또는 서비스를 자체적으로 실행시키는 대신에 또는 추가적으로, 하나 이상의 외부의 전자 장치들에게 그 기능 또는 그 서비스의 적어도 일부를 수행하라고 요청할 수 있다. 상기 요청을 수신한 하나 이상의 외부의 전자 장치들은 요청된 기능 또는 서비스의 적어도 일부, 또는 상기 요청과 관련된 추가 기능 또는 서비스를 실행하고, 그 실행의 결과를 전자 장치(101)로 전달할 수 있다. 전자 장치(101)는 상기 결과를, 그대로 또는 추가적으로 처리하여, 상기 요청에 대한 응답의 적어도 일부로서 제공할 수 있다. 이를 위하여, 예를 들면, 클라우드 컴퓨팅, 분산 컴퓨팅, 모바일 에지 컴퓨팅(MEC: mobile edge computing), 또는 클라이언트-서버 컴퓨팅 기술이 이용될 수 있다. 전자 장치(101)는, 예를 들어, 분산 컴퓨팅 또는 모바일 에지 컴퓨팅을 이용하여 초저지연 서비스를 제공할 수 있다. 다른 실시예에 있어서, 외부의 전자 장치(104)는 IoT(internet of things) 기기를 포함할 수 있다. 서버(108)는 기계 학습 및/또는 신경망을 이용한 지능형 서버일 수 있다. 일실시예에 따르면, 외부의 전자 장치(104) 또는 서버(108)는 제 2 네트워크(199) 내에 포함될 수 있다. 전자 장치(101)는 5G 통신 기술 및 IoT 관련 기술을 기반으로 지능형 서비스(예: 스마트 홈, 스마트 시티, 스마트 카, 또는 헬스 케어)에 적용될 수 있다. According to an embodiment, the command or data may be transmitted or received between the electronic device 101 and the external electronic device 104 through the server 108 connected to the second network 199 . Each of the external electronic devices 102 or 104 may be the same as or different from the electronic device 101 . According to an embodiment, all or a part of operations executed in the electronic device 101 may be executed in one or more external electronic devices 102 , 104 , or 108 . For example, when the electronic device 101 is to perform a function or service automatically or in response to a request from a user or other device, the electronic device 101 may perform the function or service itself instead of executing the function or service itself. Alternatively or additionally, one or more external electronic devices may be requested to perform at least a part of the function or the service. One or more external electronic devices that have received the request may execute at least a part of the requested function or service, or an additional function or service related to the request, and transmit a result of the execution to the electronic device 101 . The electronic device 101 may process the result as it is or additionally and provide it as at least a part of a response to the request. For this, for example, cloud computing, distributed computing, mobile edge computing (MEC), or client-server computing technology may be used. The electronic device 101 may provide an ultra-low latency service using, for example, distributed computing or mobile edge computing. In another embodiment, the external electronic device 104 may include an Internet of things (IoT) device. Server 108 may be an intelligent server using machine learning and/or neural networks. According to an embodiment, the external electronic device 104 or the server 108 may be included in the second network 199 . The electronic device 101 may be applied to an intelligent service (eg, smart home, smart city, smart car, or health care) based on 5G communication technology and IoT-related technology.

본 문서에 개시된 다양한 실시예들에 따른 전자 장치는 다양한 형태의 장치가 될 수 있다. 전자 장치는, 예를 들면, 휴대용 통신 장치(예: 스마트폰), 컴퓨터 장치, 휴대용 멀티미디어 장치, 휴대용 의료 기기, 카메라, 웨어러블 장치, 또는 가전 장치를 포함할 수 있다. 본 문서의 실시예에 따른 전자 장치는 전술한 기기들에 한정되지 않는다.The electronic device according to various embodiments disclosed in this document may have various types of devices. The electronic device may include, for example, a portable communication device (eg, a smart phone), a computer device, a portable multimedia device, a portable medical device, a camera, a wearable device, or a home appliance device. The electronic device according to the embodiment of the present document is not limited to the above-described devices.

본 문서의 다양한 실시예들 및 이에 사용된 용어들은 본 문서에 기재된 기술적 특징들을 특정한 실시예들로 한정하려는 것이 아니며, 해당 실시예의 다양한 변경, 균등물, 또는 대체물을 포함하는 것으로 이해되어야 한다. 도면의 설명과 관련하여, 유사한 또는 관련된 구성요소에 대해서는 유사한 참조 부호가 사용될 수 있다. 아이템에 대응하는 명사의 단수 형은 관련된 문맥상 명백하게 다르게 지시하지 않는 한, 상기 아이템 한 개 또는 복수 개를 포함할 수 있다. 본 문서에서, "A 또는 B", "A 및 B 중 적어도 하나", "A 또는 B 중 적어도 하나", "A, B 또는 C", "A, B 및 C 중 적어도 하나", 및 "A, B, 또는 C 중 적어도 하나"와 같은 문구들 각각은 그 문구들 중 해당하는 문구에 함께 나열된 항목들 중 어느 하나, 또는 그들의 모든 가능한 조합을 포함할 수 있다. "제 1", "제 2", 또는 "첫째" 또는 "둘째"와 같은 용어들은 단순히 해당 구성요소를 다른 해당 구성요소와 구분하기 위해 사용될 수 있으며, 해당 구성요소들을 다른 측면(예: 중요성 또는 순서)에서 한정하지 않는다. 어떤(예: 제 1) 구성요소가 다른(예: 제 2) 구성요소에, "기능적으로" 또는 "통신적으로"라는 용어와 함께 또는 이런 용어 없이, "커플드" 또는 "커넥티드"라고 언급된 경우, 그것은 상기 어떤 구성요소가 상기 다른 구성요소에 직접적으로(예: 유선으로), 무선으로, 또는 제 3 구성요소를 통하여 연결될 수 있다는 것을 의미한다.The various embodiments of this document and terms used therein are not intended to limit the technical features described in this document to specific embodiments, but it should be understood to include various modifications, equivalents, or substitutions of the embodiments. In connection with the description of the drawings, like reference numerals may be used for similar or related components. The singular form of the noun corresponding to the item may include one or more of the item, unless the relevant context clearly dictates otherwise. As used herein, "A or B", "at least one of A and B", "at least one of A or B", "A, B or C", "at least one of A, B and C", and "A , B, or C" each may include any one of the items listed together in the corresponding one of the phrases, or all possible combinations thereof. Terms such as "first", "second", or "first" or "second" may be used simply to distinguish the element from other elements in question, and may refer to elements in other aspects (e.g., importance or order) is not limited. It is said that one (eg, first) component is "coupled" or "connected" to another (eg, second) component, with or without the terms "functionally" or "communicatively". When referenced, it means that one component can be connected to the other component directly (eg by wire), wirelessly, or through a third component.

본 문서의 다양한 실시예들에서 사용된 용어 "모듈"은 하드웨어, 소프트웨어 또는 펌웨어로 구현된 유닛을 포함할 수 있으며, 예를 들면, 로직, 논리 블록, 부품, 또는 회로와 같은 용어와 상호 호환적으로 사용될 수 있다. 모듈은, 일체로 구성된 부품 또는 하나 또는 그 이상의 기능을 수행하는, 상기 부품의 최소 단위 또는 그 일부가 될 수 있다. 예를 들면, 일실시예에 따르면, 모듈은 ASIC(application-specific integrated circuit)의 형태로 구현될 수 있다. The term “module” used in various embodiments of this document may include a unit implemented in hardware, software, or firmware, and is interchangeable with terms such as, for example, logic, logic block, component, or circuit. can be used as A module may be an integrally formed part or a minimum unit or a part of the part that performs one or more functions. For example, according to an embodiment, the module may be implemented in the form of an application-specific integrated circuit (ASIC).

본 문서의 다양한 실시예들은 기기(machine)(예: 전자 장치(101)) 의해 읽을 수 있는 저장 매체(storage medium)(예: 내장 메모리(136) 또는 외장 메모리(138))에 저장된 하나 이상의 명령어들을 포함하는 소프트웨어(예: 프로그램(140))로서 구현될 수 있다. 예를 들면, 기기(예: 전자 장치(101))의 프로세서(예: 프로세서(120))는, 저장 매체로부터 저장된 하나 이상의 명령어들 중 적어도 하나의 명령을 호출하고, 그것을 실행할 수 있다. 이것은 기기가 상기 호출된 적어도 하나의 명령어에 따라 적어도 하나의 기능을 수행하도록 운영되는 것을 가능하게 한다. 상기 하나 이상의 명령어들은 컴파일러에 의해 생성된 코드 또는 인터프리터에 의해 실행될 수 있는 코드를 포함할 수 있다. 기기로 읽을 수 있는 저장 매체는, 비일시적(non-transitory) 저장 매체의 형태로 제공될 수 있다. 여기서, ‘비일시적’은 저장 매체가 실재(tangible)하는 장치이고, 신호(signal)(예: 전자기파)를 포함하지 않는다는 것을 의미할 뿐이며, 이 용어는 데이터가 저장 매체에 반영구적으로 저장되는 경우와 임시적으로 저장되는 경우를 구분하지 않는다.According to various embodiments of the present document, one or more instructions stored in a storage medium (eg, internal memory 136 or external memory 138) readable by a machine (eg, electronic device 101) may be implemented as software (eg, the program 140) including For example, a processor (eg, processor 120 ) of a device (eg, electronic device 101 ) may call at least one command among one or more commands stored from a storage medium and execute it. This makes it possible for the device to be operated to perform at least one function according to the called at least one command. The one or more instructions may include code generated by a compiler or code executable by an interpreter. The device-readable storage medium may be provided in the form of a non-transitory storage medium. Here, 'non-transitory' only means that the storage medium is a tangible device and does not include a signal (eg, electromagnetic wave), and this term is used in cases where data is semi-permanently stored in the storage medium and It does not distinguish between temporary storage cases.

일실시예에 따르면, 본 문서에 개시된 다양한 실시예들에 따른 방법은 컴퓨터 프로그램 제품(computer program product)에 포함되어 제공될 수 있다. 컴퓨터 프로그램 제품은 상품으로서 판매자 및 구매자 간에 거래될 수 있다. 컴퓨터 프로그램 제품은 기기로 읽을 수 있는 저장 매체(예: compact disc read only memory(CD-ROM))의 형태로 배포되거나, 또는 어플리케이션 스토어(예: 플레이 스토어TM)를 통해 또는 두 개의 사용자 장치들(예: 스마트 폰들) 간에 직접, 온라인으로 배포(예: 다운로드 또는 업로드)될 수 있다. 온라인 배포의 경우에, 컴퓨터 프로그램 제품의 적어도 일부는 제조사의 서버, 어플리케이션 스토어의 서버, 또는 중계 서버의 메모리와 같은 기기로 읽을 수 있는 저장 매체에 적어도 일시 저장되거나, 임시적으로 생성될 수 있다.According to one embodiment, the method according to various embodiments disclosed in this document may be provided as included in a computer program product. Computer program products may be traded between sellers and buyers as commodities. The computer program product is distributed in the form of a machine-readable storage medium (eg compact disc read only memory (CD-ROM)), or via an application store (eg Play Store TM ) or on two user devices ( It can be distributed (eg downloaded or uploaded) directly between smartphones (eg: smartphones) and online. In the case of online distribution, at least a part of the computer program product may be temporarily stored or temporarily generated in a machine-readable storage medium such as a memory of a server of a manufacturer, a server of an application store, or a relay server.

다양한 실시예들에 따르면, 상기 기술한 구성요소들의 각각의 구성요소(예: 모듈 또는 프로그램)는 단수 또는 복수의 개체를 포함할 수 있으며, 복수의 개체 중 일부는 다른 구성요소에 분리 배치될 수도 있다. 다양한 실시예들에 따르면, 전술한 해당 구성요소들 중 하나 이상의 구성요소들 또는 동작들이 생략되거나, 또는 하나 이상의 다른 구성요소들 또는 동작들이 추가될 수 있다. 대체적으로 또는 추가적으로, 복수의 구성요소들(예: 모듈 또는 프로그램)은 하나의 구성요소로 통합될 수 있다. 이런 경우, 통합된 구성요소는 상기 복수의 구성요소들 각각의 구성요소의 하나 이상의 기능들을 상기 통합 이전에 상기 복수의 구성요소들 중 해당 구성요소에 의해 수행되는 것과 동일 또는 유사하게 수행할 수 있다. 다양한 실시예들에 따르면, 모듈, 프로그램 또는 다른 구성요소에 의해 수행되는 동작들은 순차적으로, 병렬적으로, 반복적으로, 또는 휴리스틱하게 실행되거나, 상기 동작들 중 하나 이상이 다른 순서로 실행되거나, 생략되거나, 또는 하나 이상의 다른 동작들이 추가될 수 있다.According to various embodiments, each component (eg, module or program) of the above-described components may include a singular or a plurality of entities, and some of the plurality of entities may be separately disposed in other components. there is. According to various embodiments, one or more components or operations among the above-described corresponding components may be omitted, or one or more other components or operations may be added. Alternatively or additionally, a plurality of components (eg, a module or a program) may be integrated into one component. In this case, the integrated component may perform one or more functions of each component of the plurality of components identically or similarly to those performed by the corresponding component among the plurality of components prior to the integration. . According to various embodiments, operations performed by a module, program, or other component are executed sequentially, in parallel, repeatedly, or heuristically, or one or more of the operations are executed in a different order, or omitted. or one or more other operations may be added.

도 2는 다양한 실시예에 따른 전자 장치의 블록도이다.2 is a block diagram of an electronic device according to various embodiments of the present disclosure;

도 2를 참조 하면, 전자 장치(200)는 디스플레이(230), 메모리(220) 및 프로세서(210)를 포함할 수 있으며, 일부 실시예에서 도시된 구성 중 일부가 생략 또는 치환 될 수도 있다. 전자 장치(200)는 도 1의 전자 장치(200)(101)의 구성 및/또는 기능 중 적어도 일부를 더 포함할 수 있다. 도시된(또는 도시되지 않은) 전자 장치(200)의 각 구성 중 적어도 일부는 상호 작동적으로(operatively), 기능적으로(functionally) 및/또는 전기적으로 (electrically) 연결될 수 있다.Referring to FIG. 2 , the electronic device 200 may include a display 230 , a memory 220 , and a processor 210 , and some of the illustrated components may be omitted or replaced in some embodiments. The electronic device 200 may further include at least some of the configurations and/or functions of the electronic devices 200 and 101 of FIG. 1 . At least some of the respective components of the illustrated (or not illustrated) electronic device 200 may be operatively, functionally, and/or electrically connected.

다양한 실시예에 따르면, 디스플레이(230)는 액정 디스플레이(liquid crystal display(LCD)), 발광 다이오드(light-emitting diode(LED)) 디스플레이, 유기 발광 다이오드(organic light-emitting diode(OLED)) 디스플레이 중 어느 하나로 구현될 수 있으며, 이에 한정되지는 않는다. 디스플레이(230)는 사용자의 신체 일부(예: 손가락) 또는 입력 장치(예: 스타일러스 펜)를 이용한 터치 및/또는 근접 터치(또는 호버링) 입력을 감지하는 터치 스크린으로 구성될 수 있다. 디스플레이(230)는 적어도 일부가 플렉서블(flexible) 할 수 있으며, 폴더블(foldable) 디스플레이, 롤러블(rollable) 디스플레이로 구현될 수도 있다. 디스플레이(230)는 도 1의 디스플레이 모듈(160)의 구성 및/또는 기능 중 적어도 일부를 포함할 수 있다.According to various embodiments, the display 230 may be one of a liquid crystal display (LCD), a light-emitting diode (LED) display, and an organic light-emitting diode (OLED) display. Any one may be implemented, but is not limited thereto. The display 230 may be configured as a touch screen that senses a touch and/or proximity touch (or hovering) input using a user's body part (eg, a finger) or an input device (eg, a stylus pen). At least a part of the display 230 may be flexible, and may be implemented as a foldable display or a rollable display. The display 230 may include at least some of the configuration and/or functions of the display module 160 of FIG. 1 .

다양한 실시예에 따르면, 메모리(220)는 휘발성 메모리 및 비휘발성 메모리를 포함하여, 다양한 데이터들을 일시적 또는 영구적으로 저장할 수 있다. 메모리(220)는 도 1의 메모리(130)의 구성 및/또는 기능 중 적어도 일부를 포함하고, 도 1의 프로그램(140)을 저장할 수 있다. According to various embodiments, the memory 220 may temporarily or permanently store various data, including volatile memory and non-volatile memory. The memory 220 may include at least some of the configuration and/or functions of the memory 130 of FIG. 1 , and may store the program 140 of FIG. 1 .

다양한 실시예에 따르면, 메모리(220)는 프로세서(210)에서 수행될 수 있는 다양한 인스트럭션(instruction)들을 저장할 수 있다. 이와 같은 인스트럭션들은 프로세서(210)에 의해 인식될 수 있는 산술 및 논리 연산, 데이터 이동, 입출력 등의 제어 명령을 포함할 수 있다. According to various embodiments, the memory 220 may store various instructions that may be executed by the processor 210 . Such instructions may include control commands such as arithmetic and logical operations, data movement, and input/output that can be recognized by the processor 210 .

다양한 실시예에 따르면, 프로세서(210)는 전자 장치(200)의 각 구성 요소들의 제어 및/또는 통신에 관한 연산이나 데이터 처리를 수행할 수 있는 구성으로써, 하나 이상의 프로세서(210)들로 구성될 수 있다. 프로세서(210)는 도 1의 프로세서(120)의 구성 및/또는 기능 중 적어도 일부를 포함할 수 있다. According to various embodiments, the processor 210 is a configuration capable of performing an operation or data processing related to control and/or communication of each component of the electronic device 200 , and may be composed of one or more processors 210 . can The processor 210 may include at least some of the configuration and/or functions of the processor 120 of FIG. 1 .

다양한 실시예에 따르면, 프로세서(210)가 전자 장치(200) 상에서 구현할 수 있는 연산 및 데이터 처리 기능에는 한정됨이 없을 것이나, 이하에서는 전자 장치(200)가 타겟 프레임 레이트(frame rate)(또는 타겟 fps(frame per second)에 따라 어플리케이션의 실행 화면을 구성하는 각 프레임이 균일한 주기로 표시되도록 하는 프레임 페이싱(frame pacing) 동작과 관련된 다양한 실시예들에 대해 설명하기로 한다. 이하에서는, 전자 장치(200)가 게임 어플리케이션의 동작 중 그래픽 처리에 관련된 내용을 설명하기로 하나, 게임 어플리케이션 외에 다양한 어플리케이션에도 다양한 실시예들이 적용될 수 있다.According to various embodiments, there will be no limitations on the arithmetic and data processing functions that the processor 210 can implement on the electronic device 200 , but hereinafter, the electronic device 200 determines a target frame rate (or target fps). Various embodiments related to a frame pacing operation in which each frame constituting an execution screen of an application is displayed at a uniform cycle according to (frame per second) will be described below. ) will describe the content related to graphic processing during operation of the game application, but various embodiments may be applied to various applications other than the game application.

다양한 실시예에 따르면, 프로세서(210)는 CPU 및 GPU를 포함할 수 있다. 다양한 실시예에 있어서, CPU(central processing unit)는 어플리케이션의 실행 시 어플리케이션에서 정의된 다양한 연산 처리 동작을 수행하고, 디스플레이(230) 상의 사용자 입력에 대응하는 처리를 수행할 수 있다. GPU(graphic processing unit)는 디스플레이(230) 상에 처리되는 이미지 데이터의 렌더링 동작을 수행할 수 있다. 프로세서(210)는 CPU 및 GPU를 포함하는 하나의 SoC(system on chip)으로 설계될 수 있으며, 후술하는 프로세서(210)의 동작 중 적어도 일부는 CPU 또는 GPU에서 각각 수행되거나, CPU 및 GPU에서 분할되어 수행될 수 있다.According to various embodiments, the processor 210 may include a CPU and a GPU. In various embodiments, the central processing unit (CPU) may perform various arithmetic processing operations defined in the application when the application is executed, and may perform processing corresponding to a user input on the display 230 . A graphic processing unit (GPU) may perform a rendering operation of image data processed on the display 230 . The processor 210 may be designed as a single system on chip (SoC) including a CPU and a GPU, and at least some of the operations of the processor 210 to be described below are respectively performed by the CPU or the GPU, or divided between the CPU and the GPU. and can be performed.

다양한 실시예에 따르면, 어플리케이션의 실행에 대응한 메인 스레드(main thread) 및 렌더 스레드(render thread)를 생성할 수 있다. 메인 스레드 및 렌더 스레드는 게임 엔진(game engine) 또는 프레임워크(framework) 상에서 수행될 수 있다. 메인 스레드는 게임 어플리케이션의 동작과 관련된 다양한 연산 처리 동작을 포함하며, 렌더 스레드는 메인 스레드에서 처리된 데이터를 기반으로 이미지 데이터를 렌더링 하는 동작을 포함할 수 있다. 이하에서 메인 스레드는 게임 스레드(game thread)로 지칭될 수도 있다.According to various embodiments, a main thread and a render thread corresponding to the execution of an application may be generated. The main thread and the render thread may be executed on a game engine or a framework. The main thread may include various operation processing operations related to the operation of the game application, and the render thread may include an operation of rendering image data based on data processed in the main thread. Hereinafter, the main thread may be referred to as a game thread.

다양한 실시예에 따르면, 프로세서(210)는 어플리케이션에서 생성되는 이미지 데이터를 프레임 단위로 생성할 수 있다. 일 실시예에 따르면, 프로세서(210)는 프레임을 획득(acquire)하고, 드로잉(drawing) 한 후, present 명령을 전달 할 수 있다. 예를 들어, 프로세서(210)는 다중 버퍼링(multiple buffering) 방식을 통해 프론트 버퍼(front buffer)와 백 버퍼(back buffer)를 구성하고, 백 버퍼에 이미지를 그린 후 프론트 버퍼와 백 버퍼를 스왑(swap) 하고, 스왑 된 프론트 버퍼에 그려진 이미지를 디스플레이(230) 상에 출력하고, 다시 백 버퍼에 새로운 이미지 프레임을 그리는 과정을 반복할 수 있다. 여기서, present 명령은 백 버퍼와 프론트 버퍼의 포인터를 교환하는 과정이며, present 명령에 따라 GPU는 스왑 된 프론트 버퍼에 저장된 이미지 프레임을 렌더링 할 수 있다.According to various embodiments, the processor 210 may generate image data generated by an application in units of frames. According to an embodiment, the processor 210 may acquire a frame, draw it, and then transmit a present command. For example, the processor 210 configures a front buffer and a back buffer through a multiple buffering method, draws an image in the back buffer, and then swaps the front buffer and the back buffer ( swap), outputting the image drawn in the swapped front buffer on the display 230, and repeating the process of drawing a new image frame in the back buffer again. Here, the present command is a process of exchanging the pointers of the back buffer and the front buffer, and according to the present command, the GPU can render the image frame stored in the swapped front buffer.

다양한 실시예에 따르면, GPU는 present 명령에 따라 전달 받은 프레임 데이터를 렌더링 하여, 서피스 플린저(surface flinger)에 전달하고, 서피스 플린저는 스왑 된 프론트 버퍼에 있는 데이터를 합성(composition) 하여 디스플레이(230)를 통해 출력할 수 있다.According to various embodiments, the GPU renders the received frame data according to the present command and transmits it to the surface flinger, which composes the data in the swapped front buffer and displays it (230). ) can be printed.

다양한 실시예에 따르면, 디스플레이(230)는 소정의 리프레시 레이트에 따라서 프레임을 리프레시 할 수 있다. 예를 들어, 디스플레이(230)가 60fps로 동작하는 경우, 약 16.6ms의 주기마다 수직 동기 신호(V-sync)에 따라 리프레시 될 수 있으며, 리프레시 레이트는 가변될 수 있다.According to various embodiments, the display 230 may refresh the frame according to a predetermined refresh rate. For example, when the display 230 operates at 60 fps, it may be refreshed according to the vertical synchronization signal V-sync every about 16.6 ms, and the refresh rate may be variable.

다양한 실시예에 따르면, 프로세서(210)는 디스플레이(230) 상에 이미지의 출력 시 타겟 프레임 레이트를 설정할 수 있다. 예를 들어, 타겟 프레임 레이트(또는 타겟 fps)는 실행 중인 어플리케이션에 따라 결정될 수 있으며, 사용자가 설정한 동작 모드에 따라 변경될 수 있다. 타겟 프레임 레이트가 설정된 경우, 전자 장치(200)는 타겟 프레임 레이트에 따라 균등한 간격으로 이미지 데이터의 각 프레임이 디스플레이(230)에 표시되도록 할 필요가 있다. 이하에서는, 타겟 프레임 레이트에 맞게 프레임의 출력 주기를 균등하게 조정하기 위한 프레임 페이싱(frame pacing) 동작에 관련된 3가지 실시예에 대해 설명하기로 한다. 후술할 제1 내지 제3실시예는 서로 구분되는 실시예가 아니며, 전자 장치(200)는 상황에 따라 제1 내지 제3실시예를 모두 사용할 수도 이 중 일부만 사용할 수도 있다.According to various embodiments, the processor 210 may set a target frame rate when an image is output on the display 230 . For example, the target frame rate (or target fps) may be determined according to a running application, and may be changed according to an operation mode set by a user. When the target frame rate is set, the electronic device 200 needs to display each frame of image data on the display 230 at equal intervals according to the target frame rate. Hereinafter, three embodiments related to a frame pacing operation for uniformly adjusting an output period of a frame to match a target frame rate will be described. First to third embodiments to be described later are not separate embodiments, and the electronic device 200 may use all of the first to third embodiments or only some of them depending on circumstances.

제1실시예에 따르면, 프로세서(210)(예: CPU)는 게임 엔진 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우, 상기 특정 프레임의 이전 프레임에 대한 렌더링 동작이 종료된 이후에 수신되는 present 정보에 대응하는 present 명령을 GPU로 전달할 수 있다. 일 실시예에 따르면, 프로세서(210)는 GPU의 렌더링 동작이 완료된 후 소정의 딜레이 시간 이후에 렌더링 된 프레임을 처리할 수 있다.According to the first embodiment, when the processor 210 (eg, CPU) receives present information for a specific frame from the game engine or the framework, it is received after the rendering operation for the previous frame of the specific frame is finished. A present command corresponding to the displayed present information may be transmitted to the GPU. According to an embodiment, the processor 210 may process the rendered frame after a predetermined delay time after the rendering operation of the GPU is completed.

일 실시예에 따르면, 프로세서(210)는 그래픽 API의 타이밍 확장 기능을 사용할 수 있다. 예를 들어, 그래픽 API는 Vulkan API일 수 있으며, 타이밍 확장 기능은 Vulkan API의 Google Display Timing Extension 함수일 수 있다. 타이밍 확장 기능은 이전 프레임들의 렌더링 결과에 대한 디스플레이(230)의 출력 타이밍 정보를 얻어서, 이후에 present 할 이미지가 언제 디스플레이(230)에 출력될 지 설정할 수 있는 기능일 수 있다. 프로세서(210)가 타이밍 확장 기능을 사용하는 경우, GPU에서 프레임의 렌더링이 완료되는 경우, 서피스 플린저는 소정의 딜레이 시간 이후에 렌더링 프레임을 합성하고, 이 후의 수직 동기 타이밍에 디스플레이(230)를 통해 해당 프레임이 출력될 수 있다. 하지만, 이와 같이 타이밍 확장 기능을 사용 하더라도, 과거 프레임들의 처리 시간에 따라 딜레이 시간이 결정되기 때문에 향후 렌더링 할 이미지의 정확한 출력 타이밍을 스케줄링 하기 어려울 수 있다. 이에 따라, 일부 프레임의 경우 다른 프레임보다 짧은 주기 또는 긴 주기 동안 출력될 수 있다.According to an embodiment, the processor 210 may use a timing extension function of the graphics API. For example, the graphics API may be a Vulkan API, and the timing extension function may be a Google Display Timing Extension function of the Vulkan API. The timing extension function may be a function of obtaining output timing information of the display 230 for rendering results of previous frames and setting when an image to be presented later is output to the display 230 . When the processor 210 uses the timing extension function, when the GPU finishes rendering the frame, the surface flinger synthesizes the rendered frame after a predetermined delay time, and then through the display 230 at the vertical synchronization timing. A corresponding frame may be output. However, even when the timing extension function is used in this way, it may be difficult to schedule an accurate output timing of an image to be rendered in the future because the delay time is determined according to the processing time of past frames. Accordingly, some frames may be output during a shorter or longer period than other frames.

제1실시예에서는 이와 같은 문제를 해결하기 위해, 프로세서(210)는 게임 엔진 또는 프레임워크에서 present 명령을 전달 받더라도, 바로 present를 수행하지 않고, 이전 프레임의 GPU 렌더링 동작이 끝날 때까지 대기한 후 present를 수행할 수 있다. In the first embodiment, in order to solve this problem, the processor 210 does not perform the present immediately even when a present command is received from the game engine or the framework, and waits until the GPU rendering operation of the previous frame is finished. present can be performed.

제1실시예는 도 4 내지 도 6을 통해 보다 상세히 설명하기로 한다.The first embodiment will be described in more detail with reference to FIGS. 4 to 6 .

제2실시예에 따르면, 프로세서(210)는 프레임의 present와 관련된 동작을 스왑 체인(swap chain) 스레드를 통해 수행할 수 있다. 스왑 체인 스레드는 present 명령에 따라 프론트 버퍼와 백 버퍼를 스왑 하는 동작을 수행하는 스레드일 수 있다. 스왑 체인 스레드는 메인 스레드와 독립적, 병렬적으로 수행될 수 있다.According to the second embodiment, the processor 210 may perform an operation related to the present of a frame through a swap chain thread. The swap chain thread may be a thread that swaps the front buffer and back buffer according to the present command. The swap chain thread can be executed independently and in parallel with the main thread.

게임 엔진 또는 프레임워크의 메인 스레드에서 present 명령을 수행하는 경우, 이전 프레임의 GPU 렌더링 완료 시까지 다음 프레임의 present를 대기할 수 있다. 이 경우, 타겟 fps에 맞지 않게 특정 프레임이 긴 주기 동안 표시될 수 있다.If the main thread of the game engine or framework executes the present command, it can wait for the present of the next frame until the GPU rendering of the previous frame is completed. In this case, a specific frame may be displayed for a long period that does not fit the target fps.

본 실시예에서는 스왑체인 스레드를 통해 present를 수행함에 따라, present 수행 시에 게임 엔진 또는 프레임워크의 메인 스레드와 GPU의 간섭 동기화를 최소화 하여, 타겟 fps에 따라 디스플레이(230)가 각 프레임을 출력하도록 할 수 있다.In this embodiment, as the present is performed through the swap chain thread, the synchronization of interference between the main thread of the game engine or framework and the GPU is minimized when present is performed, so that the display 230 outputs each frame according to the target fps. can do.

제2실시예는 도 7 내지 도 9를 통해 보다 상세히 설명하기로 한다.The second embodiment will be described in more detail with reference to FIGS. 7 to 9 .

제3실시예에 따르면, 프로세서(210)는 디스플레이(230)를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로 현재 프레임의 예상 처리 시간을 계산하고, 타겟 프레임 레이트 및 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)(또는 SPE(SyncFrameEnd))을 결정하고, 메인 스레드가 타임 마진 동안 슬립 상태로 대기한 후 사용자 입력 및 데이터의 처리를 수행하도록 할 수 있다. 프로세서(210)는 적어도 하나의 이전 프레임의 present 시간의 차이를 기반으로 예상 처리 시간을 계산할 수 있다.According to the third embodiment, the processor 210 calculates the expected processing time of the current frame based on the processing time of at least one previous frame output through the display 230 , and the target frame rate and the calculated expected processing time Based on , a time margin (or SyncFrameEnd (SPE)) may be determined, and the main thread may wait for the time margin in a sleep state and then process user input and data. The processor 210 may calculate an expected processing time based on a difference between present times of at least one previous frame.

예를 들어, 렌더 스레드에서 이미지 프레임이 처리되는 동안 메인 스레드에서 사용자 입력 처리 및 게임 로직의 실행이 완료될 수 있는데, 이 경우, 메인 스레드는 렌더 스레드가 해당 프레임의 처리를 완료할 때까지 대기할 수 있다. 이 경우, 렌더 스레드의 acquire 수행 시점에 GPU의 이전 프레임에 대한 작업이 완료되지 않을 수 있기 때문에, 이미지의 렌더링 절차가 지연될 수 있다.For example, user input processing and execution of game logic may be completed on the main thread while image frames are being processed on the render thread. In this case, the main thread may wait for the render thread to finish processing the frame. can In this case, since the work on the previous frame of the GPU may not be completed at the time of the acquire execution of the render thread, the rendering procedure of the image may be delayed.

본 실시예에서는 메인 스레드는 사용자 입력이 감지 되더라도 바로 사용자 입력의 처리를 수행하지 않고, SFE 기간 동안 대기할 수 있다. 메인 스레드는 이 후 SFE가 도과한 후 사용자 입력의 처리 및 게임 로직을 수행할 수 있으며, 이에 따라 렌더 스레드가 이전 프레임을 처리할 시간이 추가로 확보되고, ACQUIRE의 수행 시간이 짧아질 수 있다.In the present embodiment, even if a user input is detected, the main thread may wait for the SFE period without immediately processing the user input. The main thread may then process user input and perform game logic after the SFE has elapsed, thereby securing additional time for the render thread to process the previous frame, and shortening the execution time of ACQUIRE.

제3실시예는 도 10 내지 도 11을 통해 보다 상세히 설명하기로 한다.The third embodiment will be described in more detail with reference to FIGS. 10 to 11 .

도 3은 다양한 실시예에 따른 이미지 렌더링에 사용되는 구성의 블록도이다.3 is a block diagram of a configuration used for image rendering according to various embodiments of the present disclosure;

다양한 실시예에 따르면, 게임 엔진(310)(또는 프레임워크)는 그래픽 API(320)(예: Vulkan API)를 이용하여, 타겟 프레임 레이트에 맞게 이미지 프레임을 드로잉하는 동작을 수행할 수 있다.According to various embodiments, the game engine 310 (or the framework) may use the graphics API 320 (eg, Vulkan API) to draw an image frame according to a target frame rate.

다양한 실시예에 따르면, 프레임 페이서(340)(frame pacer)는 게임 엔진(310)과 그래픽 API(320) 사이에서 동작을 수행하며, 게임 어플리케이션의 프레임이 타겟 프레임 레이트에 맞게 출력될 수 있도록 다양한 동작을 수행할 수 있다.According to various embodiments, the frame pacer 340 performs an operation between the game engine 310 and the graphic API 320, and provides various action can be performed.

일 실시예(예: 도 4 내지 도 6)에 따르면, 프레임 페이서(340)는 게임 엔진(310) 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우, 상기 특정 프레임의 이전 프레임에 대한 렌더링 동작이 종료된 이후에 수신되는 present 정보에 대응하는 present 명령을 GPU(330)로 전달할 수 있다.According to an embodiment (eg, FIGS. 4 to 6 ), when the frame pacer 340 receives present information about a specific frame from the game engine 310 or the framework, After the rendering operation is finished, a present command corresponding to the present information received may be transmitted to the GPU 330 .

일 실시예(예: 도 7 내지 도 9)에 따르면, 프레임 페이서(340)는 프레임의 present와 관련된 동작을 스왑 체인(swap chain) 스레드를 통해 수행할 수 있다. 예를 들어, 게임 엔진(310)은 이미지를 그리는 함수(예: vkQueuepresentKHR) 호출을 직접하는 대신 프레임 페이서(340)에 present 명령을 전달 할 수 있다. 프레임 페이서(340)는 present를 바로 수행하지 않고, 스왑 체인 스레드(342)에 전달하고, 스왑 체인 스레드(342)는 이전 프레임의 GPU(330) 렌더링 완료 시점까지 기다렸다가 present (예: vkQueuepresentKHR)를 수행할 수 있다.According to an embodiment (eg, FIGS. 7 to 9 ), the frame pacer 340 may perform an operation related to the present of a frame through a swap chain thread. For example, the game engine 310 may transmit a present command to the frame pacer 340 instead of directly calling a function that draws an image (eg, vkQueuepresentKHR). The frame pacer 340 does not perform the present immediately, but passes it to the swap chain thread 342, and the swap chain thread 342 waits until the GPU 330 rendering of the previous frame is completed before sending the present (eg vkQueuepresentKHR). can be done

일 실시예(예: 도 10 내지 도 11)에 따르면, 프레임 페이서(340)는 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로 현재 프레임의 예상 처리 시간을 계산하고, 타겟 프레임 레이트 및 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)(또는 SPE(SyncFrameEnd))을 결정하고, 메인 스레드(또는 게임 스레드)(312)가 타임 마진 동안 슬립 상태로 대기한 후 사용자 입력 및 데이터의 처리를 수행하도록 할 수 있다. 예를 들어, 프레임 페이서(340)는 타겟 fps에 맞는 게임 엔진(310)의 프레임 시작 시점 및 종료 시점을 메인 스레드(312) 및/또는 렌더 스레드(314)에 알려주고, 이에 따라 원활한 애니메이션 및 프레임 타임을 제공하도록 할 수 있다.According to an embodiment (eg, FIGS. 10 to 11 ), the frame pacer 340 calculates an expected processing time of the current frame based on the processing time of at least one previous frame output through the display, and the target frame Based on the rate and the calculated expected processing time, a time margin (or SyncFrameEnd (SPE)) is determined, and a user input after the main thread (or game thread) 312 sleeps for the time margin and waits and data processing. For example, the frame pacer 340 informs the main thread 312 and/or the render thread 314 of the frame start and end times of the game engine 310 that match the target fps, thereby providing smooth animation and frames. You can provide time.

도 4는 그래픽 API의 타이밍 확장 기능을 사용하지 않은 실시예에서 각 프레임의 처리 과정을 도시한 것이다.4 is a diagram illustrating processing of each frame in an embodiment in which the timing extension function of the graphic API is not used.

도 4 내지 도 9에서 각 주기(tn - tn-1)는 디스플레이의 리프레시 인터벌(refresh interval)이고, 디스플레이가 60fps(frame per second)로 동작하는 경우, 리프레시 인터벌은 약 16.6ms일 수 있다. 디스플레이는 tn 타이밍에 수직 동기 신호(V-sync)에 따라 이미지 프레임을 출력할 수 있으며, 하나의 프레임이 n 주기 동안 표시될 수 있다. 이하에서는 타겟 fps가 30이 경우의 처리 과정에 대해 설명하기로 한다.4 to 9, each period (t n - t n-1 ) is a refresh interval of the display, and when the display operates at 60 fps (frame per second), the refresh interval may be about 16.6 ms . The display may output an image frame according to the vertical synchronization signal V-sync at t n timing, and one frame may be displayed for n periods. Hereinafter, a processing process in this case when the target fps is 30 will be described.

도 4를 참조 하면, CPU(410)는 정해진 클래스(예: choreographer)를 이용하여, 어플리케이션(또는 게임 엔진)으로부터 V-sync 주기에 맞추어 렌더링을 시작할 수 있다. 예를 들어, CPU(410) 동작 중 어플리케이션은 2번의 V-sync 주기(t1, t3, t5) 마다 각 프레임의 렌더링을 수행할 수 있다. Referring to FIG. 4 , the CPU 410 may start rendering according to the V-sync cycle from the application (or game engine) using a predetermined class (eg, choreographer). For example, while the CPU 410 is operating, the application may render each frame every two V-sync cycles t 1 , t 3 , and t 5 .

다양한 실시예에 따르면, GPU(420)는 CPU(410)에서 present 명령을 전달하는 경우, 해당 프레임의 렌더링을 시작하고, CPU(410)는 GPU(420)에서 해당 프레임의 렌더링 동작이 완료할 때까지 대기할 수 있다. According to various embodiments, when the GPU 420 transmits a present command from the CPU 410 , the GPU 420 starts rendering the corresponding frame, and the CPU 410 when the GPU 420 completes the rendering of the frame. can wait until

다양한 실시예에 따르면, 서피스 플린저(430)는 CPU(410)의 present 명령 시, 바로 다음 V-sync 신호에 맞추어 백 버퍼(back buffer)에 저장된 데이터를 컴포지션한 후 디스플레이(440)에 출력할 수 있다. 서피스 플린저(430)는 GPU(420)의 렌더링 동작이 완료될 때까지 대기한 후 렌더링 동작이 완료된 이후의 V-sync 타이밍에 디스플레이(440)로 프레임 데이터를 출력할 수 있다. 예를 들어, 서피스 플린저(430)는 GPU(420)의 1번 프레임의 렌더링 동작이 t4-t5 사이에 완료되므로, GPU(420) 렌더링이 수행되는 시간 동안 대기한 후 완료 시점부터 컴포지션 동작을 수행하고, t5에 디스플레이(440)로 프레임 데이터를 출력할 수 있다. 또한, 서피스 플린저(430)는 GPU(420)의 2번 프레임의 렌더링 동작이 완료된 후 컴포지션 동작을 수행하고, t6에 디스플레이(440)로 프레임 데이터를 출력할 수 있다.According to various embodiments, the surface flinger 430 composes the data stored in the back buffer in accordance with the immediately following V-sync signal when the present command of the CPU 410 is outputted to the display 440 . can The surface flinger 430 may wait until the rendering operation of the GPU 420 is completed, and then output frame data to the display 440 at the V-sync timing after the rendering operation is completed. For example, since the rendering operation of the first frame of the GPU 420 is completed between t 4 -t 5 in the surface flinger 430, the surface flinger 430 waits for a time for which the GPU 420 rendering is performed, and then composes the composition from the completion time. An operation may be performed, and frame data may be output to the display 440 at t 5 . Also, the surface flinger 430 may perform a composition operation after the GPU 420 completes the rendering operation of the second frame, and may output frame data to the display 440 at t 6 .

이와 같은 처리 과정에 따라, 1번 프레임은 한 주기 동안 표시되고, 2번 및 3번 프레임은 두 주기 동안 표시될 수 있다. 이에, 본 실시예에서는 의도한 30fps와 일부 오차가 생길 수 있다.According to this processing, frame 1 may be displayed for one period, and frames 2 and 3 may be displayed for two periods. Accordingly, in the present embodiment, a partial error may occur from the intended 30 fps.

도 5는 그래픽 API의 타이밍 확장 기능을 사용한 실시예에서 각 프레임의 처리 과정을 도시한 것이다.5 is a diagram illustrating a process of processing each frame in an embodiment using the timing extension function of the graphic API.

다양한 실시예에 따르면, 서피스 플린저(530)는 그래픽 API(예: Vulkan API)의 타이밍 확장 기능(예: Vulkan Google Display Timing Extension)을 적용하여, 렌더링 된 프레임의 표시 타이밍을 조절할 수 있다. 타이밍 확장 기능은 present 된 프레임이 실제 디스플레이(540)에 출력될 시간에 출력되도록 서피스 플린저(530)의 처리 타이밍을 딜레이 시키는 기능일 수 있다.According to various embodiments, the surface flinger 530 may adjust the display timing of the rendered frame by applying a timing extension function (eg, Vulkan Google Display Timing Extension) of a graphics API (eg, Vulkan API). The timing extension function may be a function of delaying the processing timing of the surface flanger 530 so that the presented frame is output at a time when it is actually output to the display 540 .

도 5를 참조 하면, CPU(510)의 1번 프레임에 대한 present 명령에 따라 GPU(520)는 렌더링을 수행하고, 서피스 플린저(530)는 GPU(520) 렌더링이 종료되더라도 바로 컴포지션 동작을 수행하지 않고, 다음 V-sync 인 t5 직전에 수행할 수 있다. Referring to FIG. 5 , the GPU 520 performs rendering according to the present command for frame 1 of the CPU 510 , and the surface flinger 530 performs a composition operation immediately even when the GPU 520 rendering is finished. Instead, it can be performed just before the next V -sync, t5.

이와 같이, 타이밍 확장 기능을 이용하여, 각 프레임의 출력 주기를 동일하게 조절할 수도 있으나, 도 5와 같은 케이스에서는 서피스 플린저(530)의 딜레이 타임 예측이 정확하지 않을 수 있다. 타이밍 확장 기능은 과거 프레임들의 타이밍 정보를 제공하지만, 현재 GPU(520)가 렌더링 중인 직전 프레임의 경우 아직 디스플레이(540)에 출력되지 않았기 때문에, 해당 프레임에 대한 정보가 없으므로 정확한 프레임 시작 시점을 예측하기가 어렵다. As described above, the output period of each frame may be equally adjusted using the timing extension function, but in the case of FIG. 5 , the delay time prediction of the surface flinger 530 may not be accurate. The timing extension function provides timing information of past frames, but since the frame immediately preceding the current GPU 520 is rendering has not yet been output to the display 540, since there is no information about the frame, it is difficult to predict the correct frame start time. is difficult

이에 따라, 타이밍 확장 기능을 이용하더라도 도 4와 마찬가지로 1번 프레임은 한 주기 동안 표시되고, 2번 및 3번 프레임은 두 주기 동안 표시될 수 있다. 따라서, 본 실시예에서도 의도한 30fps와 일부 오차가 생길 수 있다.Accordingly, even if the timing extension function is used, frame 1 may be displayed for one period and frames 2 and 3 may be displayed for two periods as in FIG. 4 . Therefore, even in this embodiment, there may be some error from the intended 30 fps.

도 6은 그래픽 API의 타이밍 확장 기능을 사용하고 present 타이밍을 조절한 실시예에서 각 프레임의 처리 과정을 도시한 것이다.6 is a diagram illustrating a process of processing each frame in an embodiment in which the timing extension function of the graphic API is used and the present timing is adjusted.

다양한 실시예에 따르면, 프레임 페이서는 게임 엔진 또는 프레임워크에서 present 명령을 전달 받더라도, 바로 present를 수행하지 않고, 이전 프레임의 GPU(620) 렌더링 동작이 끝날 때까지 대기한 후 present를 수행할 수 있다.According to various embodiments, even if the frame pacer receives a present command from a game engine or a framework, the present may be performed after waiting until the rendering operation of the GPU 620 of the previous frame is finished without performing the present immediately. .

도 6을 참조 하면, CPU(610)는 1번 프레임의 GPU(620) 렌더링 완료 시점까지 2번 프레임의 present를 수행하지 않고 대기할 수 있다. CPU(610)는 1번 프레임의 GPU(620) 렌더링이 완료되는 경우, 2번 프레임의 present를 수행하고, 이에 따라 2번 프레임의 GPU(620) 렌더링 시점이 딜레이 될 수 있다. 서피스 플린저(630)는 타이밍 확장 기능을 사용하여 각 프레임의 GPU(620) 렌더링 이후에 바로 컴포지션 동작을 수행하지 않고 소정의 딜레이 시간 이후에 컴포지션 동작을 수행할 수 있다.Referring to FIG. 6 , the CPU 610 may wait without presenting the second frame until the GPU 620 rendering of the first frame is completed. When the GPU 620 rendering of the first frame is completed, the CPU 610 performs the present of the second frame, and accordingly, the rendering time of the GPU 620 of the second frame may be delayed. The surface flinger 630 may perform the composition operation after a predetermined delay time without performing the composition operation immediately after rendering by the GPU 620 of each frame by using the timing extension function.

도 6을 참조 하면, 이와 같이 CPU(610)의 present 딜레이 및 타이밍 확장 기능에 의해 서피스 플린저(630)의 동작 타이밍이 딜레이 됨에 따라 1번 프레임은 t6 - t8 2 주기 동안 디스플레이(640) 상에 표시될 수 있다. 이후 2번 프레임 및 3번 프레임도 2주기 동안 표시되어, 타겟 fps인 30fps에 맞게 디스플레이(640) 상에 각 프레임이 표시될 수 있다.Referring to FIG. 6 , as the operation timing of the surface flinger 630 is delayed by the present delay and timing extension function of the CPU 610 as described above, frame 1 is displayed on the display 640 during the period t 6 - t 8 2 can be displayed on the Thereafter, the second frame and the third frame are also displayed for two periods, so that each frame may be displayed on the display 640 in accordance with the target fps of 30 fps.

본 실시예의 경우, 직전 프레임의 GPU(620) 완료 시점까지 present 동작을 대기하기 때문에, 언제든지 직전 프레임이 디스플레이(640)에 출력되는 타이밍에 대해 계산이 가능하다. 이와 같이, 직전 프레임에 대한 타이밍 정보까지 고려하여 CPU(610)에서 present를 수행하면 보다 정확하고 안정적인 fps 지원이 가능할 수 있다.In the present embodiment, since the present operation waits until the completion of the GPU 620 of the previous frame, it is possible to calculate the timing at which the previous frame is output to the display 640 at any time. In this way, when presenting is performed in the CPU 610 in consideration of timing information for the previous frame, more accurate and stable fps support may be possible.

일 실시예에 따르면, CPU(610)의 present 대기 동작은 그래픽 API의 vkFence를 이용해서 수행할 수 있다.According to an embodiment, the present standby operation of the CPU 610 may be performed using vkFence of the graphic API.

도 7은 present 동작을 CPU의 렌더 스레드에서 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.7 illustrates a processing process of each frame in an embodiment in which the present operation is processed by the render thread of the CPU.

일 실시예에 따르면, CPU(710)의 렌더 스레드에서 각 프레임의 present 동작을 수행할 수 있다. 도 7을 참조 하면, CPU(710)는 1번 프레임의 present 이후 1번 프레임의 GPU(720) 렌더링을 대기함에 따라, 2번 프레임의 present는 실행 시간이 지연될 수 있다. 본 케이스에서 3번 프레임의 CPU(710) 렌더링 처리가 늦게 완료되는 경우 전체적인 GPU(720) 렌더링 타이밍이 지연될 수 있으며, 이에 따라 1번 프레임은 2주기 동안 디스플레이(740)에 표시되는 반면, 2번 프레임은 3주기 동안 디스플레이(740)에 표시될 수 있다.According to an embodiment, the present operation of each frame may be performed in the render thread of the CPU 710 . Referring to FIG. 7 , since the CPU 710 waits for the GPU 720 to render the first frame after the first frame is presented, the execution time of the second frame may be delayed. In this case, if the CPU 710 rendering processing of the 3rd frame is completed late, the overall GPU 720 rendering timing may be delayed, and accordingly, the 1st frame is displayed on the display 740 for 2 cycles, while 2 Frame No. 1 may be displayed on the display 740 for three periods.

이에 따라, 의도한 30fps와 일부 오차가 생길 수 있다.Accordingly, some errors may occur from the intended 30 fps.

도 8은 present 동작을 스왑체인 스레드에서 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.FIG. 8 shows the processing process of each frame in an embodiment in which the present operation is processed by the swap chain thread.

다양한 실시예에 따르면, 전자 장치는 프레임의 present 동작을 CPU(810) 렌더 스레드에서 수행하지 않고, 이와 분리된 스왑체인 스레드에서 수행할 수 있다. 예를 들어, 스왑 체인 스레드(swap chain thread)(815)에서는 그래픽 API의 현재 프레임을 GPU(820) 및 서피스 플린저(830)에 전달할 함수(예: vkQueuepresentKHR)와 다음 프레임의 이미지를 가져올 함수(예: vkacquireNextImageKHR)를 실행할 수 있다. According to various embodiments, the electronic device may not perform the frame present operation in the CPU 810 render thread, but may perform the frame presenting operation in a swap chain thread separated therefrom. For example, in the swap chain thread 815, a function to pass the current frame of the graphics API to the GPU 820 and surface flinger 830 (e.g. vkQueuepresentKHR) and a function to get the image of the next frame ( Example: vkacquireNextImageKHR).

도 7의 실시예에서는 게임 엔진 또는 프레임워크의 스레드에서 present 명령을 수행함에 따라 이전 프레임의 GPU(820) 렌더링 완료 시까지 다음 프레임의 present를 대기할 수 있다. 이러한 present 대기는 타겟 fps에 맞지 않게 특정 프레임이 긴 주기 동안 표시될 수 있으며, 특히 CPU(810) 바운드 상황에서는 이미지의 표시 타이밍에 좋지 않은 영향을 미칠 수 있다. In the embodiment of FIG. 7 , as the present command is executed by the thread of the game engine or framework, the present of the next frame may be waited until the GPU 820 of the previous frame is rendered. Such a present wait may cause a specific frame to be displayed for a long period that does not match the target fps, and particularly, may adversely affect the display timing of the image in a CPU 810-bound situation.

다양한 실시예에 따르면, 전자 장치는 스왑체인 스레드를 통해 present를 수행함에 따라, present 수행 시에 게임 엔진 또는 프레임워크의 스레드와 GPU(820)의 간섭 동기화를 최소화 하여, 타겟 fps에 따라 디스플레이(840)가 각 프레임을 출력하도록 할 수 있다.According to various embodiments, as the electronic device performs the present through the swap chain thread, the synchronization of the interference between the thread of the game engine or framework and the GPU 820 is minimized when the present is performed, and the display 840 according to the target fps ) to output each frame.

도 8을 참조 하면, 1번 프레임의 CPU(810) 렌더링이 완료되면, 스왑체인 스레드에서 1번 프레임의 present를 수행할 수 있다. GPU(820)는 present 명령에 따라 1번 프레임의 GPU(820) 렌더링을 수행하고, 서피스 플린저(830)는 GPU(820) 렌더링이 완료되는 경우 composition 처리 하여 다음 V-sync 타이밍인 t4에 디스플레이(840) 상에 1번 프레임이 표시될 수 있다. Referring to FIG. 8 , when the rendering of the first frame by the CPU 810 is completed, the present of the first frame may be performed in the swap chain thread. The GPU 820 renders the GPU 820 of frame 1 according to the present command, and the surface flinger 830 performs composition processing when the GPU 820 rendering is completed, and is displayed at the next V-sync timing t 4 . Frame 1 may be displayed on the display 840 .

다양한 실시예에 따르면, 프레임워크의 렌더 스레드는 스왑체인 스레드에서 present 동작을 수행하는 동안 다음 프레임의 드로잉 동작을 수행할 수 있어, 다음 프레임의 처리 지연이 발생하지 않을 수 있다. 도 8을 참조 하면, 2번 프레임 및 3번 프레임에서 present 명령 후 CPU(810) 렌더링 시 지연 시간이 줄어들 수 있으며, 3번 프레임이 t8에 표시되게 되어, 1-3번 프레임 모두 2주기 동안 표시될 수 있다. 이와 같이, 스왑체인 스레드에서 present를 수행함에 따라 CPU(810) bound 상황에서도 보다 안정적인 fps를 제공할 수 있다.According to various embodiments, the render thread of the framework may perform the drawing operation of the next frame while performing the present operation in the swap chain thread, so that processing delay of the next frame may not occur. Referring to FIG. 8 , after the present command in frames 2 and 3, the delay time when the CPU 810 is rendered can be reduced, and frame 3 is displayed at t 8 , so that frames 1-3 are all for 2 cycles. can be displayed. In this way, as the present is performed in the swap chain thread, a more stable fps can be provided even in a CPU 810 bound situation.

도 9는 GPU vertex 처리와 fragment 처리를 병렬로 처리하는 실시예에서 각 프레임의 처리 과정을 도시한 것이다.9 shows a processing process of each frame in an embodiment in which GPU vertex processing and fragment processing are processed in parallel.

일 실시예에 따르면, 전자 장치는 GPU 파이프 라인 중 vertex(922) 처리와 fragment(924) 처리를 병행하여 실행할 수 있다. According to an embodiment, the electronic device may concurrently execute vertex 922 processing and fragment 924 processing in the GPU pipeline.

도 9를 참조 하면, CPU(910)가 각 프레임의 드로잉을 완료 하면, GPU vertex(922) 처리가 수행되고, 이어서 GPU fragment(924) 처리가 수행될 수 있다. 본 실시예에서는 GPU vertex(922) 와 GPU fragment(924)가 병렬로 처리되기 때문에, 1번 프레임의 GPU fragment(924)가 완료되기 이전에도 2번 프레임의 GPU vertex(922)가 수행될 수 있다.Referring to FIG. 9 , when the CPU 910 finishes drawing each frame, a GPU vertex 922 process may be performed, and then a GPU fragment 924 process may be performed. In this embodiment, since the GPU vertex 922 and the GPU fragment 924 are processed in parallel, the GPU vertex 922 of the second frame can be performed even before the GPU fragment 924 of the first frame is completed. .

다양한 실시예에 따르면, 전자 장치는 스왑체인 스레드를 통해 프레임의 present를 수행할 수 있다. 이에 따라, CPU(910)에서 드로잉 한 프레임의 present 시간이 긴 경우에도 각 프레임은 동일한 2주기 동안 디스플레이(940) 상에 표시될 수 있다.According to various embodiments, the electronic device may present the frame through the swap chain thread. Accordingly, even when the present time of a frame drawn by the CPU 910 is long, each frame may be displayed on the display 940 for the same two cycles.

도 10은 SPE를 사용하기 이전에 게임 엔진에서 수행되는 스레드의 일 예를 도시한 것이다.10 shows an example of a thread executed in the game engine prior to using the SPE.

다양한 실시예에 따르면, 게임 스레드(1010)(game thread)는 사용자 입력의 처리 및 사용자 입력에 기초한 게임 로직을 수행할 수 있다. 게임 스레드(1010)는 게임 로직의 수행에 따른 이미지 업데이트와 관련된 데이터를 렌더 스레드(1020)로 출력할 수 있다. 렌더 스레드(1020)(render thread)는 게임 스레드(1010)로부터 수신되는 데이터에 따라, 이미지 데이터를 프레임 단위로 렌더링 할 수 있다. 렌더 스레드(1020)의 렌더링 동작은 acquire, submit 및 present 동작을 포함할 수 있다. 게임 스레드(1010)는 렌더 스레드(1020)의 하나의 프레임의 렌더링 처리가 종료되는 경우, 다음 프레임에 대한 데이터를 렌더 스레드(1020)로 제공할 수 있다.According to various embodiments, the game thread 1010 (game thread) may process a user input and perform game logic based on the user input. The game thread 1010 may output data related to image update according to execution of game logic to the render thread 1020 . The render thread 1020 may render image data in units of frames according to data received from the game thread 1010 . Rendering operations of the render thread 1020 may include acquire, submit, and present operations. When the rendering process of one frame of the render thread 1020 is finished, the game thread 1010 may provide data for the next frame to the render thread 1020 .

도 10을 참조 하면, 렌더 스레드(1020)에서 이미지 프레임이 처리되는 동안 게임 스레드(1010)에서 사용자 입력 처리(1081) 및 게임 로직(1082)의 실행이 완료될 수 있다. 이 경우, 게임 스레드(1010)는 렌더 스레드(1020)가 해당 프레임의 처리를 완료할 때까지 대기(1083)할 수 있다. 이 경우, 렌더 스레드(1020)의 acquire(1092) 수행 시점에 GPU의 이전 프레임(1091)에 대한 작업이 완료되지 않을 수 있기 때문에, acquire(1092) 실행이 지연될 수 있다. 이와 같이 acquire(1092) 동작의 지연에 따라, submit(1093), present(1094) 동작도 지연되게 되어, 전체적으로 이미지 데이터의 처리 시간이 증가할 수 있다.Referring to FIG. 10 , while the image frame is processed in the render thread 1020 , the execution of the user input processing 1081 and the game logic 1082 in the game thread 1010 may be completed. In this case, the game thread 1010 may wait 1083 until the render thread 1020 completes the processing of the corresponding frame. In this case, since the operation on the previous frame 1091 of the GPU may not be completed at the time when the acquire 1092 of the render thread 1020 is performed, the acquire 1092 execution may be delayed. As described above, depending on the delay of the acquire (1092) operation, the submit (1093) and present (1094) operations are also delayed, so that overall image data processing time can be increased.

도 11은 SPE를 사용한 이후 게임 엔진에서 수행되는 스레드의 일 예를 도시한 것이다.11 illustrates an example of a thread executed in a game engine after using the SPE.

다양한 실시예에 따르면, 게임 엔진 또는 프레임워크는 타겟 fps를 고려하여, 실제 실행되는 프레임 처리 시간 동안에 원활한 GPU의 동작을 보정하도록 하기 위한 타임 마진(time margin)을 설정할 수 있다. 여기서, 타임 마진은 SyncFrameEnd(SFE)로 지칭될 수도 있다.According to various embodiments, the game engine or framework may set a time margin for correcting the smooth operation of the GPU during the actual execution frame processing time in consideration of the target fps. Here, the time margin may be referred to as SyncFrameEnd (SFE).

다양한 실시예에 따르면, 게임 스레드(1110)는 게임 어플리케이션 상에서 사용자 입력이 감지되더라도, SFE(1170) 동안 슬립을 수행하고, SFE(1170)가 도과한 이후 사용자 입력의 처리 및 게임 로직을 수행할 수 있다.According to various embodiments, the game thread 1110 sleeps during the SFE 1170 even when a user input is detected on the game application, and after the SFE 1170 elapses, it can process the user input and perform game logic. there is.

다양한 실시예에 따르면, SFE(1170)(또는 타임 마진)는 타겟 fps의 허용 시간과 현재 프레임의 실행 예측 시간의 차로써 계산될 수 있다. 여기서, 타겟 fps의 허용 시간은 타겟 fps에서 각 프레임의 present 부터 디스플레이에 출력하기 까지의 시간의 평균 값으로 결정될 수 있다. 현재 프레임의 실행 예측 시간은 이전의 프레임들에서 게임 스레드(1110)가 프레임을 present하는 시간의 차이의 평균으로 계산될 수 있다.According to various embodiments, the SFE 1170 (or time margin) may be calculated as the difference between the allowable time of the target fps and the execution prediction time of the current frame. Here, the allowable time of the target fps may be determined as an average value of the time from the present of each frame to the output to the display in the target fps. The predicted execution time of the current frame may be calculated as an average of differences in the time that the game thread 1110 presents the frame in previous frames.

도 11을 참조 하면, 게임 스레드(1110)는 사용자 입력이 감지 되더라도 바로 사용자 입력의 처리를 수행하지 않고, SFE(1170) 기간 동안 대기할 수 있다. 게임 스레드(1110)는 이 후 SFE(1170)가 도과한 후 사용자 입력(1181)의 처리 및 게임 로직(1182)을 수행할 수 있으며, 이에 따라 렌더 스레드(1120)가 이전 프레임(1191)을 처리할 시간이 추가로 확보되고, acquire(1192)의 수행 시간이 짧아질 수 있다.Referring to FIG. 11 , even when a user input is detected, the game thread 1110 may wait for the SFE 1170 period without immediately processing the user input. Game thread 1110 can then perform processing of user input 1181 and game logic 1182 after SFE 1170 elapses, so render thread 1120 processes previous frame 1191 . The time to be performed is additionally secured, and the execution time of the acquire 1192 may be shortened.

본 실시예와 같이 SFE를 사용할 경우, 게임 스레드가 슬립 하는 시간의 계산 시, 현재 프레임 처리 시간에 대한 예측 시간을 기반으로 계산되기 때문에 오차가 발생할 수 있다. 일 실시예에 따르면, 실제 프레임의 처리 시 SFE 시간에 오차가 발생한 경우, 해당 오차만큼 서피스 플린저의 딜레이 시간을 증가 또는 감소 시켜, 오차를 보정할 수 있다. 일 실시예에 따르면, 전자 장치는 상기 SFE 시간에 오차를 보정한 시간을 누적 저장하고, 누적된 값을 이용해 다음 프레임에 적용될 SFE 시간을 결정할 수 있다. 또한, 보정된 SFE 시간을 게임 엔진 및 프레임워크에 제공하여, 프레임 별 균일한 렌더링 타이밍 정보를 제공할 수 있으며, 게임 엔진 또는 어플리케이션에서 각 프레임 별로 정확한 애니메이션 포지션을 렌더링 하는데 활용할 수 있다.When SFE is used as in the present embodiment, an error may occur when calculating the sleep time of the game thread because it is calculated based on the predicted time for the current frame processing time. According to an embodiment, when an error occurs in the SFE time during actual frame processing, the error may be corrected by increasing or decreasing the delay time of the surface flinger by the corresponding error. According to an embodiment, the electronic device may accumulate and store an error correction time in the SFE time, and determine the SFE time to be applied to the next frame using the accumulated value. In addition, by providing the corrected SFE time to the game engine and framework, it is possible to provide uniform rendering timing information for each frame, and it can be used to render an accurate animation position for each frame in the game engine or application.

일 실시예에 따르면, 렌드 스레드에서 acquire 실행 시간을 더 줄이기 위해, 스왑체인 이미지의 개수를 증가 시킬 수 있다. 일반적으로 모바일 플랫폼(예: 안드로이드 플랫폼)에서는 렌더 스레드에서 3개의 스왑체인 이미지를 사용하고 있으며, 스왑체인 이미지를 4개로 늘리는 경우, 특정 상황에서 acquire 실행 시간이 감소될 수 있다. 예를 들어, 이미지 렌더링 시에 GPU의 부하로 인해 GPU 프로세스가 오래 걸릴 수 있으며, 이 경우 3개의 스왑체인 이미지 중 1개는 디스플레이에 출력 중이고, 1개는 서피스 플린저에서 GPU 프로세스가 완료되지 않아 합성(composition) 작업을 대기 중이고, 나머지 1개는 GPU 프로세스에서 작업 수행 중일 수 있다. 이러한 경우, 렌더 스레드에서 acquire를 수행 하더라도, 남은 이미지가 없기 때문에 acquire 수행 시간이 길어질 수 있다. 일 실시예에 따라 스왑체인 이미지를 4개 사용하는 경우, 상기 대기 시간이 줄어들 수 있다. 즉, 게임 스레드의 input 부터 렌더 스레드의 present까지의 프레임 처리 시간이 단축될 수 있으며, 특정 프레임의 처리가 오래 걸리더라도 이를 보정할 수 있는 시간이 확보되므로, 원활환 프레임 페이싱이 수행될 수 있다.According to an embodiment, in order to further reduce the acquire execution time in the rent thread, the number of swap chain images may be increased. In general, on mobile platforms (such as Android platforms), 3 swapchain images are used in the render thread, and if you increase the swapchain images to 4, acquire execution time may be reduced in certain situations. For example, when rendering images, the GPU process may take a long time due to the load on the GPU. A composition operation is waiting, and the other one may be performing a task in a GPU process. In this case, even if acquire is performed in the render thread, since there is no image remaining, the acquire execution time may be long. According to an embodiment, when four swap chain images are used, the waiting time may be reduced. That is, the frame processing time from the input of the game thread to the present of the render thread can be shortened, and even if the processing of a specific frame takes a long time, time to correct it is secured, so that smooth frame pacing can be performed.

도 12는 다양한 실시예에 따른 전자 장치의 이미지 렌더링 방법의 흐름도이다.12 is a flowchart of an image rendering method of an electronic device according to various embodiments of the present disclosure;

다양한 실시예에 따르면, 동작 1210에서, 게임 엔진(또는 프레임워크)은 게임 어플리케이션의 실행 화면을 구성하는 프레임을 생성하기 위한 동작을 개시하고, 동작 1220에서, 프레임을 드로잉 및 present 할 수 있다. 일 실시예에 따르면, 게임 엔진은 그래픽 API로 present 하지 않고, 프레임 페이서로 present 할 수 있다.According to various embodiments, in operation 1210, the game engine (or framework) may start an operation for generating a frame constituting an execution screen of a game application, and in operation 1220, draw and present the frame. According to an embodiment, the game engine may present as a frame pacer rather than as a graphic API.

다양한 실시예에 따르면, 동작 1230에서, 프레임 페이서는 프레임의 present를 확인할 수 있다.According to various embodiments, in operation 1230 , the frame pacer may check the presence of the frame.

다양한 실시예에 따르면, 동작 1240에서, 메인 스레드는 SFE(SyncFrameEnd)(또는 타임 마진) 동안 슬립 상태로 대기한 후, SFE 시간이 도과하면 사용자 입력 및 데이터의 처리를 수행할 수 있다. 여기서, SFE(또는 타임 마진)는 타겟 fps의 허용 시간과 현재 프레임의 실행 예측 시간의 차로써 계산될 수 있다.According to various embodiments, in operation 1240 , the main thread waits in a sleep state for a SyncFrameEnd (SFE) (or time margin), and then may process user input and data when the SFE time elapses. Here, the SFE (or time margin) may be calculated as a difference between the allowable time of the target fps and the execution prediction time of the current frame.

다양한 실시예에 따르면, 동작 1250에서 프레임 페이서는 스왑 체인 스레드를 통해 present를 수행할 수 있다. 동작 1270에서, 스왑 체인 스레드는 이전 프레임의 GPU 렌더링이 완료 되었는지 확인하고, GPU 렌더링이 완료된 경우, 동작 1260에서 그래픽 API의 present(예: vkQueuepresentKHR)를 수행할 수 있다. 이와 같이, 스왑 체인 스레드에서 acquire 및 present를 수행하여, 게임 엔진의 CPU 처리 시간을 보장할 수 있다. 또한, GPU의 렌더링이 끝나는 시점을 확인하여 present를 수행하기 때문에 GPU 바운드 상황에서 보다 안정적인 프레임 시간을 제공할 수 있다.According to various embodiments, in operation 1250, the frame pacer may perform a present through a swap chain thread. In operation 1270 , the swap chain thread checks whether GPU rendering of the previous frame is completed, and when GPU rendering is completed, in operation 1260 , presenting the graphics API (eg, vkQueuepresentKHR) may be performed. In this way, by performing acquire and present in the swap chain thread, it is possible to guarantee the CPU processing time of the game engine. In addition, since the present is performed by checking when the rendering of the GPU is finished, it is possible to provide a more stable frame time in a GPU-bound situation.

다양한 실시예에 따른 전자 장치는, 디스플레이, 메모리, 및 상기 디스플레이 및 상기 메모리와 작동적으로 연결되는 프로세서를 포함하고, 상기 프로세서는, 어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하고, 상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하고, 상기 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하고, 상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하고, 및 상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하도록 설정될 수 있다.An electronic device according to various embodiments of the present disclosure includes a display, a memory, and a processor operatively connected to the display and the memory, wherein the processor processes user input and data on the application in response to the execution of the application Creating a render thread that renders image data in units of frames based on a main thread related to and data processed in the main thread, and displaying an execution screen of the application on the display setting a target frame rate, calculating an expected processing time of the current frame based on the processing time of at least one previous frame output through the display, and based on the target frame rate and the calculated expected processing time, It may be configured to determine a time margin and perform the user input and data processing after the main thread waits in a sleep state for the time margin.

다양한 실시예에 따르면, 상기 프로세서는, 상기 적어도 하나의 이전 프레임의 present 시간을 기반으로 상기 예상 처리 시간을 계산하도록 설정될 수 있다.According to various embodiments, the processor may be configured to calculate the expected processing time based on a present time of the at least one previous frame.

다양한 실시예에 따르면, 상기 프로세서는, 상기 메인 스레드가 상기 현재 프레임에 대응하는 시간 구간 이전에 입력된 사용자 입력의 처리를 상기 슬립 상태가 종료된 이후에 처리하도록 설정될 수 있다.According to various embodiments, the processor may be configured such that the main thread processes a user input input before a time interval corresponding to the current frame after the sleep state ends.

다양한 실시예에 따르면, 상기 프로세서는, 상기 메인 스레드 및 상기 렌더 스레드를 실행하는 CPU(central processing unit) 및 상기 CPU의 present 명령에 따라 프레임을 렌더링 하는 GPU(graphic processing unit)를 포함할 수 있다.According to various embodiments, the processor may include a central processing unit (CPU) that executes the main thread and the render thread, and a graphic processing unit (GPU) that renders a frame according to a present instruction of the CPU.

다양한 실시예에 따르면, 상기 CPU는, 게임 엔진 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우, 상기 특정 프레임의 이전 프레임에 대한 상기 GPU의 렌더링 동작이 종료된 이후에 상기 수신되는 present 정보에 대응하는 present 명령을 상기 GPU로 전달하도록 설정될 수 있다.According to various embodiments, when the CPU receives the present information for a specific frame from the game engine or the framework, the present information is received after the rendering operation of the GPU for the previous frame of the specific frame is finished. It may be configured to transmit a present command corresponding to .

다양한 실시예에 따르면, 상기 present 명령에 따라 렌더링 한 프레임은 서피스 플린저(surface flinger)로 전달되고, 상기 서피스 플린저는 수직 동기 신호에 따라 상기 프레임을 상기 디스플레이 상에 표시하도록 할 수 있다.According to various embodiments, the frame rendered according to the present command is transmitted to a surface flinger, and the surface flinger may display the frame on the display according to a vertical synchronization signal.

다양한 실시예에 따르면, 상기 서피스 플린저는, 상기 GPU의 렌더링 동작이 완료된 후 소정의 딜레이 시간 이후에 상기 렌더링 된 프레임을 처리하도록 설정될 수 있다.According to various embodiments, the surface flinger may be set to process the rendered frame after a predetermined delay time after the rendering operation of the GPU is completed.

다양한 실시예에 따르면, 상기 프로세서는, 스왑 체인(swapchain) 스레드를 더 실행하고, 생성된 프레임의 present 명령을 상기 스왑 체인 스레드를 통해 수행하도록 할 수 있다.According to various embodiments, the processor may further execute a swap chain thread and perform a present command of the generated frame through the swap chain thread.

다양한 실시예에 따르면, 상기 스왑 체인 스레드는, 현재 프레임을 GPU 및 서피스 플린저에 전달할 함수 및 다음 프레임을 획득하기 위한 함수를 수행하도록 설정될 수 있다.According to various embodiments, the swap chain thread may be configured to perform a function to transmit a current frame to the GPU and the surface flinger and a function to obtain a next frame.

다양한 실시예에 따르면, 상기 어플리케이션은 게임 어플리케이션일 수 있다.According to various embodiments, the application may be a game application.

다양한 실시예에 따른 전자 장치의 이미지 렌더링 방법은, 어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하는 동작, 상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하는 동작, 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하는 동작, 상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하는 동작, 및 상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하는 동작을 포함할 수 있다.An image rendering method of an electronic device according to various embodiments includes a main thread related to a user input and data processing in the application in response to execution of an application, and a frame unit based on data processed in the main thread An operation of creating a render thread for rendering raw image data, an operation of setting a target frame rate for displaying the execution screen of the application on the display, and processing of at least one previous frame output through the display calculating an expected processing time of the current frame based on time, determining a time margin based on the target frame rate and the calculated expected processing time, and causing the main thread to execute the time margin After waiting in the sleep state for a while, the operation may include performing the user input and data processing.

다양한 실시예에 따르면, 상기 예상 처리 시간을 계산하는 동작은, 상기 적어도 하나의 이전 프레임의 present 시간을 기반으로 상기 예상 처리 시간을 계산하는 동작을 포함할 수 있다.According to various embodiments, the calculating of the expected processing time may include calculating the expected processing time based on a present time of the at least one previous frame.

다양한 실시예에 따르면, 상기 프로세서는, 상기 메인 스레드가 상기 현재 프레임에 대응하는 시간 구간 이전에 입력된 사용자 입력의 처리를 상기 슬립 상태가 종료된 이후에 처리하는 동작을 포함할 수 있다.According to various embodiments, the processor may include an operation in which the main thread processes a user input input before a time interval corresponding to the current frame after the sleep state ends.

다양한 실시예에 따르면, 상기 전자 장치는, 상기 메인 스레드 및 상기 렌더 스레드를 실행하는 CPU(central processing unit) 및 상기 CPU의 present 명령에 따라 프레임을 렌더링 하는 GPU(graphic processing unit)를 포함할 수 있다.According to various embodiments, the electronic device may include a central processing unit (CPU) that executes the main thread and the render thread, and a graphic processing unit (GPU) that renders a frame according to a present command of the CPU. .

다양한 실시예에 따르면, 상기 CPU는, 게임 엔진 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우, 상기 특정 프레임의 이전 프레임에 대한 상기 GPU의 렌더링 동작이 종료된 이후에 상기 수신되는 present 정보에 대응하는 present 명령을 상기 GPU로 전달하도록 설정될 수 있다.According to various embodiments, when the CPU receives the present information for a specific frame from the game engine or the framework, the present information is received after the rendering operation of the GPU for the previous frame of the specific frame is finished. It may be configured to transmit a present command corresponding to .

다양한 실시예에 따르면, 상기 present 명령에 따라 렌더링 한 프레임은 서피스 플린저(surface flinger)로 전달되고, 상기 서피스 플린저는 수직 동기 신호에 따라 상기 프레임을 상기 디스플레이 상에 표시할 수 있다.According to various embodiments, the frame rendered according to the present command is transmitted to a surface flinger, and the surface flinger may display the frame on the display according to a vertical synchronization signal.

다양한 실시예에 따르면, 상기 서피스 플린저가 상기 GPU의 렌더링 동작이 완료된 후 소정의 딜레이 시간 이후에 상기 렌더링 된 프레임을 처리하는 동작을 포함할 수 있다.According to various embodiments, the method may include, by the surface flinger, processing the rendered frame after a predetermined delay time after the rendering operation of the GPU is completed.

다양한 실시예에 따르면, 스왑 체인(swapchain) 스레드를 더 실행하는 동작, 및 생성된 프레임의 present 명령을 상기 스왑 체인 스레드를 통해 수행하는 동작을 포함할 수 있다.According to various embodiments, it may include an operation of further executing a swap chain thread, and an operation of performing a present command of the generated frame through the swap chain thread.

다양한 실시예에 따르면, 상기 스왑 체인 스레드는, 현재 프레임을 GPU 및 서피스 플린저에 전달할 함수 및 다음 프레임을 획득하기 위한 함수를 수행할 수 있다.According to various embodiments, the swap chain thread may perform a function to transmit the current frame to the GPU and the surface flinger and a function to obtain the next frame.

다양한 실시예에 따르면, 상기 어플리케이션은 게임 어플리케이션일 수 있다.According to various embodiments, the application may be a game application.

Claims (20)

전자 장치에 있어서,
디스플레이;
메모리; 및
상기 디스플레이 및 상기 메모리와 작동적으로 연결되는 프로세서를 포함하고,
상기 프로세서는,
어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하고,
상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하고,
상기 디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하고,
상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하고, 및
상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하도록 설정된 전자 장치.
In an electronic device,
display;
Memory; and
a processor operatively coupled to the display and the memory;
The processor is
In response to the execution of the application, a main thread related to user input and data processing on the application and a render thread that renders image data in units of frames based on data processed in the main thread create,
setting a target frame rate for displaying the execution screen of the application on the display;
calculating an expected processing time of the current frame based on the processing time of at least one previous frame output through the display;
determine a time margin based on the target frame rate and the calculated expected processing time, and
The electronic device is configured to perform the user input and data processing after the main thread waits in a sleep state for the time margin.
제 1항에 있어서,
상기 프로세서는,
상기 적어도 하나의 이전 프레임의 present 시간을 기반으로 상기 예상 처리 시간을 계산하도록 설정된 전자 장치.
The method of claim 1,
The processor is
The electronic device is configured to calculate the expected processing time based on a present time of the at least one previous frame.
제 1항에 있어서,
상기 프로세서는,
상기 메인 스레드가 상기 현재 프레임에 대응하는 시간 구간 이전에 입력된 사용자 입력의 처리를 상기 슬립 상태가 종료된 이후에 처리하도록 설정된 전자 장치.
The method of claim 1,
The processor is
The electronic device is configured such that the main thread processes a user input input before a time interval corresponding to the current frame after the sleep state ends.
제 1항에 있어서,
상기 프로세서는,
상기 메인 스레드 및 상기 렌더 스레드를 실행하는 CPU(central processing unit) 및 상기 CPU의 present 명령에 따라 프레임을 렌더링 하는 GPU(graphic processing unit)를 포함하는 전자 장치.
The method of claim 1,
The processor is
and a central processing unit (CPU) executing the main thread and the render thread, and a graphic processing unit (GPU) rendering a frame according to a present command of the CPU.
제 4항에 있어서,
상기 CPU는,
게임 엔진 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우,
상기 특정 프레임의 이전 프레임에 대한 상기 GPU의 렌더링 동작이 종료된 이후에 상기 수신되는 present 정보에 대응하는 present 명령을 상기 GPU로 전달하도록 설정된 전자 장치.
5. The method of claim 4,
The CPU is
When receiving present information for a specific frame from the game engine or framework,
The electronic device is configured to transmit a present command corresponding to the received present information to the GPU after the rendering operation of the GPU for the frame preceding the specific frame is finished.
제 5항에 있어서,
상기 present 명령에 따라 렌더링 한 프레임은 서피스 플린저(surface flinger)로 전달되고,
상기 서피스 플린저는 수직 동기 신호에 따라 상기 프레임을 상기 디스플레이 상에 표시하도록 하는 전자 장치.
6. The method of claim 5,
The frame rendered according to the present command is transmitted to the surface flinger,
The surface flinger is configured to display the frame on the display according to a vertical synchronization signal.
제 6항에 있어서,
상기 서피스 플린저는,
상기 GPU의 렌더링 동작이 완료된 후 소정의 딜레이 시간 이후에 상기 렌더링 된 프레임을 처리하도록 설정된 전자 장치.
7. The method of claim 6,
The surface flinger is
An electronic device configured to process the rendered frame after a predetermined delay time after the rendering operation of the GPU is completed.
제 1항에 있어서,
상기 프로세서는,
스왑 체인(swapchain) 스레드를 더 실행하고,
생성된 프레임의 present 명령을 상기 스왑 체인 스레드를 통해 수행하도록 하는 전자 장치.
The method of claim 1,
The processor is
run more swapchain threads,
An electronic device for performing a present command of a generated frame through the swap chain thread.
제 8항에 있어서,
상기 스왑 체인 스레드는,
현재 프레임을 GPU 및 서피스 플린저에 전달할 함수 및 다음 프레임을 획득하기 위한 함수를 수행하도록 설정된 전자 장치.
9. The method of claim 8,
The swap chain thread is
An electronic device configured to perform a function to pass the current frame to the GPU and surface flinger and a function to obtain the next frame.
제 1항에 있어서,
상기 어플리케이션은 게임 어플리케이션인 전자 장치.
The method of claim 1,
The electronic device is a game application.
전자 장치의 이미지 렌더링 방법에 있어서,
어플리케이션의 실행에 대응하여, 상기 어플리케이션 상에서 사용자의 입력 및 데이터 처리와 관련된 메인 스레드(main thread) 및 상기 메인 스레드에서 처리된 데이터를 기반으로 프레임 단위로 이미지 데이터를 렌더링 하는 렌더 스레드(render thread)를 생성하는 동작;
상기 어플리케이션의 실행 화면을 상기 디스플레이 상에 표시하기 위한 타겟 프레임 레이트를 설정하는 동작;
디스플레이를 통해 출력된 적어도 하나의 이전 프레임의 처리 시간을 기반으로, 현재 프레임의 예상 처리 시간을 계산하는 동작;
상기 타겟 프레임 레이트 및 상기 계산된 예상 처리 시간에 기초하여, 타임 마진(time margin)을 결정하는 동작; 및
상기 메인 스레드가 상기 타임 마진 동안 슬립 상태로 대기한 후, 상기 사용자 입력 및 데이터 처리를 수행하는 동작을 포함하는 방법.
In the image rendering method of an electronic device,
In response to the execution of the application, a main thread related to user input and data processing on the application and a render thread that renders image data in units of frames based on data processed in the main thread generating action;
setting a target frame rate for displaying the execution screen of the application on the display;
calculating an expected processing time of the current frame based on the processing time of at least one previous frame output through the display;
determining a time margin based on the target frame rate and the calculated expected processing time; and
and, after the main thread waits in a sleep state for the time margin, performing the user input and data processing.
제 11항에 있어서,
상기 예상 처리 시간을 계산하는 동작은,
상기 적어도 하나의 이전 프레임의 present 시간을 기반으로 상기 예상 처리 시간을 계산하는 동작을 포함하는 방법.
12. The method of claim 11,
The operation of calculating the expected processing time is,
and calculating the expected processing time based on the present time of the at least one previous frame.
제 11항에 있어서,
상기 프로세서는,
상기 메인 스레드가 상기 현재 프레임에 대응하는 시간 구간 이전에 입력된 사용자 입력의 처리를 상기 슬립 상태가 종료된 이후에 처리하는 동작을 포함하는 방법.
12. The method of claim 11,
The processor is
and processing, by the main thread, a user input input before a time interval corresponding to the current frame after the sleep state is terminated.
제 11항에 있어서,
상기 전자 장치는,
상기 메인 스레드 및 상기 렌더 스레드를 실행하는 CPU(central processing unit) 및 상기 CPU의 present 명령에 따라 프레임을 렌더링 하는 GPU(graphic processing unit)를 포함하는 방법.
12. The method of claim 11,
The electronic device is
A method comprising: a central processing unit (CPU) executing the main thread and the render thread; and a graphic processing unit (GPU) rendering a frame according to a present instruction of the CPU.
제 14항에 있어서,
상기 CPU는,
게임 엔진 또는 프레임워크로부터 특정 프레임에 대한 present 정보를 수신하는 경우,
상기 특정 프레임의 이전 프레임에 대한 상기 GPU의 렌더링 동작이 종료된 이후에 상기 수신되는 present 정보에 대응하는 present 명령을 상기 GPU로 전달하도록 설정된 방법.
15. The method of claim 14,
The CPU is
When receiving present information for a specific frame from the game engine or framework,
A method configured to transmit a present command corresponding to the received present information to the GPU after the rendering operation of the GPU for the frame preceding the specific frame is finished.
제 15항에 있어서,
상기 present 명령에 따라 렌더링 한 프레임은 서피스 플린저(surface flinger)로 전달되고,
상기 서피스 플린저는 수직 동기 신호에 따라 상기 프레임을 상기 디스플레이 상에 표시하는 방법.
16. The method of claim 15,
The frame rendered according to the present command is transmitted to the surface flinger,
wherein the surface flinger displays the frame on the display according to a vertical sync signal.
제 16항에 있어서,
상기 서피스 플린저가 상기 GPU의 렌더링 동작이 완료된 후 소정의 딜레이 시간 이후에 상기 렌더링 된 프레임을 처리하는 동작을 포함하는 방법.
17. The method of claim 16,
and processing, by the surface flinger, the rendered frame after a predetermined delay time after the rendering operation of the GPU is completed.
제 11항에 있어서,
스왑 체인(swapchain) 스레드를 더 실행하는 동작; 및
생성된 프레임의 present 명령을 상기 스왑 체인 스레드를 통해 수행하는 동작을 포함하는 방법.
12. The method of claim 11,
running more swapchain threads; and
and performing a present command of the generated frame through the swap chain thread.
제 18항에 있어서,
상기 스왑 체인 스레드는,
현재 프레임을 GPU 및 서피스 플린저에 전달할 함수 및 다음 프레임을 획득하기 위한 함수를 수행하는 방법.
19. The method of claim 18,
The swap chain thread is
How to perform a function to pass the current frame to the GPU and surface flinger, and a function to get the next frame.
제 11항에 있어서,
상기 어플리케이션은 게임 어플리케이션인 방법.
12. The method of claim 11,
wherein the application is a game application.
KR1020210052642A 2020-11-13 2021-04-22 Electrnonic device and method for image rendering thereof KR20220065650A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/KR2021/016648 WO2022103225A1 (en) 2020-11-13 2021-11-15 Electronic device and image rendering method of electronic device
US17/544,411 US11935149B2 (en) 2020-11-13 2021-12-07 Electronic device and image rendering method thereof for adjusting frame rate

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
KR20200152270 2020-11-13
KR1020200152270 2020-11-13

Publications (1)

Publication Number Publication Date
KR20220065650A true KR20220065650A (en) 2022-05-20

Family

ID=81801538

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020210052642A KR20220065650A (en) 2020-11-13 2021-04-22 Electrnonic device and method for image rendering thereof

Country Status (1)

Country Link
KR (1) KR20220065650A (en)

Similar Documents

Publication Publication Date Title
US11386866B2 (en) Electronic device and screen refresh method thereof
US20220189408A1 (en) Electronic device and method for controlling refresh rate of display
US20230178001A1 (en) Electronic device and method for quickly updating partial region of screen
KR20220113064A (en) An electronic device and a method controlling the same
US11935149B2 (en) Electronic device and image rendering method thereof for adjusting frame rate
US11842670B2 (en) Electronic device for dynamically adjusting refresh rate of display
US11749173B2 (en) Electronic device configured to quickly update screen upon receiving input from peripheral device
WO2022103225A1 (en) Electronic device and image rendering method of electronic device
US11609660B2 (en) Electronic device including flexible display and method using the same
KR20220065650A (en) Electrnonic device and method for image rendering thereof
KR20220064267A (en) Electronic device including flexible display and method using the same
EP4398233A1 (en) Electronic device comprising display and operation method therefor
EP4350678A1 (en) Electronic apparatus and method for changing refresh rate
US20240185762A1 (en) Electronic device and method for synchronizing timing of processing commands for controlling display panel
EP4380146A1 (en) Electronic device and method for display synchronization
US20240112609A1 (en) Electronic device controlling pulse signal from processor to display
EP4366288A1 (en) Electronic device for reducing screen presentation time, and control method therefor
KR20240054828A (en) Electronic device including display and method for controlling thereof
US20230114167A1 (en) Electronic device and synchronization method based on display driving signal in electronic device
KR20240131212A (en) Electronic device and method controlling command to display
KR20230026236A (en) Electronic device and method for synchronizing timing processing commands controlling display panel
KR20240066937A (en) Electronic device and method for controlling of synchronizing of image frame in the electronic device
KR20240076338A (en) Electronic device including display and method for controlling thereof
KR20240127227A (en) Electronic device inclluding display for change of mode
KR20230012350A (en) Electronic device that quickly updates a screen upon receiving an input from a peripheral device

Legal Events

Date Code Title Description
A201 Request for examination